WebCore: Custom properties on DOM objects are lost after GC (as demonstrated by the...
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Aug 2009 23:40:28 +0000 (23:40 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Aug 2009 23:40:28 +0000 (23:40 +0000)
commitc8599b3858e988a6eb6793e186012d78d9c0ed8f
treead51d8ef1e1d467844b4c4613c6406c87b0df00c
parent2a8fdf2813c51deac4127d91fb4ba8789c4261aa
WebCore: Custom properties on DOM objects are lost after GC (as demonstrated by the gc-9.html test)
https://bugs.webkit.org/show_bug.cgi?id=28194

Patch by Darin Adler <darin@apple.com> on 2009-08-12
Reviewed by Geoff Garen.

* GNUmakefile.am: Added the two new source files.
* WebCore.gypi: Ditto.
* WebCore.pro: Ditto.
* WebCore.vcproj/WebCore.vcproj: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* WebCoreSources.bkl: Ditto.

* bindings/js/JSCSSRuleListCustom.cpp: Added.
(WebCore::JSCSSRuleList::markChildren): Call markDOMObjectWrapper
on rules in the list.

* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::markChildren): Added. Call
markDOMObjectWrapper on the CSSValue objects that are owned by the
declaration as values of the properties.

* bindings/js/JSDOMBinding.cpp:
(WebCore::isObservableThroughDOM): Added code to handle some
cases where nodes are observable because they own objects that
in turn have custom properties.

* bindings/js/JSDOMBinding.h: Fix a typo in the header.

* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::markChildren): Added call to markDOMObjectWrapper
for implementation and styleSheets.

* bindings/js/JSElementCustom.cpp:
(WebCore::JSElement::markChildren): Added. Calls markDOMObjectWrapper
for attributes and style.

* bindings/js/JSHTMLCanvasElementCustom.cpp: Added.
(WebCore::JSHTMLCanvasElement::markChildren): Call markDOMObjectWrapper
on the rendering context.

* bindings/js/JSStyleSheetCustom.cpp:
(WebCore::JSStyleSheet::markChildren): Call markDOMObjectWrapper on
items in the stylesheet.

* bindings/js/JSStyleSheetListCustom.cpp:
(WebCore::JSStyleSheetList::markChildren): Added. Calls
markDOMObjectWrapper on stylesheets in the list.

* css/CSSRuleList.idl: Added CustomMarkFunction.
* css/CSSStyleDeclaration.idl: Ditto.
* css/StyleSheetList.idl: Ditto.
* dom/Element.idl: Ditto.
* html/HTMLCanvasElement.idl: Ditto.

* dom/Element.h: Made everything private that could be.
Added access to the attributeMap that does returns
the existing map without doing any of the lazy-updating work. This
is needed to get at the existing attributes during garbage collection
without having side effects.

* html/HTMLCanvasElement.h: Cleaned up the header a bit, making
members private. Added renderingContext2D function for use in
JSHTMLCanvasElement::markChildren.

LayoutTests: Custom properties on DOM objects are lost after GC (as demonstrated by the gc-9.html test)
https://bugs.webkit.org/show_bug.cgi?id=28194

Patch by Darin Adler <darin@apple.com> on 2009-08-12
Reviewed by Geoff Garen.

* fast/dom/gc-9-expected.txt: Regenerated.
* fast/dom/gc-9.html: Updated to expect correct behavior instead of failures.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@47165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/gc-9-expected.txt
LayoutTests/fast/dom/gc-9.html
WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/WebCore.gypi
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/WebCoreSources.bkl
WebCore/bindings/js/JSCSSRuleListCustom.cpp [new file with mode: 0644]
WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
WebCore/bindings/js/JSDOMBinding.cpp
WebCore/bindings/js/JSDOMBinding.h
WebCore/bindings/js/JSDocumentCustom.cpp
WebCore/bindings/js/JSElementCustom.cpp
WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp [new file with mode: 0644]
WebCore/bindings/js/JSStyleSheetCustom.cpp
WebCore/bindings/js/JSStyleSheetListCustom.cpp
WebCore/css/CSSRuleList.idl
WebCore/css/CSSStyleDeclaration.idl
WebCore/css/StyleSheetList.idl
WebCore/dom/Element.h
WebCore/dom/Element.idl
WebCore/html/HTMLCanvasElement.h
WebCore/html/HTMLCanvasElement.idl