Fix font size inflation assertion when XUL is in native-anonymous content by making XUL always be a container for font size inflation. (Bug 708036) r=bzbarsky

--HG--
extra : transplant_source : %D9X%D4%25%01p%09%97%15%B6%83%B1%3A%F2H%C0P4.%19
This commit is contained in:
L. David Baron 2011-12-27 10:02:44 -05:00
Родитель 53813f804e
Коммит 254dfa054e
4 изменённых файлов: 30 добавлений и 4 удалений

Просмотреть файл

@ -4590,6 +4590,9 @@ nsLayoutUtils::IsContainerForFontSizeInflation(const nsIFrame *aFrame)
* them, so they and their anonymous content should also not be a
* container.
*
* However, because we can't reliably compute sizes across XUL during
* reflow, any XUL frame with a XUL parent is always a container.
*
* There are contexts where it would be nice if some blocks didn't
* count as a container, so that, for example, an indented quotation
* didn't end up with a smaller font size. However, it's hard to
@ -4597,9 +4600,12 @@ nsLayoutUtils::IsContainerForFontSizeInflation(const nsIFrame *aFrame)
* thing to count as a container, so we don't try, and blocks are
* always containers.
*/
bool isInline = aFrame->GetStyleDisplay()->mDisplay ==
NS_STYLE_DISPLAY_INLINE ||
aFrame->GetContent()->IsInNativeAnonymousSubtree();
bool isInline = (aFrame->GetStyleDisplay()->mDisplay ==
NS_STYLE_DISPLAY_INLINE ||
(aFrame->GetContent() &&
aFrame->GetContent()->IsInNativeAnonymousSubtree())) &&
!(aFrame->IsBoxFrame() && aFrame->GetParent() &&
aFrame->GetParent()->IsBoxFrame());
NS_ASSERTION(!aFrame->IsFrameOfType(nsIFrame::eLineParticipant) || isInline,
"line participants must not be containers");
NS_ASSERTION(aFrame->GetType() != nsGkAtoms::bulletFrame || isInline,
@ -4628,10 +4634,26 @@ nsLayoutUtils::InflationMinFontSizeFor(const nsHTMLReflowState &aReflowState)
#ifdef DEBUG
{
const nsHTMLReflowState *rs = &aReflowState;
const nsIFrame *f = aReflowState.frame;
nsIFrame *f = aReflowState.frame;
for (; rs; rs = rs->parentReflowState, f = f->GetParent()) {
NS_ABORT_IF_FALSE(rs->frame == f,
"reflow state parentage must match frame parentage");
nsIScrollableFrame *sf;
NS_ABORT_IF_FALSE(rs->parentReflowState ||
IsContainerForFontSizeInflation(f) ||
// OK if NS_FRAME_IN_REFLOW is not set on
// (non-null) parent, since its ancestors have a
// real size. (Do we set NS_FRAME_IN_REFLOW
// correctly for xul?)
!(f->GetParent()->GetStateBits() &
NS_FRAME_IN_REFLOW) ||
// ugly exception, but ok because the
// child is a container
(f->GetType() == nsGkAtoms::scrollFrame &&
(sf = do_QueryFrame(f)) &&
(IsContainerForFontSizeInflation(
sf->GetScrolledFrame()))),
"must hit container at top of reflow state chain");
}
}
#endif

Просмотреть файл

@ -381,6 +381,7 @@ _BROWSER_FILES = \
_INFLATION_REFTEST_FILES = \
$(shell find $(srcdir)/font-inflation/ -name '*.html' -o -name '*.xhtml') \
$(srcdir)/../../reftests/webm-video/black140x100.webm \
$(NULL)
libs:: $(_TEST_FILES)

Просмотреть файл

@ -0,0 +1,2 @@
<!DOCTYPE HTML>
<video src="black140x100.webm"></video>

Просмотреть файл

@ -46,6 +46,7 @@ var gTests = [
"== css-transform-1.html css-transform-1-ref.html",
"== css-transform-2.html css-transform-2-ref.html",
"== container-with-clamping.html container-with-clamping-ref.html",
"!= video-1.html about:blank", // crashtest
];
// Maintain a reference count of how many things we're waiting for until