diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index e1909c0875f..6529e6c120f 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -3149,25 +3149,23 @@ FindCanvasBackground(nsIFrame* aForFrame, nsIDocument* document = content->GetOwnerDoc(); nsCOMPtr htmlDoc = do_QueryInterface(document); if (htmlDoc) { - if (!document->IsCaseSensitive()) { // HTML, not XHTML - nsCOMPtr body; - htmlDoc->GetBody(getter_AddRefs(body)); - nsCOMPtr bodyContent = do_QueryInterface(body); - // We need to null check the body node (bug 118829) since - // there are cases, thanks to the fix for bug 5569, where we - // will reflow a document with no body. In particular, if a - // SCRIPT element in the head blocks the parser and then has a - // SCRIPT that does "document.location.href = 'foo'", then - // nsParser::Terminate will call |DidBuildModel| methods - // through to the content sink, which will call |StartLayout| - // and thus |InitialReflow| on the pres shell. See bug 119351 - // for the ugly details. - if (bodyContent) { - nsIFrame *bodyFrame = aForFrame->PresContext()->GetPresShell()-> - GetPrimaryFrameFor(bodyContent); - if (bodyFrame) - result = bodyFrame->GetStyleBackground(); - } + nsCOMPtr body; + htmlDoc->GetBody(getter_AddRefs(body)); + nsCOMPtr bodyContent = do_QueryInterface(body); + // We need to null check the body node (bug 118829) since + // there are cases, thanks to the fix for bug 5569, where we + // will reflow a document with no body. In particular, if a + // SCRIPT element in the head blocks the parser and then has a + // SCRIPT that does "document.location.href = 'foo'", then + // nsParser::Terminate will call |DidBuildModel| methods + // through to the content sink, which will call |StartLayout| + // and thus |InitialReflow| on the pres shell. See bug 119351 + // for the ugly details. + if (bodyContent) { + nsIFrame *bodyFrame = aForFrame->PresContext()->GetPresShell()-> + GetPrimaryFrameFor(bodyContent); + if (bodyFrame) + result = bodyFrame->GetStyleBackground(); } } } @@ -3221,9 +3219,6 @@ FindElementBackground(nsIFrame* aForFrame, if (!htmlDoc) return PR_TRUE; - if (document->IsCaseSensitive()) // XHTML, not HTML - return PR_TRUE; - nsCOMPtr body; htmlDoc->GetBody(getter_AddRefs(body)); nsCOMPtr bodyContent = do_QueryInterface(body); diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 1858d499b7e..1aeb1756c01 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -2108,7 +2108,7 @@ nsGfxScrollFrameInner::IsLTR() const // But for HTML we want the body element. nsCOMPtr htmlDoc = do_QueryInterface(document); - if (htmlDoc && !document->IsCaseSensitive()) { // HTML, not XHTML + if (htmlDoc) { nsCOMPtr body; htmlDoc->GetBody(getter_AddRefs(body)); nsCOMPtr bodyContent = do_QueryInterface(body); diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index cce19e61a5b..d424f131f15 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -501,6 +501,10 @@ random-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 379316-2.html 379316-2-ref.html # bug == 379361-1.html 379361-1-ref.html == 379361-2.html 379361-2-ref.html == 379361-3.html 379361-3-ref.html +== 379461-1.xhtml 379461-1.html +== 379461-2.xhtml 379461-2.html +== 379461-3-container-xhtml.html 379461-3-container-html.html +!= 379461-3-container-xhtml.html 379461-3-container-blank.html # there is a scrollbar == 380004-1.html 380004-1-ref.html == 380227-1.html 380227-1-ref.html == 380842-1.html 380842-1-ref.html