2009-12-18 Shu Chang <Chang.Shu@nokia.com>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Dec 2009 16:40:57 +0000 (16:40 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Dec 2009 16:40:57 +0000 (16:40 +0000)
commit86a37d5fa43411456cd16107b2865f456b01c9b8
treee069c6b72754da613cbc14705373a5a305a129e7
parent2783e6c275116fbc2c1b0b903f9c9f67825db183
2009-12-18  Shu Chang  <Chang.Shu@nokia.com>

        Reviewed by Darin Adler.

        New test cases for isId support.
        https://bugs.webkit.org/show_bug.cgi?id=5578

        * dom/xhtml/level3/core/attrisid04-expected.txt:
        * dom/xhtml/level3/core/attrisid04.js:
        (setUpPage):
        * dom/xhtml/level3/core/attrisid05-expected.txt:
        * dom/xhtml/level3/core/attrisid05.js:
        (setUpPage):
        * fast/dom/Element/attrisid-extra01-expected.txt: Added.
        * fast/dom/Element/attrisid-extra01.html: Added.
        * fast/dom/Element/id-in-applet-expected.txt: Added.
        * fast/dom/Element/id-in-applet.html: Added.
        * fast/dom/Element/id-in-deletebutton-expected.txt: Added.
        * fast/dom/Element/id-in-deletebutton.html: Added.
        * fast/dom/Element/id-in-formcollection-expected.txt: Added.
        * fast/dom/Element/id-in-formcollection.html: Added.
        * fast/dom/Element/id-in-frame-expected.txt: Added.
        * fast/dom/Element/id-in-frame.html: Added.
        * fast/dom/Element/id-in-frameset-expected.txt: Added.
        * fast/dom/Element/id-in-frameset.html: Added.
        * fast/dom/Element/id-in-getelement01-expected.txt: Added.
        * fast/dom/Element/id-in-getelement01.html: Added.
        * fast/dom/Element/id-in-insert-hr-expected.txt: Added.
        * fast/dom/Element/id-in-insert-hr.html: Added.
        * fast/dom/Element/id-in-map-expected.txt: Added.
        * fast/dom/Element/id-in-map.html: Added.
        * fast/dom/Element/id-in-param-expected.txt: Added.
        * fast/dom/Element/id-in-param.html: Added.
2009-12-18  Shu Chang  <Chang.Shu@nokia.com>

        Reviewed by Darin Adler.

        Implemented isId as specified by DOM Level 3. See detailed description below.
        https://bugs.webkit.org/show_bug.cgi?id=5578

        Added isId property and implementation:
        Tests: dom/xhtml/level3/core/attrisid01-07.xhtml
               fast/dom/Element/attrisid-extra01.html
        * dom/Attr.cpp:
        (WebCore::Attr::isId):
        * dom/Attr.h:
        * dom/Attr.idl:

        Replaced instances of HTMLNames::idAttr with Element::idAttributeName()
        for the reason that id attribute name could be customized to a different
        string other than "id". A test case is associated to each code change.
        * dom/Document.cpp:
        (WebCore::Document::getElementById): Test: fast/dom/Element/id-in-getelement01.html
        * dom/Element.cpp: Tests: dom/xhtml/level3/core/attrisid01-07.xhtml
        (WebCore::Element::setAttribute):
        (WebCore::Element::setAttributeMap):
        (WebCore::Element::insertedIntoDocument):
        (WebCore::Element::removedFromDocument):
        (WebCore::Element::formatForDebugger):
        (WebCore::Element::rareIDAttributeName):
        * dom/Element.h: Added function idAttributeName().
        (WebCore::Element::idAttributeName):
        * dom/ElementRareData.h: Added member variable to store customized id name in ElementRareData.
        (WebCore::ElementRareData::ElementRareData):
        * dom/NamedAttrMap.cpp: Tests: dom/xhtml/level3/core/attrisid01-07.xhtml
        (WebCore::NamedNodeMap::setNamedItem):
        (WebCore::NamedNodeMap::removeNamedItem):
        (WebCore::NamedNodeMap::setAttributes):
        * dom/Node.cpp: Removed ASSERT as it may not hold any more.
        (WebCore::Node::querySelector):
        * dom/SelectorNodeList.cpp: Removed ASSERT as it may not hold any more.
        (WebCore::createSelectorNodeList):
        * dom/StyledElement.cpp: Tests: dom/xhtml/level3/core/attrisid01-07.xhtml
        (WebCore::StyledElement::parseMappedAttribute):
        * editing/DeleteButtonController.cpp: Test: fast/dom/Element/id-in-deletebutton.html
        (WebCore::DeleteButtonController::createDeletionUI):
        * editing/EditorCommand.cpp: Test: fast/dom/Element/id-in-insert-hr.html
        (WebCore::executeInsertHorizontalRule):
        * html/HTMLAppletElement.cpp: Test: fast/dom/Element/id-in-applet.html
        (WebCore::HTMLAppletElement::parseMappedAttribute):
        (WebCore::HTMLAppletElement::createRenderer):
        * html/HTMLCollection.cpp:
        (WebCore::HTMLCollection::checkForNameMatch): Test: fast/forms/select-namedItem.html
        (WebCore::HTMLCollection::updateNameCache): Test: fast/dom/collection-namedItem-via-item.html
        * html/HTMLDataGridColElement.cpp:
        (WebCore::HTMLDataGridColElement::ensureColumn): Test: fast/dom/HTMLDataGridElement/DataGridColumns-dom.html
        (WebCore::HTMLDataGridColElement::parseMappedAttribute): Test: fast/dom/HTMLDataGridElement/DataGridColumns-dom-attributes.html
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::parseMappedAttribute):
        * html/HTMLFormCollection.cpp: Test: fast/dom/Element/id-in-formcollection.html
        (WebCore::HTMLFormCollection::getNamedFormItem):
        (WebCore::HTMLFormCollection::nextNamedItem):
        (WebCore::HTMLFormCollection::updateNameCache):
        * html/HTMLFrameElementBase.cpp: Test: fast/dom/Element/id-in-frame.html
        (WebCore::HTMLFrameElementBase::parseMappedAttribute):
        (WebCore::HTMLFrameElementBase::setNameAndOpenURL):
        * html/HTMLImageElement.cpp: Test: fast/dom/Element/id-in-deletebutton.html
        (WebCore::HTMLImageElement::parseMappedAttribute):
        * html/HTMLMapElement.cpp: Test: fast/dom/Element/id-in-map.html
        (WebCore::HTMLMapElement::parseMappedAttribute):
        * html/HTMLNameCollection.cpp: Test: fast/dom/Element/id-in-frameset.html
        (WebCore::HTMLNameCollection::itemAfter):
        * html/HTMLObjectElement.cpp: Test: fast/dom/HTMLDocument/object-by-name-or-id.html
        (WebCore::HTMLObjectElement::parseMappedAttribute):
        * html/HTMLParamElement.cpp: Test: fast/dom/Element/id-in-param.html
        (WebCore::HTMLParamElement::parseMappedAttribute):
        * loader/CachedFont.cpp: Test: svg/custom/acid3-test-77.html
        (WebCore::CachedFont::getSVGFontById):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::createGraphicsLayer): Debug-only code
        * rendering/SVGRenderTreeAsText.cpp: Test: svg/text/text-gradient-positioning.svg
        (WebCore::writeRenderResources):
        * svg/SVGElement.cpp: Test: svg/custom/acid3-test-77.html
        (WebCore::SVGElement::insertedIntoDocument):
        * svg/SVGStyledElement.cpp: Test: svg/custom/js-update-image-and-display.svg
        (WebCore::SVGStyledElement::isKnownAttribute):
        * wml/WMLElement.cpp:
        (WebCore::WMLElement::parseMappedAttribute):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@52312 268f45cc-cd09-0410-ab3c-d52691b4dbfc
56 files changed:
LayoutTests/ChangeLog
LayoutTests/dom/xhtml/level3/core/attrisid04-expected.txt
LayoutTests/dom/xhtml/level3/core/attrisid04.js
LayoutTests/dom/xhtml/level3/core/attrisid05-expected.txt
LayoutTests/dom/xhtml/level3/core/attrisid05.js
LayoutTests/fast/dom/Element/attrisid-extra01-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Element/attrisid-extra01.html [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-applet-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-applet.html [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-deletebutton-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-deletebutton.html [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-formcollection-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-formcollection.html [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-frame-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-frame.html [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-frameset-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-frameset.html [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-getelement01-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-getelement01.html [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-insert-hr-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-insert-hr.html [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-map-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-map.html [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-param-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Element/id-in-param.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/dom/Attr.cpp
WebCore/dom/Attr.h
WebCore/dom/Attr.idl
WebCore/dom/Document.cpp
WebCore/dom/Element.cpp
WebCore/dom/Element.h
WebCore/dom/ElementRareData.h
WebCore/dom/NamedAttrMap.cpp
WebCore/dom/Node.cpp
WebCore/dom/SelectorNodeList.cpp
WebCore/dom/StyledElement.cpp
WebCore/editing/DeleteButtonController.cpp
WebCore/editing/EditorCommand.cpp
WebCore/html/HTMLAppletElement.cpp
WebCore/html/HTMLCollection.cpp
WebCore/html/HTMLDataGridColElement.cpp
WebCore/html/HTMLElement.cpp
WebCore/html/HTMLFormCollection.cpp
WebCore/html/HTMLFrameElementBase.cpp
WebCore/html/HTMLImageElement.cpp
WebCore/html/HTMLMapElement.cpp
WebCore/html/HTMLNameCollection.cpp
WebCore/html/HTMLObjectElement.cpp
WebCore/html/HTMLParamElement.cpp
WebCore/loader/CachedFont.cpp
WebCore/rendering/RenderLayerBacking.cpp
WebCore/rendering/SVGRenderTreeAsText.cpp
WebCore/svg/SVGElement.cpp
WebCore/svg/SVGStyledElement.cpp
WebCore/wml/WMLElement.cpp