Changeset 111009 in webkit
- Timestamp:
- Mar 16, 2012 8:01:16 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r110996 r111009 1 2012-03-16 Yoshifumi Inoue <yosin@chromium.org> 2 3 [Forms] The "progress" element should not be a form-associated element. 4 https://bugs.webkit.org/show_bug.cgi?id=80240 5 6 Reviewed by Kent Tamura. 7 8 This patch changes tests for non-existent "form" attribute of the 9 "progress" element. The "form" attribute is available only for 10 form-associate elements. However, the "progress" element isn't. 11 12 * fast/dom/HTMLProgressElement/progress-element-form-expected.txt: Update expectation for test output changes. 13 * fast/dom/HTMLProgressElement/progress-element-form.html: Changed for the "progress" element doesn't have IDL attribute "form". 14 * fast/forms/form-attribute-expected.txt: Update expectation for test output changes. 15 * fast/forms/form-attribute.html: Removed lines for the "progress" element. 16 1 17 2012-03-16 Yoshifumi Inoue <yosin@chromium.org> 2 18 -
trunk/LayoutTests/fast/dom/HTMLProgressElement/progress-element-form-expected.txt
r72976 r111009 1 1 2 This test passes if the progress element can find its form.2 This test passes if the progress element doesn't have form attribute. 3 3 PASS -
trunk/LayoutTests/fast/dom/HTMLProgressElement/progress-element-form.html
r72976 r111009 10 10 <progress id=progress1></progress> 11 11 </form></table> 12 <div>This test passes if the progress element can find its form.</div>12 <div>This test passes if the progress element doesn't have form attribute.</div> 13 13 <div id=console>FAIL</div> 14 14 15 15 <script> 16 if (document.getElementById('progress1').form .id == "form1")16 if (document.getElementById('progress1').form === undefined) 17 17 document.getElementById('console').innerHTML = "PASS"; 18 18 </script> -
trunk/LayoutTests/fast/forms/form-attribute-expected.txt
r110996 r111009 12 12 PASS document.getElementsByTagName("object")[0].form is owner 13 13 PASS document.getElementsByTagName("output")[0].form is owner 14 PASS document.getElementsByTagName("progress")[0].form is owner15 14 PASS document.getElementsByTagName("select")[0].form is owner 16 15 PASS document.getElementsByTagName("textarea")[0].form is owner -
trunk/LayoutTests/fast/forms/form-attribute.html
r110996 r111009 22 22 '<object name=victim form=owner></object>' + 23 23 '<output name=victim form=owner />' + 24 '<progress name=victim form=owner />' +25 24 '<select name=victim form=owner />' + 26 25 '<textarea name=victim form=owner />'; … … 34 33 shouldBe('document.getElementsByTagName("object")[0].form', 'owner'); 35 34 shouldBe('document.getElementsByTagName("output")[0].form', 'owner'); 36 shouldBe('document.getElementsByTagName("progress")[0].form', 'owner');37 35 shouldBe('document.getElementsByTagName("select")[0].form', 'owner'); 38 36 shouldBe('document.getElementsByTagName("textarea")[0].form', 'owner'); -
trunk/Source/WebCore/ChangeLog
r111008 r111009 1 2012-03-16 Yoshifumi Inoue <yosin@chromium.org> 2 3 [Forms] The "progress" element should not be a form-associated element. 4 https://bugs.webkit.org/show_bug.cgi?id=80240 5 6 Reviewed by Kent Tamura. 7 8 This patch changes base class of HTMLProgressElement to LabelableElement from 9 HTMLFormControlElement for saving memory space and iteration time of 10 extra "progress" elements in HTMLFormElement::m_formAssociatedElements 11 and matching the HTML5 specification for ease of maintenance. 12 13 Changes of TextIterator is lead by usage of isFormControlElement. This 14 changes will be replaced with more meaningful predicate as part of 15 https://bugs.webkit.org/show_bug.cgi?id=80381 16 17 No new tests. Update existing tests to cover this change. 18 19 * css/CSSStyleSelector.cpp: 20 (WebCore::CSSStyleSelector::canShareStyleWithElement): Moved the "progress" element support code from canShareStyleWithControl. 21 (WebCore::CSSStyleSelector::canShareStyleWithControl): 22 * css/SelectorChecker.cpp: 23 (WebCore::SelectorChecker::checkOneSelector): Remove isFormControlElement check for PseudoIndeterminate. 24 * editing/TextIterator.cpp: 25 (WebCore::TextIterator::advance): Check HTMLProgressElement in addition to isFormControlElement. This change is for text dump in LayoutTests implemented by document.innerText attribute. 26 * html/HTMLProgressElement.cpp: Remove unused include file. 27 (WebCore::HTMLProgressElement::HTMLProgressElement): Changed base class to LabelableElement. 28 (WebCore::HTMLProgressElement::create): Remove form paraprogress. 29 (WebCore::HTMLProgressElement::parseAttribute): Replace HTMLFormControlElement to LabelableElement. 30 (WebCore::HTMLProgressElement::attach): Replace HTMLFormControlElement to LabelableElement. 31 * html/HTMLProgressElement.h: 32 (HTMLProgressElement): 33 * html/HTMLProgressElement.idl: Remove the "form" attribute which isn't listed in the HTML5 specification. 34 * html/HTMLTagNames.in: Remove "constructorNeedsFormElement" for not passing "form" parameter in HTMLElementFactory. 35 1 36 2012-03-16 Ilya Tikhonovsky <loislo@chromium.org> 2 37 -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r110985 r111009 1208 1208 bool CSSStyleSelector::canShareStyleWithControl(StyledElement* element) const 1209 1209 { 1210 #if ENABLE(PROGRESS_TAG)1211 if (element->hasTagName(progressTag)) {1212 if (!m_element->hasTagName(progressTag))1213 return false;1214 1215 HTMLProgressElement* thisProgressElement = static_cast<HTMLProgressElement*>(element);1216 HTMLProgressElement* otherProgressElement = static_cast<HTMLProgressElement*>(m_element);1217 if (thisProgressElement->isDeterminate() != otherProgressElement->isDeterminate())1218 return false;1219 1220 return true;1221 }1222 #endif1223 1224 1210 HTMLInputElement* thisInputElement = element->toInputElement(); 1225 1211 HTMLInputElement* otherInputElement = m_element->toInputElement(); … … 1345 1331 if (element->hasScopedHTMLStyleChild()) 1346 1332 return false; 1333 #endif 1334 1335 #if ENABLE(PROGRESS_TAG) 1336 if (element->hasTagName(progressTag)) { 1337 if (!m_element->hasTagName(progressTag)) 1338 return false; 1339 1340 HTMLProgressElement* thisProgressElement = static_cast<HTMLProgressElement*>(element); 1341 HTMLProgressElement* otherProgressElement = static_cast<HTMLProgressElement*>(m_element); 1342 if (thisProgressElement->isDeterminate() != otherProgressElement->isDeterminate()) 1343 return false; 1344 } 1347 1345 #endif 1348 1346 -
trunk/Source/WebCore/css/SelectorChecker.cpp
r109884 r111009 1094 1094 case CSSSelector::PseudoIndeterminate: 1095 1095 { 1096 if (!element || !element->isFormControlElement())1096 if (!element) 1097 1097 break; 1098 1098 #if ENABLE(PROGRESS_TAG) -
trunk/Source/WebCore/editing/TextIterator.cpp
r110927 r111009 397 397 (static_cast<Element*>(renderer->node())->isFormControlElement() 398 398 || static_cast<Element*>(renderer->node())->hasTagName(legendTag) 399 || static_cast<Element*>(renderer->node())->hasTagName(meterTag))))) 399 || static_cast<Element*>(renderer->node())->hasTagName(meterTag) 400 || static_cast<Element*>(renderer->node())->hasTagName(progressTag))))) 400 401 m_handledNode = handleReplacedElement(); 401 402 else -
trunk/Source/WebCore/html/HTMLProgressElement.cpp
r108758 r111009 26 26 #include "EventNames.h" 27 27 #include "ExceptionCode.h" 28 #include "FormDataList.h"29 28 #include "NodeRenderingContext.h" 30 29 #include "HTMLDivElement.h" 31 #include "HTMLFormElement.h"32 30 #include "HTMLNames.h" 33 31 #include "HTMLParserIdioms.h" … … 44 42 const double HTMLProgressElement::InvalidPosition = -2; 45 43 46 HTMLProgressElement::HTMLProgressElement(const QualifiedName& tagName, Document* document , HTMLFormElement* form)47 : HTMLFormControlElement(tagName, document, form)44 HTMLProgressElement::HTMLProgressElement(const QualifiedName& tagName, Document* document) 45 : LabelableElement(tagName, document) 48 46 { 49 47 ASSERT(hasTagName(progressTag)); … … 54 52 } 55 53 56 PassRefPtr<HTMLProgressElement> HTMLProgressElement::create(const QualifiedName& tagName, Document* document , HTMLFormElement* form)54 PassRefPtr<HTMLProgressElement> HTMLProgressElement::create(const QualifiedName& tagName, Document* document) 57 55 { 58 RefPtr<HTMLProgressElement> progress = adoptRef(new HTMLProgressElement(tagName, document , form));56 RefPtr<HTMLProgressElement> progress = adoptRef(new HTMLProgressElement(tagName, document)); 59 57 progress->createShadowSubtree(); 60 58 return progress; … … 76 74 } 77 75 78 const AtomicString& HTMLProgressElement::formControlType() const79 {80 DEFINE_STATIC_LOCAL(const AtomicString, progress, ("progress"));81 return progress;82 }83 84 76 void HTMLProgressElement::parseAttribute(Attribute* attribute) 85 77 { … … 89 81 didElementStateChange(); 90 82 else 91 HTMLFormControlElement::parseAttribute(attribute);83 LabelableElement::parseAttribute(attribute); 92 84 } 93 85 94 86 void HTMLProgressElement::attach() 95 87 { 96 HTMLFormControlElement::attach();88 LabelableElement::attach(); 97 89 didElementStateChange(); 98 90 } -
trunk/Source/WebCore/html/HTMLProgressElement.h
r110927 r111009 23 23 24 24 #if ENABLE(PROGRESS_TAG) 25 #include " HTMLFormControlElement.h"25 #include "LabelableElement.h" 26 26 27 27 namespace WebCore { … … 29 29 class ProgressValueElement; 30 30 31 class HTMLProgressElement : public HTMLFormControlElement {31 class HTMLProgressElement : public LabelableElement { 32 32 public: 33 33 static const double IndeterminatePosition; 34 34 static const double InvalidPosition; 35 35 36 static PassRefPtr<HTMLProgressElement> create(const QualifiedName&, Document* , HTMLFormElement*);36 static PassRefPtr<HTMLProgressElement> create(const QualifiedName&, Document*); 37 37 38 38 double value() const; … … 49 49 50 50 private: 51 HTMLProgressElement(const QualifiedName&, Document* , HTMLFormElement*);51 HTMLProgressElement(const QualifiedName&, Document*); 52 52 virtual ~HTMLProgressElement(); 53 53 … … 55 55 56 56 virtual bool supportsFocus() const; 57 58 virtual bool recalcWillValidate() const { return false; }59 60 virtual const AtomicString& formControlType() const;61 57 62 58 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); -
trunk/Source/WebCore/html/HTMLProgressElement.idl
r89269 r111009 27 27 setter raises(DOMException); 28 28 readonly attribute double position; 29 readonly attribute HTMLFormElement form;30 29 readonly attribute NodeList labels; 31 30 }; -
trunk/Source/WebCore/html/HTMLTagNames.in
r110927 r111009 100 100 plaintext interfaceName=HTMLElement 101 101 pre 102 progress interfaceName=HTMLProgressElement, con structorNeedsFormElement, conditional=PROGRESS_TAG102 progress interfaceName=HTMLProgressElement, conditional=PROGRESS_TAG 103 103 q interfaceName=HTMLQuoteElement 104 104 rp interfaceName=HTMLElement
Note: See TracChangeset
for help on using the changeset viewer.