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

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: Rebaseline first-letter-text-transform-causes-crash-expected.txt 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 #include "core/html/LabelsNodeList.h" 55 #include "core/html/LabelsNodeList.h"
56 #include "core/html/shadow/ShadowElementNames.h" 56 #include "core/html/shadow/ShadowElementNames.h"
57 #include "core/layout/HitTestResult.h" 57 #include "core/layout/HitTestResult.h"
58 #include "core/layout/LayoutFileUploadControl.h" 58 #include "core/layout/LayoutFileUploadControl.h"
59 #include "core/layout/LayoutHTMLCanvas.h" 59 #include "core/layout/LayoutHTMLCanvas.h"
60 #include "core/layout/LayoutImage.h" 60 #include "core/layout/LayoutImage.h"
61 #include "core/layout/LayoutInline.h" 61 #include "core/layout/LayoutInline.h"
62 #include "core/layout/LayoutListMarker.h" 62 #include "core/layout/LayoutListMarker.h"
63 #include "core/layout/LayoutMenuList.h" 63 #include "core/layout/LayoutMenuList.h"
64 #include "core/layout/LayoutTextControl.h" 64 #include "core/layout/LayoutTextControl.h"
65 #include "core/layout/LayoutTextFragment.h"
65 #include "core/layout/LayoutView.h" 66 #include "core/layout/LayoutView.h"
66 #include "core/layout/api/LayoutAPIShim.h" 67 #include "core/layout/api/LayoutAPIShim.h"
67 #include "core/layout/api/LayoutViewItem.h" 68 #include "core/layout/api/LayoutViewItem.h"
68 #include "core/layout/api/LineLayoutAPIShim.h" 69 #include "core/layout/api/LineLayoutAPIShim.h"
69 #include "core/loader/ProgressTracker.h" 70 #include "core/loader/ProgressTracker.h"
70 #include "core/page/Page.h" 71 #include "core/page/Page.h"
71 #include "core/paint/PaintLayer.h" 72 #include "core/paint/PaintLayer.h"
72 #include "core/style/ComputedStyleConstants.h" 73 #include "core/style/ComputedStyleConstants.h"
73 #include "core/svg/SVGDocumentExtensions.h" 74 #include "core/svg/SVGDocumentExtensions.h"
74 #include "core/svg/SVGSVGElement.h" 75 #include "core/svg/SVGSVGElement.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 if (!layoutObject->isLayoutInline()) 115 if (!layoutObject->isLayoutInline())
115 return false; 116 return false;
116 117
117 return toLayoutInline(layoutObject)->continuation(); 118 return toLayoutInline(layoutObject)->continuation();
118 } 119 }
119 120
120 static inline LayoutObject* firstChildConsideringContinuation( 121 static inline LayoutObject* firstChildConsideringContinuation(
121 LayoutObject* layoutObject) { 122 LayoutObject* layoutObject) {
122 LayoutObject* firstChild = layoutObject->slowFirstChild(); 123 LayoutObject* firstChild = layoutObject->slowFirstChild();
123 124
125 if (firstChild && firstChild->isText() &&
126 toLayoutText(firstChild)->isTextFragment() &&
127 toLayoutTextFragment(firstChild)->firstLetterPseudoElement())
128 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.
129
124 if (!firstChild && isInlineWithContinuation(layoutObject)) 130 if (!firstChild && isInlineWithContinuation(layoutObject))
125 firstChild = firstChildInContinuation(toLayoutInline(*layoutObject)); 131 firstChild = firstChildInContinuation(toLayoutInline(*layoutObject));
126 132
127 return firstChild; 133 return firstChild;
128 } 134 }
129 135
130 static inline LayoutInline* startOfContinuations(LayoutObject* r) { 136 static inline LayoutInline* startOfContinuations(LayoutObject* r) {
131 if (r->isInlineElementContinuation()) { 137 if (r->isInlineElementContinuation()) {
132 return toLayoutInline(r->node()->layoutObject()); 138 return toLayoutInline(r->node()->layoutObject());
133 } 139 }
(...skipping 2268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2402 2408
2403 bool AXLayoutObject::elementAttributeValue( 2409 bool AXLayoutObject::elementAttributeValue(
2404 const QualifiedName& attributeName) const { 2410 const QualifiedName& attributeName) const {
2405 if (!m_layoutObject) 2411 if (!m_layoutObject)
2406 return false; 2412 return false;
2407 2413
2408 return equalIgnoringCase(getAttribute(attributeName), "true"); 2414 return equalIgnoringCase(getAttribute(attributeName), "true");
2409 } 2415 }
2410 2416
2411 } // namespace blink 2417 } // 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