зеркало из https://github.com/mozilla/pjs.git
Bug 336104 - "ASSERTION: no frame, see bug #188946"; r=roc
This commit is contained in:
Родитель
5c358a318e
Коммит
759c1cd0ce
|
@ -92,4 +92,5 @@ include $(topsrcdir)/config/rules.mk
|
|||
INCLUDES += \
|
||||
-I$(topsrcdir)/content/base/src \
|
||||
-I$(topsrcdir)/content/events/src \
|
||||
-I$(topsrcdir)/layout/style \
|
||||
$(NULL)
|
||||
|
|
|
@ -110,6 +110,7 @@
|
|||
#include "nsIParserService.h"
|
||||
|
||||
#include "nsITransferable.h"
|
||||
#include "nsComputedDOMStyle.h"
|
||||
|
||||
#include "mozilla/FunctionTimer.h"
|
||||
|
||||
|
@ -3972,10 +3973,14 @@ nsEditor::IsPreformatted(nsIDOMNode *aNode, PRBool *aResult)
|
|||
nsCOMPtr<nsIPresShell> ps = do_QueryReferent(mPresShellWeak);
|
||||
if (!ps) return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
nsIFrame *frame = content->GetPrimaryFrame();
|
||||
nsRefPtr<nsStyleContext> elementStyle;
|
||||
if (content->IsElement()) {
|
||||
elementStyle = nsComputedDOMStyle::GetStyleContextForElement(content->AsElement(),
|
||||
nsnull,
|
||||
ps);
|
||||
}
|
||||
|
||||
NS_ASSERTION(frame, "no frame, see bug #188946");
|
||||
if (!frame)
|
||||
if (!elementStyle)
|
||||
{
|
||||
// Consider nodes without a style context to be NOT preformatted:
|
||||
// For instance, this is true of JS tags inside the body (which show
|
||||
|
@ -3984,7 +3989,7 @@ nsEditor::IsPreformatted(nsIDOMNode *aNode, PRBool *aResult)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
const nsStyleText* styleText = frame->GetStyleText();
|
||||
const nsStyleText* styleText = elementStyle->GetStyleText();
|
||||
|
||||
*aResult = styleText->WhiteSpaceIsSignificant();
|
||||
return NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче