Bug 92977 - Check if the last table element's parent node is an element when determining the foster parent element.
Summary: Check if the last table element's parent node is an element when determining ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kwang Yul Seo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-02 05:02 PDT by Kwang Yul Seo
Modified: 2012-08-02 09:12 PDT (History)
4 users (show)

See Also:


Attachments
Patch (4.84 KB, patch)
2012-08-02 05:09 PDT, Kwang Yul Seo
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from gce-cr-linux-07 (326.17 KB, application/zip)
2012-08-02 05:45 PDT, WebKit Review Bot
no flags Details
Patch (5.17 KB, patch)
2012-08-02 06:25 PDT, Kwang Yul Seo
no flags Details | Formatted Diff | Diff
Patch (5.18 KB, patch)
2012-08-02 06:28 PDT, Kwang Yul Seo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kwang Yul Seo 2012-08-02 05:02:14 PDT
According to the HTML5 spec, if the last table element in the stack of open elements has no parent, or ITS PARENT NODE IS NOT AN ELEMENT, then the foster parent element is the element before the last table element in the stack of open elements.

http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#foster-parenting

Changed to check if the table element's parent node is an element.
Comment 1 Kwang Yul Seo 2012-08-02 05:09:42 PDT
Created attachment 156043 [details]
Patch
Comment 2 WebKit Review Bot 2012-08-02 05:45:13 PDT
Comment on attachment 156043 [details]
Patch

Attachment 156043 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13426160

New failing tests:
fast/table/incomplete-table-in-fragment-hang.html
Comment 3 WebKit Review Bot 2012-08-02 05:45:16 PDT
Created attachment 156052 [details]
Archive of layout-test-results from gce-cr-linux-07

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: gce-cr-linux-07  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Comment 4 Kwang Yul Seo 2012-08-02 06:25:00 PDT
Created attachment 156064 [details]
Patch
Comment 5 Kwang Yul Seo 2012-08-02 06:26:38 PDT
Comment on attachment 156064 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=156064&action=review

> Source/WebCore/html/parser/HTMLConstructionSite.cpp:482
> +        // When parsing HTML fragments, we skip step 4.2 ("Let root be a new html element with no attributes") for efficiency,
> +        // and instead use the DocumentFragment as a root node. So if we must treat the root node (DocumentFragment) as a html element here.
> +        if (parent && (parent->isElementNode() || (m_isParsingFragment && parent == m_openElements.rootNode()))) {

To pass fast/table/incomplete-table-in-fragment-hang.html, a special condition check was added for the fragment parsing case.
Comment 6 Kwang Yul Seo 2012-08-02 06:28:17 PDT
Created attachment 156065 [details]
Patch
Comment 7 Kwang Yul Seo 2012-08-02 06:28:43 PDT
(In reply to comment #6)
> Created an attachment (id=156065) [details]
> Patch

Fixed typos in the comment.
Comment 8 Adam Barth 2012-08-02 08:20:47 PDT
Comment on attachment 156065 [details]
Patch

ok
Comment 9 WebKit Review Bot 2012-08-02 09:12:07 PDT
Comment on attachment 156065 [details]
Patch

Clearing flags on attachment: 156065

Committed r124465: <http://trac.webkit.org/changeset/124465>
Comment 10 WebKit Review Bot 2012-08-02 09:12:11 PDT
All reviewed patches have been landed.  Closing bug.