Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(959)

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp

Issue 2524313002: Fix AXLayoutObject not to add duplicated children for CSS first-letter (Closed)
Patch Set: Rebaseline first-letter-text-transform-causes-crash-expected.txt Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/accessibility/first-letter-text-transform-causes-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
index ce8c01c0b09f55b241e3c7c67d3c3a8126570dfe..988a5422ddd582024a124496b253e858650d39bf 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
@@ -62,6 +62,7 @@
#include "core/layout/LayoutListMarker.h"
#include "core/layout/LayoutMenuList.h"
#include "core/layout/LayoutTextControl.h"
+#include "core/layout/LayoutTextFragment.h"
#include "core/layout/LayoutView.h"
#include "core/layout/api/LayoutAPIShim.h"
#include "core/layout/api/LayoutViewItem.h"
@@ -121,6 +122,11 @@ static inline LayoutObject* firstChildConsideringContinuation(
LayoutObject* layoutObject) {
LayoutObject* firstChild = layoutObject->slowFirstChild();
+ if (firstChild && firstChild->isText() &&
+ toLayoutText(firstChild)->isTextFragment() &&
+ toLayoutTextFragment(firstChild)->firstLetterPseudoElement())
+ firstChild = nullptr;
eae 2016/11/24 21:50:13 Shouldn't this be return nullptr to ensure that it
kojii 2016/11/25 06:38:35 Done, thank you.
+
if (!firstChild && isInlineWithContinuation(layoutObject))
firstChild = firstChildInContinuation(toLayoutInline(*layoutObject));
« no previous file with comments | « third_party/WebKit/LayoutTests/accessibility/first-letter-text-transform-causes-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698