Changeset 276661 in webkit
- Timestamp:
- Apr 27, 2021, 2:07:04 PM (5 years ago)
- Location:
- branches/safari-611-branch
- Files:
-
- 2 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/animation/animation-display-style-adjustment-expected.html (added)
-
LayoutTests/fast/animation/animation-display-style-adjustment.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderTheme.cpp (modified) (1 diff)
-
Source/WebCore/rendering/style/RenderStyle.h (modified) (1 diff)
-
Source/WebCore/style/StyleAdjuster.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-611-branch/LayoutTests/ChangeLog
r276402 r276661 1 2021-04-27 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r274170. rdar://problem/77194450 4 5 REGRESSION (r273003): Animated style may lose original display property value 6 https://bugs.webkit.org/show_bug.cgi?id=222979 7 rdar://75056684 8 9 Reviewed by Zalan Bujtas. 10 11 Source/WebCore: 12 13 Test: fast/animation/animation-display-style-adjustment.html 14 15 The original (non-blockified) display property value is saved in the beginning of Style::Adjuster::adjust. 16 It is needed to implement absolute positioning correctly in some situations. However with animations 17 the style adjustment code may run twice on the same style and the second run will clobber the saved original value. 18 19 * rendering/RenderTheme.cpp: 20 (WebCore::RenderTheme::adjustStyle): 21 * rendering/style/RenderStyle.h: 22 (WebCore::RenderStyle::setDisplay): 23 24 Always save the original value when setting the property normally. 25 26 (WebCore::RenderStyle::setEffectiveDisplay): 27 (WebCore::RenderStyle::setOriginalDisplay): Deleted. 28 29 Add setEffectiveDisplay that doesn't affect the original value for adjuster use. 30 31 * style/StyleAdjuster.cpp: 32 (WebCore::Style::Adjuster::adjust const): 33 34 Remove the saving of the original value. 35 Use setEffectiveDisplay in all adjuster code, preserving the original value. 36 37 (WebCore::Style::Adjuster::adjustDisplayContentsStyle const): 38 (WebCore::Style::Adjuster::adjustSVGElementStyle): 39 (WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const): 40 41 LayoutTests: 42 43 * fast/animation/animation-display-style-adjustment-expected.html: Added. 44 * fast/animation/animation-display-style-adjustment.html: Added. 45 46 47 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274170 268f45cc-cd09-0410-ab3c-d52691b4dbfc 48 49 2021-03-09 Antti Koivisto <antti@apple.com> 50 51 REGRESSION (r273003): Animated style may lose original display property value 52 https://bugs.webkit.org/show_bug.cgi?id=222979 53 rdar://75056684 54 55 Reviewed by Zalan Bujtas. 56 57 * fast/animation/animation-display-style-adjustment-expected.html: Added. 58 * fast/animation/animation-display-style-adjustment.html: Added. 59 1 60 2021-04-21 Ruben Turcios <rubent_22@apple.com> 2 61 -
branches/safari-611-branch/Source/WebCore/ChangeLog
r276404 r276661 1 2021-04-27 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r274170. rdar://problem/77194450 4 5 REGRESSION (r273003): Animated style may lose original display property value 6 https://bugs.webkit.org/show_bug.cgi?id=222979 7 rdar://75056684 8 9 Reviewed by Zalan Bujtas. 10 11 Source/WebCore: 12 13 Test: fast/animation/animation-display-style-adjustment.html 14 15 The original (non-blockified) display property value is saved in the beginning of Style::Adjuster::adjust. 16 It is needed to implement absolute positioning correctly in some situations. However with animations 17 the style adjustment code may run twice on the same style and the second run will clobber the saved original value. 18 19 * rendering/RenderTheme.cpp: 20 (WebCore::RenderTheme::adjustStyle): 21 * rendering/style/RenderStyle.h: 22 (WebCore::RenderStyle::setDisplay): 23 24 Always save the original value when setting the property normally. 25 26 (WebCore::RenderStyle::setEffectiveDisplay): 27 (WebCore::RenderStyle::setOriginalDisplay): Deleted. 28 29 Add setEffectiveDisplay that doesn't affect the original value for adjuster use. 30 31 * style/StyleAdjuster.cpp: 32 (WebCore::Style::Adjuster::adjust const): 33 34 Remove the saving of the original value. 35 Use setEffectiveDisplay in all adjuster code, preserving the original value. 36 37 (WebCore::Style::Adjuster::adjustDisplayContentsStyle const): 38 (WebCore::Style::Adjuster::adjustSVGElementStyle): 39 (WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const): 40 41 LayoutTests: 42 43 * fast/animation/animation-display-style-adjustment-expected.html: Added. 44 * fast/animation/animation-display-style-adjustment.html: Added. 45 46 47 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274170 268f45cc-cd09-0410-ab3c-d52691b4dbfc 48 49 2021-03-09 Antti Koivisto <antti@apple.com> 50 51 REGRESSION (r273003): Animated style may lose original display property value 52 https://bugs.webkit.org/show_bug.cgi?id=222979 53 rdar://75056684 54 55 Reviewed by Zalan Bujtas. 56 57 Test: fast/animation/animation-display-style-adjustment.html 58 59 The original (non-blockified) display property value is saved in the beginning of Style::Adjuster::adjust. 60 It is needed to implement absolute positioning correctly in some situations. However with animations 61 the style adjustment code may run twice on the same style and the second run will clobber the saved original value. 62 63 * rendering/RenderTheme.cpp: 64 (WebCore::RenderTheme::adjustStyle): 65 * rendering/style/RenderStyle.h: 66 (WebCore::RenderStyle::setDisplay): 67 68 Always save the original value when setting the property normally. 69 70 (WebCore::RenderStyle::setEffectiveDisplay): 71 (WebCore::RenderStyle::setOriginalDisplay): Deleted. 72 73 Add setEffectiveDisplay that doesn't affect the original value for adjuster use. 74 75 * style/StyleAdjuster.cpp: 76 (WebCore::Style::Adjuster::adjust const): 77 78 Remove the saving of the original value. 79 Use setEffectiveDisplay in all adjuster code, preserving the original value. 80 81 (WebCore::Style::Adjuster::adjustDisplayContentsStyle const): 82 (WebCore::Style::Adjuster::adjustSVGElementStyle): 83 (WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const): 84 1 85 2021-04-21 Ruben Turcios <rubent_22@apple.com> 2 86 -
branches/safari-611-branch/Source/WebCore/rendering/RenderTheme.cpp
r271021 r276661 84 84 || style.display() == DisplayType::TableRow || style.display() == DisplayType::TableColumnGroup || style.display() == DisplayType::TableColumn 85 85 || style.display() == DisplayType::TableCell || style.display() == DisplayType::TableCaption) 86 style.set Display(DisplayType::InlineBlock);86 style.setEffectiveDisplay(DisplayType::InlineBlock); 87 87 else if (style.display() == DisplayType::ListItem || style.display() == DisplayType::Table) 88 style.set Display(DisplayType::Block);88 style.setEffectiveDisplay(DisplayType::Block); 89 89 90 90 if (userAgentAppearanceStyle && isControlStyled(style, *userAgentAppearanceStyle)) { -
branches/safari-611-branch/Source/WebCore/rendering/style/RenderStyle.h
r271200 r276661 836 836 // attribute setter methods 837 837 838 void setDisplay(DisplayType v) { m_nonInheritedFlags.effectiveDisplay = static_cast<unsigned>(v); } 839 void setOriginalDisplay(DisplayType v) { m_nonInheritedFlags.originalDisplay = static_cast<unsigned>(v); } 838 void setDisplay(DisplayType value) 839 { 840 m_nonInheritedFlags.originalDisplay = static_cast<unsigned>(value); 841 m_nonInheritedFlags.effectiveDisplay = m_nonInheritedFlags.originalDisplay; 842 } 843 void setEffectiveDisplay(DisplayType v) { m_nonInheritedFlags.effectiveDisplay = static_cast<unsigned>(v); } 840 844 void setPosition(PositionType v) { m_nonInheritedFlags.position = static_cast<unsigned>(v); } 841 845 void setFloating(Float v) { m_nonInheritedFlags.floating = static_cast<unsigned>(v); } -
branches/safari-611-branch/Source/WebCore/style/StyleAdjuster.cpp
r273458 r276661 244 244 void Adjuster::adjust(RenderStyle& style, const RenderStyle* userAgentAppearanceStyle) const 245 245 { 246 // Cache our original display.247 style.setOriginalDisplay(style.display());248 249 246 if (style.display() == DisplayType::Contents) 250 247 adjustDisplayContentsStyle(style); … … 258 255 if (m_document.inQuirksMode()) { 259 256 if (m_element->hasTagName(tdTag)) { 260 style.set Display(DisplayType::TableCell);257 style.setEffectiveDisplay(DisplayType::TableCell); 261 258 style.setFloating(Float::No); 262 259 } else if (is<HTMLTableElement>(*m_element)) 263 style.set Display(style.isDisplayInlineType() ? DisplayType::InlineTable : DisplayType::Table);260 style.setEffectiveDisplay(style.isDisplayInlineType() ? DisplayType::InlineTable : DisplayType::Table); 264 261 } 265 262 … … 284 281 if (m_element->hasTagName(frameTag) || m_element->hasTagName(framesetTag)) { 285 282 style.setPosition(PositionType::Static); 286 style.set Display(DisplayType::Block);283 style.setEffectiveDisplay(DisplayType::Block); 287 284 } 288 285 … … 301 298 302 299 if (m_element->hasTagName(legendTag)) 303 style.set Display(DisplayType::Block);300 style.setEffectiveDisplay(DisplayType::Block); 304 301 } 305 302 306 303 // Absolute/fixed positioned elements, floating elements and the document element need block-like outside display. 307 304 if (style.hasOutOfFlowPosition() || style.isFloating() || (m_element && m_document.documentElement() == m_element)) 308 style.set Display(equivalentBlockDisplay(style, m_document));305 style.setEffectiveDisplay(equivalentBlockDisplay(style, m_document)); 309 306 310 307 // FIXME: Don't support this mutation for pseudo styles like first-letter or first-line, since it's not completely 311 308 // clear how that should work. 312 309 if (style.display() == DisplayType::Inline && style.styleType() == PseudoId::None && style.writingMode() != m_parentStyle.writingMode()) 313 style.set Display(DisplayType::InlineBlock);310 style.setEffectiveDisplay(DisplayType::InlineBlock); 314 311 315 312 // After performing the display mutation, check table rows. We do not honor position:relative or position:sticky on … … 338 335 if (m_parentBoxStyle.isDisplayFlexibleOrGridBox()) { 339 336 style.setFloating(Float::No); 340 style.set Display(equivalentBlockDisplay(style, m_document));337 style.setEffectiveDisplay(equivalentBlockDisplay(style, m_document)); 341 338 } 342 339 } … … 545 542 if (!m_element) { 546 543 if (style.styleType() != PseudoId::Before && style.styleType() != PseudoId::After) 547 style.set Display(DisplayType::None);544 style.setEffectiveDisplay(DisplayType::None); 548 545 return; 549 546 } 550 547 551 548 if (m_document.documentElement() == m_element) { 552 style.set Display(DisplayType::Block);549 style.setEffectiveDisplay(DisplayType::Block); 553 550 return; 554 551 } 555 552 556 553 if (hasEffectiveDisplayNoneForDisplayContents(*m_element)) 557 style.set Display(DisplayType::None);554 style.setEffectiveDisplay(DisplayType::None); 558 555 } 559 556 … … 572 569 // SVG text layout code expects us to be a block-level style element. 573 570 if ((svgElement.hasTagName(SVGNames::foreignObjectTag) || svgElement.hasTagName(SVGNames::textTag)) && style.isDisplayInlineType()) 574 style.set Display(DisplayType::Block);571 style.setEffectiveDisplay(DisplayType::Block); 575 572 } 576 573 … … 631 628 auto* video = div.treeScope().getElementById(videoElementID); 632 629 if (is<HTMLVideoElement>(video) && downcast<HTMLVideoElement>(*video).isFullscreen()) 633 style.set Display(DisplayType::Block);630 style.setEffectiveDisplay(DisplayType::Block); 634 631 } 635 632 }
Note:
See TracChangeset
for help on using the changeset viewer.