Changeset 274398 in webkit
- Timestamp:
- Mar 14, 2021, 7:46:34 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
rendering/RenderLineBreak.cpp (modified) (1 diff)
-
rendering/updating/RenderTreeBuilder.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r274396 r274398 1 2021-03-14 Zalan Bujtas <zalan@apple.com> 2 3 RenderLineBreak should stay inline level box even when display property says otherwise. 4 https://bugs.webkit.org/show_bug.cgi?id=223151 5 <rdar://74339837> 6 7 Reviewed by Antti Koivisto. 8 9 In this patch we make sure that the RenderLineBreak object always stays inline. 10 11 While the display property applies to all elements (https://drafts.csswg.org/css-display/#the-display-properties), the line 12 break element (<br>) seems to be an exception and all browsers handle <br style="display: block"> still as an inline level element. 13 14 Renderers can (and do see RenderSVGInline::updateFromStyle) diverge from this computed display value and say they always want to 15 be inline level boxes. This is ensured by RenderObject::setInline/isInline function pair. 16 17 Initially there were 2 setInline() calls: 18 One in RenderObject::setStyle(). It dealt with "block to inline" transition and 19 one call in RenderBox::setStyle(). 20 In these functions we simply set the renderer's "inInline" bit to the computed style value (setInline(style.isDisplayInlineType)). 21 However derived renderer classes were able to override it by implementing the ::setStyle function and 22 explicitly set the "isInline" bit to true/false. 23 24 Over the years the second (RenderBox::setStyle) call transitioned to RenderBoxModelObject::updateFromStyle() 25 and the first (RenderObject::setStyle) call got moved to normalizeTreeAfterStyleChange() and their order got flipped. 26 27 Derived renderer classes can still explicitly set the "isInline" bit by implementing the ::updateFromStyle() function 28 (this is similar to what we had with ::setStyle). 29 However since the order is flipped, the "setInline()" call in normalizeTreeAfterStyleChange() now runs after 30 updateFromStyle() and it may re-reset the "isInline" bit back to the computed value (hence the FIXME). 31 32 The "setInline" call in normalizeTreeAfterStyleChange() is not needed anymore since the "isInline" bit is already updated by 33 the time we get here (as opposed to when it was initially introduced in RenderObject::setStyle, see above). 34 35 * rendering/RenderLineBreak.cpp: 36 (WebCore::RenderLineBreak::updateFromStyle): 37 * rendering/updating/RenderTreeBuilder.cpp: 38 (WebCore::RenderTreeBuilder::normalizeTreeAfterStyleChange): 39 1 40 2021-03-13 Wenson Hsieh <wenson_hsieh@apple.com> 2 41 -
trunk/Source/WebCore/rendering/RenderLineBreak.cpp
r271349 r274398 175 175 { 176 176 m_cachedLineHeight = invalidLineHeight; 177 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(isInline()); 177 178 } 178 179 -
trunk/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp
r274278 r274398 579 579 // having an impact. See if there is a mismatch between the parent flow's 580 580 // childrenInline() state and our state. 581 // FIXME(186894): startsAffectingParent has clearly nothing to do with resetting the inline state.582 if (!is<RenderSVGInline>(renderer))583 renderer.setInline(renderer.style().isDisplayInlineType());584 581 if (renderer.isInline() != renderer.parent()->childrenInline()) 585 582 childFlowStateChangesAndAffectsParentBlock(renderer);
Note:
See TracChangeset
for help on using the changeset viewer.