Changeset 110029 in webkit
- Timestamp:
- Mar 7, 2012 12:09:15 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r110024 r110029 1 2012-03-07 Yoshifumi Inoue <yosin@chromium.org> 2 3 [Forms] The "legend" element should not be a form-associated element. 4 https://bugs.webkit.org/show_bug.cgi?id=80239 5 6 Reviewed by Kent Tamura. 7 8 This patch changes base class of HTMLLegendElement to HTMLElement from 9 HTMLFormControlElement for saving memory space and iteration time of 10 extra "legend" 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 are required. No behavior changes. 18 19 * editing/TextIterator.cpp: 20 (WebCore::TextIterator::advance): Check HTMLLegendElement in addition to isFormControlElement. This change is for text dump in LayoutTests implemented by document.innerText attribute. 21 * html/HTMLLegendElement.cpp: 22 (WebCore::HTMLLegendElement::HTMLLegendElement): Remove form parameter. 23 (WebCore::HTMLLegendElement::create): Remove form parameter. 24 (WebCore::HTMLLegendElement::associatedControl): Stop checking legend element, because HTMLLegendElement is no longer HTMLFormControlElement. 25 (WebCore::HTMLLegendElement::supportFocus): Removed. It called HTMLElement::supportFocus. 26 (WebCore::HTMLLegendElement::formControlType): Remove implementation of virtual method declared in HTMLFormControlElement. 27 * html/HTMLLegendElement.h: 28 (HTMLLegendElement): Change base class to HTMLElement. 29 * html/HTMLTagNames.in: Remove "constructorNeedsFormElement" for not passing "form" parameter in HTMLElementFactory. 30 1 31 2012-03-06 Raphael Kubo da Costa <kubo@profusion.mobi> 2 32 -
trunk/Source/WebCore/editing/TextIterator.cpp
r108417 r110029 395 395 else if (renderer && (renderer->isImage() || renderer->isWidget() || 396 396 (renderer->node() && renderer->node()->isElementNode() && 397 static_cast<Element*>(renderer->node())->isFormControlElement()))) 397 (static_cast<Element*>(renderer->node())->isFormControlElement() 398 || static_cast<Element*>(renderer->node())->hasTagName(legendTag))))) 398 399 m_handledNode = handleReplacedElement(); 399 400 else -
trunk/Source/WebCore/html/HTMLLegendElement.cpp
r100805 r110029 26 26 #include "HTMLLegendElement.h" 27 27 28 #include "HTMLFormControlElement.h" 28 29 #include "HTMLNames.h" 29 30 #include <wtf/StdLibExtras.h> … … 33 34 using namespace HTMLNames; 34 35 35 inline HTMLLegendElement::HTMLLegendElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 36 : HTMLFormControlElement(tagName, document, form) 36 37 inline HTMLLegendElement::HTMLLegendElement(const QualifiedName& tagName, Document* document) 38 : HTMLElement(tagName, document) 37 39 { 38 40 ASSERT(hasTagName(legendTag)); 39 41 } 40 42 41 PassRefPtr<HTMLLegendElement> HTMLLegendElement::create(const QualifiedName& tagName, Document* document , HTMLFormElement* form)43 PassRefPtr<HTMLLegendElement> HTMLLegendElement::create(const QualifiedName& tagName, Document* document) 42 44 { 43 return adoptRef(new HTMLLegendElement(tagName, document, form)); 44 } 45 46 bool HTMLLegendElement::supportsFocus() const 47 { 48 return HTMLElement::supportsFocus(); 49 } 50 51 const AtomicString& HTMLLegendElement::formControlType() const 52 { 53 DEFINE_STATIC_LOCAL(const AtomicString, legend, ("legend")); 54 return legend; 45 return adoptRef(new HTMLLegendElement(tagName, document)); 55 46 } 56 47 … … 70 61 if (node->isElementNode()) { 71 62 Element* element = static_cast<Element*>(node); 72 if ( !element->hasLocalName(legendTag) &&element->isFormControlElement())63 if (element->isFormControlElement()) 73 64 return static_cast<HTMLFormControlElement*>(element); 74 65 } -
trunk/Source/WebCore/html/HTMLLegendElement.h
r100805 r110029 25 25 #define HTMLLegendElement_h 26 26 27 #include "HTML FormControlElement.h"27 #include "HTMLElement.h" 28 28 29 29 namespace WebCore { 30 30 31 class HTMLLegendElement : public HTMLFormControlElement { 31 class HTMLFormControlElement; 32 33 class HTMLLegendElement : public HTMLElement { 32 34 public: 33 static PassRefPtr<HTMLLegendElement> create(const QualifiedName&, Document* , HTMLFormElement*);35 static PassRefPtr<HTMLLegendElement> create(const QualifiedName&, Document*); 34 36 35 37 private: 36 HTMLLegendElement(const QualifiedName&, Document* , HTMLFormElement*);38 HTMLLegendElement(const QualifiedName&, Document*); 37 39 38 40 // Control in the legend's fieldset that gets focus and access key. 39 41 HTMLFormControlElement* associatedControl(); 40 42 41 virtual bool supportsFocus() const;42 virtual const AtomicString& formControlType() const;43 43 virtual void accessKeyAction(bool sendMouseEvents); 44 44 virtual void focus(bool restorePreviousSelection = true); -
trunk/Source/WebCore/html/HTMLTagNames.in
r110014 r110029 75 75 label 76 76 layer interfaceName=HTMLElement 77 legend constructorNeedsFormElement77 legend 78 78 li interfaceName=HTMLLIElement 79 79 link constructorNeedsCreatedByParser
Note: See TracChangeset
for help on using the changeset viewer.