Summary: | Optimize Style::determineChange() | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> | ||||||
Component: | CSS | Assignee: | 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
Simon Fraser (smfr)
2020-02-08 21:15:54 PST
Created attachment 390194 [details]
Patch
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. (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. Created attachment 390204 [details]
Patch
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 |