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

Side by Side 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: dmazzoni review Created 4 years 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 #include "core/html/shadow/ShadowElementNames.h" 60 #include "core/html/shadow/ShadowElementNames.h"
61 #include "core/imagebitmap/ImageBitmapOptions.h" 61 #include "core/imagebitmap/ImageBitmapOptions.h"
62 #include "core/layout/HitTestResult.h" 62 #include "core/layout/HitTestResult.h"
63 #include "core/layout/LayoutFileUploadControl.h" 63 #include "core/layout/LayoutFileUploadControl.h"
64 #include "core/layout/LayoutHTMLCanvas.h" 64 #include "core/layout/LayoutHTMLCanvas.h"
65 #include "core/layout/LayoutImage.h" 65 #include "core/layout/LayoutImage.h"
66 #include "core/layout/LayoutInline.h" 66 #include "core/layout/LayoutInline.h"
67 #include "core/layout/LayoutListMarker.h" 67 #include "core/layout/LayoutListMarker.h"
68 #include "core/layout/LayoutMenuList.h" 68 #include "core/layout/LayoutMenuList.h"
69 #include "core/layout/LayoutTextControl.h" 69 #include "core/layout/LayoutTextControl.h"
70 #include "core/layout/LayoutTextFragment.h"
70 #include "core/layout/LayoutView.h" 71 #include "core/layout/LayoutView.h"
71 #include "core/layout/api/LayoutAPIShim.h" 72 #include "core/layout/api/LayoutAPIShim.h"
72 #include "core/layout/api/LayoutViewItem.h" 73 #include "core/layout/api/LayoutViewItem.h"
73 #include "core/layout/api/LineLayoutAPIShim.h" 74 #include "core/layout/api/LineLayoutAPIShim.h"
74 #include "core/loader/ProgressTracker.h" 75 #include "core/loader/ProgressTracker.h"
75 #include "core/page/Page.h" 76 #include "core/page/Page.h"
76 #include "core/paint/PaintLayer.h" 77 #include "core/paint/PaintLayer.h"
77 #include "core/style/ComputedStyleConstants.h" 78 #include "core/style/ComputedStyleConstants.h"
78 #include "core/svg/SVGDocumentExtensions.h" 79 #include "core/svg/SVGDocumentExtensions.h"
79 #include "core/svg/SVGSVGElement.h" 80 #include "core/svg/SVGSVGElement.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 if (!layoutObject->isLayoutInline()) 120 if (!layoutObject->isLayoutInline())
120 return false; 121 return false;
121 122
122 return toLayoutInline(layoutObject)->continuation(); 123 return toLayoutInline(layoutObject)->continuation();
123 } 124 }
124 125
125 static inline LayoutObject* firstChildConsideringContinuation( 126 static inline LayoutObject* firstChildConsideringContinuation(
126 LayoutObject* layoutObject) { 127 LayoutObject* layoutObject) {
127 LayoutObject* firstChild = layoutObject->slowFirstChild(); 128 LayoutObject* firstChild = layoutObject->slowFirstChild();
128 129
130 // CSS first-letter pseudo element is handled as continuation. Returning it
131 // will result in duplicated elements.
132 if (firstChild && firstChild->isText() &&
133 toLayoutText(firstChild)->isTextFragment() &&
134 toLayoutTextFragment(firstChild)->firstLetterPseudoElement())
135 return nullptr;
136
129 if (!firstChild && isInlineWithContinuation(layoutObject)) 137 if (!firstChild && isInlineWithContinuation(layoutObject))
130 firstChild = firstChildInContinuation(toLayoutInline(*layoutObject)); 138 firstChild = firstChildInContinuation(toLayoutInline(*layoutObject));
131 139
132 return firstChild; 140 return firstChild;
133 } 141 }
134 142
135 static inline LayoutInline* startOfContinuations(LayoutObject* r) { 143 static inline LayoutInline* startOfContinuations(LayoutObject* r) {
136 if (r->isInlineElementContinuation()) { 144 if (r->isInlineElementContinuation()) {
137 return toLayoutInline(r->node()->layoutObject()); 145 return toLayoutInline(r->node()->layoutObject());
138 } 146 }
(...skipping 2332 matching lines...) Expand 10 before | Expand all | Expand 10 after
2471 2479
2472 bool AXLayoutObject::elementAttributeValue( 2480 bool AXLayoutObject::elementAttributeValue(
2473 const QualifiedName& attributeName) const { 2481 const QualifiedName& attributeName) const {
2474 if (!m_layoutObject) 2482 if (!m_layoutObject)
2475 return false; 2483 return false;
2476 2484
2477 return equalIgnoringCase(getAttribute(attributeName), "true"); 2485 return equalIgnoringCase(getAttribute(attributeName), "true");
2478 } 2486 }
2479 2487
2480 } // namespace blink 2488 } // namespace blink
OLDNEW
« 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