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

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

Issue 2905033003: Stricter equality check for local refs in CSSURIValue (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/animations/animate-local-url-expected.html ('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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/CSSURIValue.h" 5 #include "core/css/CSSURIValue.h"
6 6
7 #include "core/css/CSSMarkup.h" 7 #include "core/css/CSSMarkup.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/svg/SVGElementProxy.h" 9 #include "core/svg/SVGElementProxy.h"
10 #include "platform/weborigin/KURL.h" 10 #include "platform/weborigin/KURL.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 bool CSSURIValue::IsLocal(const Document& document) const { 64 bool CSSURIValue::IsLocal(const Document& document) const {
65 return is_local_ || 65 return is_local_ ||
66 EqualIgnoringFragmentIdentifier(AbsoluteUrl(), document.Url()); 66 EqualIgnoringFragmentIdentifier(AbsoluteUrl(), document.Url());
67 } 67 }
68 68
69 bool CSSURIValue::Equals(const CSSURIValue& other) const { 69 bool CSSURIValue::Equals(const CSSURIValue& other) const {
70 // If only one has the 'local url' flag set, the URLs can't match. 70 // If only one has the 'local url' flag set, the URLs can't match.
71 if (is_local_ != other.is_local_) 71 if (is_local_ != other.is_local_)
72 return false; 72 return false;
73 return (is_local_ && relative_url_ == other.relative_url_) || 73 if (is_local_)
74 absolute_url_ == other.absolute_url_; 74 return relative_url_ == other.relative_url_;
75 return absolute_url_ == other.absolute_url_;
75 } 76 }
76 77
77 DEFINE_TRACE_AFTER_DISPATCH(CSSURIValue) { 78 DEFINE_TRACE_AFTER_DISPATCH(CSSURIValue) {
78 visitor->Trace(proxy_); 79 visitor->Trace(proxy_);
79 CSSValue::TraceAfterDispatch(visitor); 80 CSSValue::TraceAfterDispatch(visitor);
80 } 81 }
81 82
82 } // namespace blink 83 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/animations/animate-local-url-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698