[WebIDL] Remove the need for the side map of DeprecatedCSSOMValue roots
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Jul 2017 21:20:25 +0000 (21:20 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Jul 2017 21:20:25 +0000 (21:20 +0000)
commit81ba247e6c1665ee182c364810c10be8e357dd5f
treea799141dcfb0c690fe052308d6ddf130657c9f59
parent9cf419a5567db08b1ba54a9d0af38e9f0b086626
[WebIDL] Remove the need for the side map of DeprecatedCSSOMValue roots
https://bugs.webkit.org/show_bug.cgi?id=174713

Patch by Sam Weinig <sam@webkit.org> on 2017-07-21
Reviewed by Andreas Kling.

We used to not want to bloat the size of CSSValues with a pointer to the
owner CSSStyleDeclaration, so, for GC purposes we need kept a mapping of
them on DOMWrapperWorld that only got set if a wrapper was made. Now that
we have DeprecatedCSSOMValue, a wrapper for CSSValue that only gets created
for the bindings, we no longer need the side table, and simply have the
DeprecatedCSSOMValue maintain a reference to the CSSStyleDeclaration.

* bindings/js/DOMWrapperWorld.h:
(WebCore::DOMWrapperWorld::wrappers):
Remove m_deprecatedCSSOMValueRoots and make m_wrappers private with a getter.

* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Deleted.
Remove custom implementation of getPropertyCSSValue, now that it no longer
needs to update m_deprecatedCSSOMValueRoots.

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
* bindings/js/JSDOMWrapperCache.h:
(WebCore::getCachedWrapper):
(WebCore::cacheWrapper):
(WebCore::uncacheWrapper):
* bindings/js/JSNodeCustom.cpp:
(WebCore::getOutOfLineCachedWrapper):
Use wrappers getter rather than direct member variable.

* bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
(WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
Rather than checking the side table for roots, now get the root
via the reference CSSStyleDeclaration.

(WebCore::JSDeprecatedCSSOMValueOwner::finalize): Deleted.
Remove custom finalize now that we don't have to remove ourself
from m_deprecatedCSSOMValueRoots.

* css/CSSStyleDeclaration.idl:
Remove [Custom] from getPropertyCSSValue.

* css/DeprecatedCSSOMValue.idl:
Remove [JSCustomFinalize].

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::createDeprecatedCSSOMWrapper):
* css/CSSImageValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper):
* css/CSSPrimitiveValue.h:
* css/CSSStyleDeclaration.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::createDeprecatedCSSOMWrapper):
* css/CSSValue.h:
* css/DeprecatedCSSOMCounter.h:
* css/DeprecatedCSSOMPrimitiveValue.cpp:
(WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue):
* css/DeprecatedCSSOMPrimitiveValue.h:
(WebCore::DeprecatedCSSOMPrimitiveValue::create):
(WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue):
* css/DeprecatedCSSOMRGBColor.h:
* css/DeprecatedCSSOMRect.h:
* css/DeprecatedCSSOMValue.h:
(WebCore::DeprecatedCSSOMValue::owner):
(WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue):
(WebCore::DeprecatedCSSOMComplexValue::create):
(WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue):
* css/DeprecatedCSSOMValueList.h:
(WebCore::DeprecatedCSSOMValueList::create):
(WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):
* css/PropertySetCSSStyleDeclaration.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::getPresentationAttribute):
Pass owning CSSStyleDeclaration to DeprecatedCSSOMValue and derived classes.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219744 268f45cc-cd09-0410-ab3c-d52691b4dbfc
27 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/DOMWrapperWorld.h
Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSDOMWrapperCache.h
Source/WebCore/bindings/js/JSDeprecatedCSSOMValueCustom.cpp
Source/WebCore/bindings/js/JSNodeCustom.cpp
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSImageValue.cpp
Source/WebCore/css/CSSImageValue.h
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/CSSPrimitiveValue.h
Source/WebCore/css/CSSStyleDeclaration.h
Source/WebCore/css/CSSStyleDeclaration.idl
Source/WebCore/css/CSSValue.cpp
Source/WebCore/css/CSSValue.h
Source/WebCore/css/DeprecatedCSSOMCounter.h
Source/WebCore/css/DeprecatedCSSOMPrimitiveValue.cpp
Source/WebCore/css/DeprecatedCSSOMPrimitiveValue.h
Source/WebCore/css/DeprecatedCSSOMRGBColor.h
Source/WebCore/css/DeprecatedCSSOMRect.h
Source/WebCore/css/DeprecatedCSSOMValue.h
Source/WebCore/css/DeprecatedCSSOMValue.idl
Source/WebCore/css/DeprecatedCSSOMValueList.h
Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
Source/WebCore/css/PropertySetCSSStyleDeclaration.h
Source/WebCore/svg/SVGElement.cpp