WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
148842
Update HTMLTableRowElement.rowIndex to behave according to the specification
https://bugs.webkit.org/show_bug.cgi?id=148842
Summary
Update HTMLTableRowElement.rowIndex to behave according to the specification
Ryosuke Niwa
Reported
2015-09-04 16:16:42 PDT
document.createElement("table").appendChild(document.createElement('tr')).rowIndex should be identically equal to 0. This bug was found by the newly added test: LayoutTests/http/tests/w3c/html/semantics/tabular-data/the-tr-element/rowIndex.html
Attachments
Patch
(6.27 KB, patch)
2015-09-21 16:38 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews102 for mac-mavericks
(887.89 KB, application/zip)
2015-09-21 17:10 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from ews104 for mac-mavericks-wk2
(924.55 KB, application/zip)
2015-09-21 17:22 PDT
,
Build Bot
no flags
Details
Patch
(12.34 KB, patch)
2015-09-21 18:50 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(13.68 KB, patch)
2015-09-21 19:11 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2015-09-04 16:17:01 PDT
<
rdar://problem/22586914
>
Chris Dumez
Comment 2
2015-09-21 16:38:06 PDT
Created
attachment 261702
[details]
Patch
Darin Adler
Comment 3
2015-09-21 16:42:16 PDT
Comment on
attachment 261702
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=261702&action=review
> Source/WebCore/ChangeLog:25 > + The code is refactored a bit to leverage HTMLTableElement.rows(), as > + per the specification: > + "return the index of the tr element in that table element's rows collection" > + > + Previously, we would duplicate the table traversal logic. This > + simplifies the code a bit.
Is the new implementation more or less efficient than the old one? I understand that it’s simpler.
> Source/WebCore/html/HTMLTableRowElement.cpp:59 > + auto* parent = parentNode();
Maybe consider using parentElement here instead of parentNode.
> Source/WebCore/html/HTMLTableRowElement.cpp:73 > + unsigned rowCount = rows->length();
I would have named this local variable "length".
Darin Adler
Comment 4
2015-09-21 16:42:55 PDT
Comment on
attachment 261702
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=261702&action=review
> Source/WebCore/ChangeLog:3 > + tr.rowIndex should return 0 when tr is the only direct child of a table element
I don’t see any tests that match this description of the bug. The one test changing its result is not about rowIndex returning 0.
Build Bot
Comment 5
2015-09-21 17:10:42 PDT
Comment on
attachment 261702
[details]
Patch
Attachment 261702
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.webkit.org/results/194779
New failing tests: fast/table/rowindex.html
Build Bot
Comment 6
2015-09-21 17:10:46 PDT
Created
attachment 261705
[details]
Archive of layout-test-results from ews102 for mac-mavericks The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-mavericks Platform: Mac OS X 10.9.5
Build Bot
Comment 7
2015-09-21 17:22:44 PDT
Comment on
attachment 261702
[details]
Patch
Attachment 261702
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.webkit.org/results/194809
New failing tests: fast/table/rowindex.html
Build Bot
Comment 8
2015-09-21 17:22:48 PDT
Created
attachment 261707
[details]
Archive of layout-test-results from ews104 for mac-mavericks-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-mavericks-wk2 Platform: Mac OS X 10.9.5
Chris Dumez
Comment 9
2015-09-21 18:50:50 PDT
Created
attachment 261713
[details]
Patch
Chris Dumez
Comment 10
2015-09-21 18:58:29 PDT
Comment on
attachment 261702
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=261702&action=review
>> Source/WebCore/ChangeLog:3 >> + tr.rowIndex should return 0 when tr is the only direct child of a table element > > I don’t see any tests that match this description of the bug. The one test changing its result is not about rowIndex returning 0.
It is though. We filed this bug specifically because of this test that was failing. The test looks like this: """ test(function() { var row = document.createElement("table") .appendChild(document.createElement("tr")); assert_equals(row.rowIndex, 0); }); """ It just doesn't show in the -expected.txt.
>> Source/WebCore/ChangeLog:25 >> + simplifies the code a bit. > > Is the new implementation more or less efficient than the old one? I understand that it’s simpler.
It should be equivalent in terms of performance. If performance is a problem, I am sure we can make HTMLTableRowsCollection a bit faster.
>> Source/WebCore/html/HTMLTableRowElement.cpp:59 >> + auto* parent = parentNode(); > > Maybe consider using parentElement here instead of parentNode.
Not the first time we discuss this but parentElement() will do an unnecessary isElementNode() check. Also, knowing the parent is an Element is not going to make the is<HTMLTableElement>() check any faster.
>> Source/WebCore/html/HTMLTableRowElement.cpp:73 >> + unsigned rowCount = rows->length(); > > I would have named this local variable "length".
Ok.
Chris Dumez
Comment 11
2015-09-21 19:11:27 PDT
Created
attachment 261714
[details]
Patch
WebKit Commit Bot
Comment 12
2015-09-21 19:58:03 PDT
Comment on
attachment 261714
[details]
Patch Clearing flags on attachment: 261714 Committed
r190099
: <
http://trac.webkit.org/changeset/190099
>
WebKit Commit Bot
Comment 13
2015-09-21 19:58:10 PDT
All reviewed patches have been landed. Closing bug.
Alexey Proskuryakov
Comment 14
2015-09-21 23:07:13 PDT
This made fast/table/rowindex.html fail on Windows. Chris, could you please take a look?
Darin Adler
Comment 15
2015-09-22 08:24:42 PDT
Comment on
attachment 261714
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=261714&action=review
> LayoutTests/ChangeLog:12 > + * platform/mac/fast/table/rowindex-expected.txt:
Looks like there are also many other rowindex-expected files: platform/efl/fast/table/rowindex-expected.png platform/efl/fast/table/rowindex-expected.txt platform/gtk/fast/table/rowindex-expected.png platform/gtk/fast/table/rowindex-expected.txt platform/ios-simulator/fast/table/rowindex-expected.txt platform/ios-simulator-wk2/fast/table/rowindex-expected.txt platform/mac/fast/table/rowindex-expected.png platform/win/fast/table/rowindex-expected.txt What should we do about all of those!?
Chris Dumez
Comment 16
2015-09-22 09:03:41 PDT
(In reply to
comment #15
)
> Comment on
attachment 261714
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=261714&action=review
> > > LayoutTests/ChangeLog:12 > > + * platform/mac/fast/table/rowindex-expected.txt: > > Looks like there are also many other rowindex-expected files: > > platform/efl/fast/table/rowindex-expected.png > platform/efl/fast/table/rowindex-expected.txt > platform/gtk/fast/table/rowindex-expected.png > platform/gtk/fast/table/rowindex-expected.txt > platform/ios-simulator/fast/table/rowindex-expected.txt > platform/ios-simulator-wk2/fast/table/rowindex-expected.txt > platform/mac/fast/table/rowindex-expected.png > platform/win/fast/table/rowindex-expected.txt > > What should we do about all of those!?
I will rebaseline them.
Chris Dumez
Comment 17
2015-09-22 09:11:47 PDT
(In reply to
comment #16
)
> (In reply to
comment #15
) > > Comment on
attachment 261714
[details]
> > Patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=261714&action=review
> > > > > LayoutTests/ChangeLog:12 > > > + * platform/mac/fast/table/rowindex-expected.txt: > > > > Looks like there are also many other rowindex-expected files: > > > > platform/efl/fast/table/rowindex-expected.png > > platform/efl/fast/table/rowindex-expected.txt > > platform/gtk/fast/table/rowindex-expected.png > > platform/gtk/fast/table/rowindex-expected.txt > > platform/ios-simulator/fast/table/rowindex-expected.txt > > platform/ios-simulator-wk2/fast/table/rowindex-expected.txt > > platform/mac/fast/table/rowindex-expected.png > > platform/win/fast/table/rowindex-expected.txt > > > > What should we do about all of those!? > > I will rebaseline them.
<
http://trac.webkit.org/changeset/190116
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug