Move attribute style invalidation to attributeChanged().
authorkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Feb 2012 10:36:55 +0000 (10:36 +0000)
committerkling@webkit.org <kling@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Feb 2012 10:36:55 +0000 (10:36 +0000)
commit11f2556ef24e6c0a0ed716ed50701197b8405e48
treec05239fa955bc2e61191b796aec0fbd97256fefb
parent5173abe7cbd538e5270dc3e45aa0cd81d9e7fa7a
Move attribute style invalidation to attributeChanged().
<http://webkit.org/b/78461>

Reviewed by Antti Koivisto.

Moved attribute style invalidation out of the parseAttribute() overloads
and added an "isPresentationAttribute(Attribute*) virtual to StyledElement.
Returning true for a given Attribute will cause attribute style invalidation
when that attribute passes through attributeChanged().

Removed a couple of parseAttribute() overloads whose only remaining purpose
was invalidating attribute style.

For form elements that deliberately don't map the "align" attribute, added
short-circuits in isPresentationAttribute instead of falling back to the
respective base class (which may othweise then map "align")

* dom/StyledElement.cpp:
(WebCore::StyledElement::attributeChanged):
* dom/StyledElement.h:
(WebCore::StyledElement::isPresentationAttribute):
* html/HTMLBRElement.cpp:
(WebCore::HTMLBRElement::isPresentationAttribute):
* html/HTMLBRElement.h:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::isPresentationAttribute):
(WebCore::HTMLBodyElement::collectStyleForAttribute):
(WebCore::HTMLBodyElement::parseAttribute):
* html/HTMLBodyElement.h:
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::isPresentationAttribute):
(WebCore::HTMLButtonElement::parseAttribute):
* html/HTMLButtonElement.h:
* html/HTMLDivElement.cpp:
(WebCore::HTMLDivElement::isPresentationAttribute):
* html/HTMLDivElement.h:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::isPresentationAttribute):
(WebCore::HTMLElement::parseAttribute):
* html/HTMLElement.h:
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::isPresentationAttribute):
(WebCore::HTMLEmbedElement::parseAttribute):
* html/HTMLEmbedElement.h:
* html/HTMLFontElement.cpp:
(WebCore::HTMLFontElement::isPresentationAttribute):
* html/HTMLFontElement.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::isPresentationAttribute):
(WebCore::HTMLFrameSetElement::parseAttribute):
* html/HTMLFrameSetElement.h:
* html/HTMLHRElement.cpp:
(WebCore::HTMLHRElement::isPresentationAttribute):
(WebCore::HTMLHRElement::collectStyleForAttribute):
* html/HTMLHRElement.h:
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::isPresentationAttribute):
(WebCore::HTMLIFrameElement::collectStyleForAttribute):
(WebCore::HTMLIFrameElement::parseAttribute):
* html/HTMLIFrameElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::isPresentationAttribute):
(WebCore::HTMLImageElement::collectStyleForAttribute):
(WebCore::HTMLImageElement::parseAttribute):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isPresentationAttribute):
(WebCore::HTMLInputElement::collectStyleForAttribute):
(WebCore::HTMLInputElement::parseAttribute):
* html/HTMLInputElement.h:
* html/HTMLLIElement.cpp:
(WebCore::HTMLLIElement::isPresentationAttribute):
(WebCore::HTMLLIElement::parseAttribute):
* html/HTMLLIElement.h:
* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::isPresentationAttribute):
(WebCore::HTMLMarqueeElement::collectStyleForAttribute):
(WebCore::HTMLMarqueeElement::parseAttribute):
* html/HTMLMarqueeElement.h:
* html/HTMLOListElement.cpp:
(WebCore::HTMLOListElement::isPresentationAttribute):
(WebCore::HTMLOListElement::parseAttribute):
* html/HTMLOListElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::isPresentationAttribute):
(WebCore::HTMLObjectElement::parseAttribute):
* html/HTMLObjectElement.h:
* html/HTMLParagraphElement.cpp:
(WebCore::HTMLParagraphElement::isPresentationAttribute):
* html/HTMLParagraphElement.h:
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::isPresentationAttribute):
(WebCore::HTMLPlugInElement::collectStyleForAttribute):
* html/HTMLPlugInElement.h:
* html/HTMLPreElement.cpp:
(WebCore::HTMLPreElement::isPresentationAttribute):
(WebCore::HTMLPreElement::collectStyleForAttribute):
* html/HTMLPreElement.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::isPresentationAttribute):
(WebCore::HTMLSelectElement::parseAttribute):
* html/HTMLSelectElement.h:
* html/HTMLTableCaptionElement.cpp:
(WebCore::HTMLTableCaptionElement::isPresentationAttribute):
(WebCore::HTMLTableCaptionElement::parseAttribute):
* html/HTMLTableCaptionElement.h:
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::isPresentationAttribute):
(WebCore::HTMLTableCellElement::collectStyleForAttribute):
(WebCore::HTMLTableCellElement::parseAttribute):
* html/HTMLTableCellElement.h:
* html/HTMLTableColElement.cpp:
(WebCore::HTMLTableColElement::isPresentationAttribute):
(WebCore::HTMLTableColElement::parseAttribute):
* html/HTMLTableColElement.h:
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::isPresentationAttribute):
(WebCore::HTMLTableElement::parseAttribute):
* html/HTMLTableElement.h:
* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::isPresentationAttribute):
(WebCore::HTMLTablePartElement::collectStyleForAttribute):
* html/HTMLTablePartElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::isPresentationAttribute):
(WebCore::HTMLTextAreaElement::parseAttribute):
* html/HTMLTextAreaElement.h:
* html/HTMLUListElement.cpp:
(WebCore::HTMLUListElement::isPresentationAttribute):
(WebCore::HTMLUListElement::collectStyleForAttribute):
* html/HTMLUListElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::isPresentationAttribute):
(WebCore::HTMLVideoElement::parseAttribute):
* html/HTMLVideoElement.h:
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::isPresentationAttribute):
(WebCore::MathMLElement::collectStyleForAttribute):
* mathml/MathMLElement.h:
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::isPresentationAttribute):
(WebCore::SVGImageElement::parseAttribute):
* svg/SVGImageElement.h:
* svg/SVGStyledElement.cpp:
(WebCore::SVGStyledElement::isPresentationAttribute):
(WebCore::SVGStyledElement::parseAttribute):
* svg/SVGStyledElement.h:
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::isPresentationAttribute):
(WebCore::SVGTextContentElement::parseAttribute):
* svg/SVGTextContentElement.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
67 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/StyledElement.cpp
Source/WebCore/dom/StyledElement.h
Source/WebCore/html/HTMLBRElement.cpp
Source/WebCore/html/HTMLBRElement.h
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/html/HTMLBodyElement.h
Source/WebCore/html/HTMLButtonElement.cpp
Source/WebCore/html/HTMLButtonElement.h
Source/WebCore/html/HTMLDivElement.cpp
Source/WebCore/html/HTMLDivElement.h
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLElement.h
Source/WebCore/html/HTMLEmbedElement.cpp
Source/WebCore/html/HTMLEmbedElement.h
Source/WebCore/html/HTMLFontElement.cpp
Source/WebCore/html/HTMLFontElement.h
Source/WebCore/html/HTMLFrameSetElement.cpp
Source/WebCore/html/HTMLFrameSetElement.h
Source/WebCore/html/HTMLHRElement.cpp
Source/WebCore/html/HTMLHRElement.h
Source/WebCore/html/HTMLIFrameElement.cpp
Source/WebCore/html/HTMLIFrameElement.h
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLImageElement.h
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/HTMLLIElement.cpp
Source/WebCore/html/HTMLLIElement.h
Source/WebCore/html/HTMLMarqueeElement.cpp
Source/WebCore/html/HTMLMarqueeElement.h
Source/WebCore/html/HTMLOListElement.cpp
Source/WebCore/html/HTMLOListElement.h
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/html/HTMLObjectElement.h
Source/WebCore/html/HTMLParagraphElement.cpp
Source/WebCore/html/HTMLParagraphElement.h
Source/WebCore/html/HTMLPlugInElement.cpp
Source/WebCore/html/HTMLPlugInElement.h
Source/WebCore/html/HTMLPreElement.cpp
Source/WebCore/html/HTMLPreElement.h
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLSelectElement.h
Source/WebCore/html/HTMLTableCaptionElement.cpp
Source/WebCore/html/HTMLTableCaptionElement.h
Source/WebCore/html/HTMLTableCellElement.cpp
Source/WebCore/html/HTMLTableCellElement.h
Source/WebCore/html/HTMLTableColElement.cpp
Source/WebCore/html/HTMLTableColElement.h
Source/WebCore/html/HTMLTableElement.cpp
Source/WebCore/html/HTMLTableElement.h
Source/WebCore/html/HTMLTablePartElement.cpp
Source/WebCore/html/HTMLTablePartElement.h
Source/WebCore/html/HTMLTextAreaElement.cpp
Source/WebCore/html/HTMLTextAreaElement.h
Source/WebCore/html/HTMLUListElement.cpp
Source/WebCore/html/HTMLUListElement.h
Source/WebCore/html/HTMLVideoElement.cpp
Source/WebCore/html/HTMLVideoElement.h
Source/WebCore/mathml/MathMLElement.cpp
Source/WebCore/mathml/MathMLElement.h
Source/WebCore/svg/SVGImageElement.cpp
Source/WebCore/svg/SVGImageElement.h
Source/WebCore/svg/SVGStyledElement.cpp
Source/WebCore/svg/SVGStyledElement.h
Source/WebCore/svg/SVGTextContentElement.cpp
Source/WebCore/svg/SVGTextContentElement.h