Changeset 202881 in webkit


Ignore:
Timestamp:
Jul 6, 2016 3:13:18 PM (8 years ago)
Author:
Chris Dumez
Message:

Document.body should return the first child of the html element that is either a body / frameset element
https://bugs.webkit.org/show_bug.cgi?id=159488

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Import corresponding W3C test.

  • web-platform-tests/html/dom/documents/dom-tree-accessors/Document.body-expected.txt: Added.
  • web-platform-tests/html/dom/documents/dom-tree-accessors/Document.body.html: Added.

Source/WebCore:

Document.body should return the first child of the html element that is
either a body / frameset element:

We used the first child of the *document* element that is either a
body / frameset element, even if the document element is not an html
element.

Firefox and Chrome match the specification.

Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/Document.body.html

  • dom/Document.cpp:

(WebCore::Document::bodyOrFrameset):

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r202873 r202881  
     12016-07-06  Chris Dumez  <cdumez@apple.com>
     2
     3        Document.body should return the first child of the html element that is either a body / frameset element
     4        https://bugs.webkit.org/show_bug.cgi?id=159488
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Import corresponding W3C test.
     9
     10        * web-platform-tests/html/dom/documents/dom-tree-accessors/Document.body-expected.txt: Added.
     11        * web-platform-tests/html/dom/documents/dom-tree-accessors/Document.body.html: Added.
     12
    1132016-07-06  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r202880 r202881  
     12016-07-06  Chris Dumez  <cdumez@apple.com>
     2
     3        Document.body should return the first child of the html element that is either a body / frameset element
     4        https://bugs.webkit.org/show_bug.cgi?id=159488
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Document.body should return the first child of the html element that is
     9        either a body / frameset element:
     10        - https://html.spec.whatwg.org/multipage/dom.html#dom-document-body
     11        - https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2
     12
     13        We used the first child of the *document* element that is either a
     14        body / frameset element, even if the document element is not an html
     15        element.
     16
     17        Firefox and Chrome match the specification.
     18
     19        Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/Document.body.html
     20
     21        * dom/Document.cpp:
     22        (WebCore::Document::bodyOrFrameset):
     23
    1242016-07-06  Dean Jackson  <dino@apple.com>
    225
  • trunk/Source/WebCore/dom/Document.cpp

    r202769 r202881  
    26142614    // Return the first body or frameset child of the html element.
    26152615    auto* element = documentElement();
    2616     if (!element)
     2616    if (!is<HTMLHtmlElement>(element))
    26172617        return nullptr;
    26182618    for (auto& child : childrenOfType<HTMLElement>(*element)) {
Note: See TracChangeset for help on using the changeset viewer.