Bug 148841 - sectionRowIndex must return -1 when its parent is not a table, tbody, thead, or tfoot
Summary: sectionRowIndex must return -1 when its parent is not a table, tbody, thead, ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://html.spec.whatwg.org/multipag...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-09-04 16:13 PDT by Ryosuke Niwa
Modified: 2015-09-29 21:31 PDT (History)
5 users (show)

See Also:


Attachments
Patch (4.51 KB, patch)
2015-09-29 20:18 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2015-09-04 16:13:48 PDT
See https://html.spec.whatwg.org/multipage/tables.html#dom-tr-sectionrowindex

When tr element's parent is not one of table, tbody, thead, or tfoot,
sectionRowIndex must return -1.

This bug was found by the newly imported test:
LayoutTests/http/tests/w3c/html/semantics/tabular-data/the-tr-element/sectionRowIndex.html
Comment 1 Radar WebKit Bug Importer 2015-09-04 16:14:32 PDT
<rdar://problem/22586870>
Comment 2 Chris Dumez 2015-09-29 20:18:31 PDT
Created attachment 262135 [details]
Patch
Comment 3 Ryosuke Niwa 2015-09-29 20:22:01 PDT
Comment on attachment 262135 [details]
Patch

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

> Source/WebCore/html/HTMLTableRowElement.cpp:88
> +    RefPtr<HTMLCollection> rows;

It's horrible that we have to create a HTML collection here :(
Comment 4 Chris Dumez 2015-09-29 20:24:14 PDT
Comment on attachment 262135 [details]
Patch

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

>> Source/WebCore/html/HTMLTableRowElement.cpp:88
>> +    RefPtr<HTMLCollection> rows;
> 
> It's horrible that we have to create a HTML collection here :(

If we see this being hot then we can optimize. But the new implementation is at least correct.
Comment 5 WebKit Commit Bot 2015-09-29 21:31:43 PDT
Comment on attachment 262135 [details]
Patch

Clearing flags on attachment: 262135

Committed r190337: <http://trac.webkit.org/changeset/190337>
Comment 6 WebKit Commit Bot 2015-09-29 21:31:48 PDT
All reviewed patches have been landed.  Closing bug.