Bug 207438

Summary: Optimize Style::determineChange()
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: CSSAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, ews-watchlist, glenn, koivisto, kondapallykalyan, pdr, sabouhallawa, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
koivisto: review+
Patch none

Simon Fraser (smfr)
Reported 2020-02-08 21:15:54 PST
Optimize Style::determineChange()
Attachments
Patch (4.13 KB, patch)
2020-02-08 21:19 PST, Simon Fraser (smfr)
koivisto: review+
Patch (4.01 KB, patch)
2020-02-09 08:19 PST, Simon Fraser (smfr)
no flags
Simon Fraser (smfr)
Comment 1 2020-02-08 21:19:52 PST
Antti Koivisto
Comment 2 2020-02-09 05:50:31 PST
Comment on attachment 390194 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=390194&action=review > Source/WebCore/rendering/style/RenderStyle.cpp:451 > +bool RenderStyle::alignItemsEqual(const RenderStyle& other) const > +{ > + return m_rareNonInheritedData.ptr() == other.m_rareNonInheritedData.ptr() > + || m_rareNonInheritedData->alignItems == other.m_rareNonInheritedData->alignItems; > +} > + > +bool RenderStyle::justifyItemsEqual(const RenderStyle& other) const > +{ > + return m_rareNonInheritedData.ptr() == other.m_rareNonInheritedData.ptr() > + || m_rareNonInheritedData->justifyItems == other.m_rareNonInheritedData->justifyItems; > +} Combining these ("alignAndJustifyItemsEqual") would eliminate one m_rareNonInheritedData comparison.
Simon Fraser (smfr)
Comment 3 2020-02-09 07:51:52 PST
(In reply to Antti Koivisto from comment #2) > Comment on attachment 390194 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=390194&action=review > > > Source/WebCore/rendering/style/RenderStyle.cpp:451 > > +bool RenderStyle::alignItemsEqual(const RenderStyle& other) const > > +{ > > + return m_rareNonInheritedData.ptr() == other.m_rareNonInheritedData.ptr() > > + || m_rareNonInheritedData->alignItems == other.m_rareNonInheritedData->alignItems; > > +} > > + > > +bool RenderStyle::justifyItemsEqual(const RenderStyle& other) const > > +{ > > + return m_rareNonInheritedData.ptr() == other.m_rareNonInheritedData.ptr() > > + || m_rareNonInheritedData->justifyItems == other.m_rareNonInheritedData->justifyItems; > > +} > > Combining these ("alignAndJustifyItemsEqual") would eliminate one > m_rareNonInheritedData comparison. I thought about that. Wasn't sure what to name the function.
Simon Fraser (smfr)
Comment 4 2020-02-09 08:19:29 PST
Antti Koivisto
Comment 5 2020-02-09 09:24:23 PST
Comment on attachment 390204 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=390204&action=review > Source/WebCore/style/StyleChange.cpp:56 > + if (!s1.childAffectingFlexPropertiesEqual(s2)) > + return Inherit; Seems like this also affects grid. Could also be something more generic like descendantStyleAffectingNonInheritedPropertiesEqual
Simon Fraser (smfr)
Comment 6 2020-02-09 20:11:10 PST
Radar WebKit Bug Importer
Comment 7 2020-02-09 20:12:13 PST
Note You need to log in before you can comment on or make changes to this bug.