Title: [223499] releases/WebKitGTK/webkit-2.18
- Revision
- 223499
- Author
- [email protected]
- Date
- 2017-10-17 01:36:12 -0700 (Tue, 17 Oct 2017)
Log Message
Merge r222790 - [AX] Do not trigger redundant layout on tables.
https://bugs.webkit.org/show_bug.cgi?id=177781
<rdar://problem/34777030>
Reviewed by Antti Koivisto.
Source/WebCore:
RenderTable::forceSectionsRecalc() marks the RenderTable dirty and schedules a layout.
Every time AccessibilityTable asks for the table element (including during construction),
we end up triggering a layout. This call was added (r191357) to ensure RenderTable's m_firstBody is always
up-to-date (in case of anonymous wrapper table renderer). Instead of relying on the m_firstBody,
let's just use the first child to find the table element. The first child always points to a valid
renderer (or nullptr), while m_firstBody is the result of section computation.
Covered by existing tests.
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::tableElement const):
LayoutTests:
* TestExpectations: see webkit.org/b/177799
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.18/LayoutTests/ChangeLog (223498 => 223499)
--- releases/WebKitGTK/webkit-2.18/LayoutTests/ChangeLog 2017-10-17 08:35:04 UTC (rev 223498)
+++ releases/WebKitGTK/webkit-2.18/LayoutTests/ChangeLog 2017-10-17 08:36:12 UTC (rev 223499)
@@ -1,3 +1,13 @@
+2017-10-03 Zalan Bujtas <[email protected]>
+
+ [AX] Do not trigger redundant layout on tables.
+ https://bugs.webkit.org/show_bug.cgi?id=177781
+ <rdar://problem/34777030>
+
+ Reviewed by Antti Koivisto.
+
+ * TestExpectations: see webkit.org/b/177799
+
2017-10-03 Daniel Bates <[email protected]>
[CSP] Check policy before opening a new window to a _javascript_ URL
Modified: releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog (223498 => 223499)
--- releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog 2017-10-17 08:35:04 UTC (rev 223498)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog 2017-10-17 08:36:12 UTC (rev 223499)
@@ -1,3 +1,23 @@
+2017-10-03 Zalan Bujtas <[email protected]>
+
+ [AX] Do not trigger redundant layout on tables.
+ https://bugs.webkit.org/show_bug.cgi?id=177781
+ <rdar://problem/34777030>
+
+ Reviewed by Antti Koivisto.
+
+ RenderTable::forceSectionsRecalc() marks the RenderTable dirty and schedules a layout.
+ Every time AccessibilityTable asks for the table element (including during construction),
+ we end up triggering a layout. This call was added (r191357) to ensure RenderTable's m_firstBody is always
+ up-to-date (in case of anonymous wrapper table renderer). Instead of relying on the m_firstBody,
+ let's just use the first child to find the table element. The first child always points to a valid
+ renderer (or nullptr), while m_firstBody is the result of section computation.
+
+ Covered by existing tests.
+
+ * accessibility/AccessibilityTable.cpp:
+ (WebCore::AccessibilityTable::tableElement const):
+
2017-10-03 Daniel Bates <[email protected]>
[CSP] Check policy before opening a new window to a _javascript_ URL
Modified: releases/WebKitGTK/webkit-2.18/Source/WebCore/accessibility/AccessibilityTable.cpp (223498 => 223499)
--- releases/WebKitGTK/webkit-2.18/Source/WebCore/accessibility/AccessibilityTable.cpp 2017-10-17 08:35:04 UTC (rev 223498)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/accessibility/AccessibilityTable.cpp 2017-10-17 08:36:12 UTC (rev 223499)
@@ -100,16 +100,14 @@
RenderTable& table = downcast<RenderTable>(*m_renderer);
if (is<HTMLTableElement>(table.element()))
return downcast<HTMLTableElement>(table.element());
-
- table.forceSectionsRecalc();
-
- // If the table has a display:table-row-group, then the RenderTable does not have a pointer to it's HTMLTableElement.
- // We can instead find it by asking the firstSection for its parent.
- RenderTableSection* firstBody = table.firstBody();
- if (!firstBody || !firstBody->element())
+ // Try to find the table element, when the AccessibilityTable is mapped to an anonymous table renderer.
+ auto* firstChild = table.firstChild();
+ if (!firstChild || !firstChild->node())
return nullptr;
-
- return ancestorsOfType<HTMLTableElement>(*(firstBody->element())).first();
+ if (is<HTMLTableElement>(*firstChild->node()))
+ return downcast<HTMLTableElement>(firstChild->node());
+ // FIXME: This might find an unrelated parent table element.
+ return ancestorsOfType<HTMLTableElement>(*(firstChild->node())).first();
}
bool AccessibilityTable::isDataTable() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes