Skip to content

Commit 52d4322

Browse files
committed
Bug 1540220 - Remove some useless usage of LazyComputeBehavior::Allow. r=dholbert
This switches nsFrameSetFrame's hacky frame construction codepath to operate on the flattened tree, since it made me a bit more comfortable about it (all layout should operate on is the flattened tree, though in this cause this should not cause any web-observable behavior change, since can't be a shadow host per spec, and we no longer support XBL-in-content). That doesn't need to compute styles lazily. You only need to compute styles lazily in descendants of display: none elements, and even though this code doesn't check on display: none _on the children_, the parent element should never have display: none (since we're creating an nsFrameSetFrame for it). There are other places that still call into this (apart from getComputedStyle). One is nsImageFrame's cursor code. Given the elements referencing an image map could be anywhere, we need to have lazy computation here. The other is the viewport style propagation stuff. There shouldn't be a need for LazyComputeBehavior::Allow on the document element in order to check the viewport styles propagation, since the root element can't have display: none ancestors. But we run that code before actually constructing the doc element containing block, which is when we do the initial document styling. We could remove that with some more effort, but it's not worth it right now, since we need to keep using it for the , since the document element could be display: none itself, and we propagate the overflow styles in that case still. I filed w3c/csswg-drafts#3779 to potentially change that. Differential Revision: https://phabricator.services.mozilla.com/D25455 UltraBlame original commit: ae9783be99324502017f3c9bfc92cb811fd1993e
1 parent 954a573 commit 52d4322

File tree

1 file changed

+65
-30
lines changed

1 file changed

+65
-30
lines changed

layout/generic/nsFrameSetFrame.cpp

Lines changed: 65 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,17 @@ mozilla
353353
/
354354
dom
355355
/
356+
ChildIterator
357+
.
358+
h
359+
"
360+
#
361+
include
362+
"
363+
mozilla
364+
/
365+
dom
366+
/
356367
HTMLFrameSetElement
357368
.
358369
h
@@ -2161,27 +2172,31 @@ or
21612172
frameset
21622173
>
21632174
children
2175+
FlattenedChildIterator
2176+
children
2177+
(
2178+
mContent
2179+
)
2180+
;
21642181
for
21652182
(
21662183
nsIContent
21672184
*
21682185
child
21692186
=
2170-
mContent
2171-
-
2172-
>
2173-
GetFirstChild
2187+
children
2188+
.
2189+
GetNextChild
21742190
(
21752191
)
21762192
;
21772193
child
21782194
;
21792195
child
21802196
=
2181-
child
2182-
-
2183-
>
2184-
GetNextSibling
2197+
children
2198+
.
2199+
GetNextChild
21852200
(
21862201
)
21872202
)
@@ -2298,20 +2313,6 @@ if
22982313
child
22992314
-
23002315
>
2301-
IsHTMLElement
2302-
(
2303-
)
2304-
)
2305-
{
2306-
continue
2307-
;
2308-
}
2309-
if
2310-
(
2311-
!
2312-
child
2313-
-
2314-
>
23152316
IsAnyOfHTMLElements
23162317
(
23172318
nsGkAtoms
@@ -2328,11 +2329,48 @@ frame
23282329
continue
23292330
;
23302331
}
2332+
/
2333+
/
2334+
FIXME
2335+
(
2336+
emilio
2337+
)
2338+
:
2339+
This
2340+
doesn
2341+
'
2342+
t
2343+
even
2344+
respect
2345+
display
2346+
:
2347+
none
2348+
but
2349+
that
2350+
matches
2351+
/
2352+
/
2353+
other
2354+
browsers
2355+
;
2356+
_
2357+
;
2358+
/
2359+
/
2360+
/
2361+
/
2362+
Maybe
2363+
we
2364+
should
2365+
change
2366+
that
2367+
though
2368+
.
23312369
RefPtr
23322370
<
23332371
ComputedStyle
23342372
>
2335-
kidSC
2373+
kidStyle
23362374
=
23372375
presShell
23382376
-
@@ -2342,18 +2380,15 @@ StyleSet
23422380
)
23432381
-
23442382
>
2345-
ResolveStyleFor
2383+
ResolveServoStyle
23462384
(
2385+
*
23472386
child
23482387
-
23492388
>
23502389
AsElement
23512390
(
23522391
)
2353-
LazyComputeBehavior
2354-
:
2355-
:
2356-
Allow
23572392
)
23582393
;
23592394
nsIFrame
@@ -2379,7 +2414,7 @@ frame
23792414
NS_NewHTMLFramesetFrame
23802415
(
23812416
presShell
2382-
kidSC
2417+
kidStyle
23832418
)
23842419
;
23852420
nsHTMLFramesetFrame
@@ -2452,7 +2487,7 @@ frame
24522487
NS_NewSubDocumentFrame
24532488
(
24542489
presShell
2455-
kidSC
2490+
kidStyle
24562491
)
24572492
;
24582493
frame

0 commit comments

Comments
 (0)