REGRESSION(r127438): Google Docs to renders text too small.
authorkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Sep 2012 23:16:50 +0000 (23:16 +0000)
committerkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Sep 2012 23:16:50 +0000 (23:16 +0000)
commit5b670a7e3177190eb81a59358527b18b623933a5
tree595cac70672985428e2ba086fec56ad2405f1b49
parent2184136d9bfd8b1362ce8a9896559b90000aee25
REGRESSION(r127438): Google Docs to renders text too small.
<http://webkit.org/b/96554>

Reviewed by Antti Koivisto.

Source/WebCore:

Don't remove the inline StylePropertySet from ElementAttributeData in ~StyledElement.
This behavior broke sharing of ElementAttributeData between elements with inline style,
since destroying one element would effectively disable the inline style from all other
elements that shared the same attribute data.

What we actually want in ~StyledElement is to detach from any CSSOM wrapper that may
have been instantiated. Added ElementAttributeData::detachCSSOMWrapperIfNeeded for this
purpose and call that instead.

Test: fast/dom/shared-inline-style-after-node-removal.html

* dom/ElementAttributeData.cpp:
(WebCore::ElementAttributeData::detachCSSOMWrapperIfNeeded):
(WebCore::ElementAttributeData::destroyInlineStyle):
* dom/ElementAttributeData.h:
(ElementAttributeData):
* dom/StyledElement.cpp:
(WebCore::StyledElement::~StyledElement):
(WebCore::StyledElement::styleAttributeChanged):
* dom/StyledElement.h:
(StyledElement):

LayoutTests:

Add a test that an element that shared its inline style with another element works as expected
after the other element is destroyed.

* fast/dom/shared-inline-style-after-node-removal-expected.txt: Added.
* fast/dom/shared-inline-style-after-node-removal.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128697 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/shared-inline-style-after-node-removal-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/shared-inline-style-after-node-removal.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/ElementAttributeData.cpp
Source/WebCore/dom/ElementAttributeData.h
Source/WebCore/dom/StyledElement.cpp
Source/WebCore/dom/StyledElement.h