[Forms] The "progress" element should not be a form-associated element.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 15:01:16 +0000 (15:01 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Mar 2012 15:01:16 +0000 (15:01 +0000)
commit17bda038ffb8faa5baa36f0d7cf33b03001cbcd0
tree8b0a5000e8d6de368b43ca931a1b45a3e334ae1d
parentfcf3e1babca2798f815e276bb663e1249c94d952
[Forms] The "progress" element should not be a form-associated element.
https://bugs.webkit.org/show_bug.cgi?id=80240

Patch by Yoshifumi Inoue <yosin@chromium.org> on 2012-03-16
Reviewed by Kent Tamura.

Source/WebCore:

This patch changes base class of HTMLProgressElement to LabelableElement from
HTMLFormControlElement for saving memory space and iteration time of
extra "progress" elements in HTMLFormElement::m_formAssociatedElements
and matching the HTML5 specification for ease of maintenance.

Changes of TextIterator is lead by usage of isFormControlElement. This
changes will be replaced with more meaningful predicate as part of
https://bugs.webkit.org/show_bug.cgi?id=80381

No new tests. Update existing tests to cover this change.

* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::canShareStyleWithElement): Moved the "progress" element support code from canShareStyleWithControl.
(WebCore::CSSStyleSelector::canShareStyleWithControl):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOneSelector): Remove isFormControlElement check for PseudoIndeterminate.
* editing/TextIterator.cpp:
(WebCore::TextIterator::advance): Check HTMLProgressElement in addition to isFormControlElement. This change is for text dump in LayoutTests implemented by document.innerText attribute.
* html/HTMLProgressElement.cpp: Remove unused include file.
(WebCore::HTMLProgressElement::HTMLProgressElement): Changed base class to LabelableElement.
(WebCore::HTMLProgressElement::create): Remove form paraprogress.
(WebCore::HTMLProgressElement::parseAttribute): Replace HTMLFormControlElement to LabelableElement.
(WebCore::HTMLProgressElement::attach): Replace HTMLFormControlElement to LabelableElement.
* html/HTMLProgressElement.h:
(HTMLProgressElement):
* html/HTMLProgressElement.idl: Remove the "form" attribute which isn't listed in the HTML5 specification.
* html/HTMLTagNames.in: Remove "constructorNeedsFormElement" for not passing "form" parameter in HTMLElementFactory.

LayoutTests:

This patch changes tests for non-existent "form" attribute of the
"progress" element. The "form" attribute is available only for
form-associate elements. However, the "progress" element isn't.

* fast/dom/HTMLProgressElement/progress-element-form-expected.txt: Update expectation for test output changes.
* fast/dom/HTMLProgressElement/progress-element-form.html: Changed for the "progress" element doesn't have IDL attribute "form".
* fast/forms/form-attribute-expected.txt: Update expectation for test output changes.
* fast/forms/form-attribute.html: Removed lines for the "progress" element.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111009 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLProgressElement/progress-element-form-expected.txt
LayoutTests/fast/dom/HTMLProgressElement/progress-element-form.html
LayoutTests/fast/forms/form-attribute-expected.txt
LayoutTests/fast/forms/form-attribute.html
Source/WebCore/ChangeLog
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/css/SelectorChecker.cpp
Source/WebCore/editing/TextIterator.cpp
Source/WebCore/html/HTMLProgressElement.cpp
Source/WebCore/html/HTMLProgressElement.h
Source/WebCore/html/HTMLProgressElement.idl
Source/WebCore/html/HTMLTagNames.in