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
8 files changed