Changeset 280893 in webkit
- Timestamp:
- Aug 11, 2021, 3:14:26 AM (5 years ago)
- Location:
- releases/WebKitGTK/webkit-2.32/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
-
releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog
r280892 r280893 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 Zalan Bujtas <zalan@apple.com> 2 41 -
releases/WebKitGTK/webkit-2.32/Source/WebCore/rendering/RenderLineBreak.cpp
r271349 r280893 175 175 { 176 176 m_cachedLineHeight = invalidLineHeight; 177 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(isInline()); 177 178 } 178 179 -
releases/WebKitGTK/webkit-2.32/Source/WebCore/rendering/updating/RenderTreeBuilder.cpp
r271357 r280893 578 578 // having an impact. See if there is a mismatch between the parent flow's 579 579 // childrenInline() state and our state. 580 // FIXME(186894): startsAffectingParent has clearly nothing to do with resetting the inline state.581 if (!is<RenderSVGInline>(renderer))582 renderer.setInline(renderer.style().isDisplayInlineType());583 580 if (renderer.isInline() != renderer.parent()->childrenInline()) 584 581 childFlowStateChangesAndAffectsParentBlock(renderer);
Note:
See TracChangeset
for help on using the changeset viewer.