RenderStyle:diff() was inadvertently doing deep compares of StyleRareNonInheritedData etc
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2017 02:52:10 +0000 (02:52 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2017 02:52:10 +0000 (02:52 +0000)
commit35bf9f9d05bd11368e813f0c636967c87aacb71e
tree8f4928b04a632e5eaef37c2b4e77c9f6a5a621da
parent8e46694ae19c7d6773ba07c6d172092e22a934dd
RenderStyle:diff() was inadvertently doing deep compares of StyleRareNonInheritedData etc
https://bugs.webkit.org/show_bug.cgi?id=175304

Reviewed by Tim Horton.

r210758 changed DataRef::get() from returning a pointer to a reference. This caused all the places
in RenderStyle::diff() and related functions, where we intended to do a quick pointer comparison,
to doing deep compares via operator!=. This made the code slightly slower.

Fix by exposing ptr() on DataRef and using it wherever we wish to do pointer comparison.

* rendering/style/DataRef.h:
(WebCore::DataRef::ptr const):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::inheritedDataShared const):
(WebCore::RenderStyle::changeAffectsVisualOverflow const):
(WebCore::RenderStyle::changeRequiresLayout const):
(WebCore::RenderStyle::changeRequiresRecompositeLayer const):
(WebCore::RenderStyle::listStyleImage const): Expand the function onto multiple lines.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/style/DataRef.h
Source/WebCore/rendering/style/RenderStyle.cpp