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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp

Issue 2174833002: Make fragment-only URLs always be document-local references (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * * Redistributions of source code must retain the above copyright 4 * * Redistributions of source code must retain the above copyright
5 * notice, this list of conditions and the following disclaimer. 5 * notice, this list of conditions and the following disclaimer.
6 * * Redistributions in binary form must reproduce the above 6 * * Redistributions in binary form must reproduce the above
7 * copyright notice, this list of conditions and the following disclaimer 7 * copyright notice, this list of conditions and the following disclaimer
8 * in the documentation and/or other materials provided with the 8 * in the documentation and/or other materials provided with the
9 * distribution. 9 * distribution.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 convertLengthOrAuto(state, *rect.right()), 116 convertLengthOrAuto(state, *rect.right()),
117 convertLengthOrAuto(state, *rect.bottom()), 117 convertLengthOrAuto(state, *rect.bottom()),
118 convertLengthOrAuto(state, *rect.left())); 118 convertLengthOrAuto(state, *rect.left()));
119 } 119 }
120 120
121 PassRefPtr<ClipPathOperation> StyleBuilderConverter::convertClipPath(StyleResolv erState& state, const CSSValue& value) 121 PassRefPtr<ClipPathOperation> StyleBuilderConverter::convertClipPath(StyleResolv erState& state, const CSSValue& value)
122 { 122 {
123 if (value.isBasicShapeValue()) 123 if (value.isBasicShapeValue())
124 return ShapeClipPathOperation::create(basicShapeForValue(state, value)); 124 return ShapeClipPathOperation::create(basicShapeForValue(state, value));
125 if (value.isURIValue()) { 125 if (value.isURIValue()) {
126 String cssURLValue = toCSSURIValue(value).value(); 126 SVGURLReferenceResolver resolver(toCSSURIValue(value).value(), state.doc ument());
127 KURL url = state.document().completeURL(cssURLValue);
128 // TODO(fs): Doesn't work with forward or external SVG references (crbug .com/391604, crbug.com/109212, ...) 127 // TODO(fs): Doesn't work with forward or external SVG references (crbug .com/391604, crbug.com/109212, ...)
129 return ReferenceClipPathOperation::create(cssURLValue, AtomicString(url. fragmentIdentifier())); 128 return ReferenceClipPathOperation::create(toCSSURIValue(value).value(), resolver.fragmentIdentifier());
fs 2016/07/22 16:06:53 This has a (preexisting) bug (filed as crbug.com/6
130 } 129 }
131 DCHECK(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() = = CSSValueNone); 130 DCHECK(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() = = CSSValueNone);
132 return nullptr; 131 return nullptr;
133 } 132 }
134 133
135 FilterOperations StyleBuilderConverter::convertFilterOperations(StyleResolverSta te& state, const CSSValue& value) 134 FilterOperations StyleBuilderConverter::convertFilterOperations(StyleResolverSta te& state, const CSSValue& value)
136 { 135 {
137 return FilterOperationResolver::createFilterOperations(state, value); 136 return FilterOperationResolver::createFilterOperations(state, value);
138 } 137 }
139 138
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 1073
1075 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat e& state, const CSSValue& value) 1074 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat e& state, const CSSValue& value)
1076 { 1075 {
1077 if (value.isPathValue()) 1076 if (value.isPathValue())
1078 return toCSSPathValue(value).stylePath(); 1077 return toCSSPathValue(value).stylePath();
1079 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() = = CSSValueNone); 1078 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() = = CSSValueNone);
1080 return nullptr; 1079 return nullptr;
1081 } 1080 }
1082 1081
1083 } // namespace blink 1082 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698