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

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

Issue 2625873010: Resolve CSS url(...) non-<image> values against the correct base (Closed)
Patch Set: Rebase Created 3 years, 11 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 // 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 #ifndef CSSURIValue_h 5 #ifndef CSSURIValue_h
6 #define CSSURIValue_h 6 #define CSSURIValue_h
7 7
8 #include "core/css/CSSValue.h" 8 #include "core/css/CSSValue.h"
9 #include "wtf/text/WTFString.h" 9 #include "wtf/text/WTFString.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 class Document; 13 class Document;
14 class KURL;
14 class SVGElementProxy; 15 class SVGElementProxy;
15 16
16 class CSSURIValue : public CSSValue { 17 class CSSURIValue : public CSSValue {
17 public: 18 public:
18 static CSSURIValue* create(const String& str) { return new CSSURIValue(str); } 19 static CSSURIValue* create(const String& relativeUrl, const KURL& url) {
20 return new CSSURIValue(AtomicString(relativeUrl), url);
21 }
22 static CSSURIValue* create(const AtomicString& absoluteUrl) {
23 return new CSSURIValue(absoluteUrl, absoluteUrl);
24 }
19 ~CSSURIValue(); 25 ~CSSURIValue();
20 26
21 SVGElementProxy& ensureElementProxy(Document&) const; 27 SVGElementProxy& ensureElementProxy(const Document&) const;
28 void reResolveUrl(const Document&) const;
22 29
23 const String& value() const { return m_url; } 30 const String& value() const { return m_relativeUrl; }
24 const String& url() const { return m_url; }
25 31
26 String customCSSText() const; 32 String customCSSText() const;
27 33
34 bool isLocal(const Document&) const;
28 bool equals(const CSSURIValue&) const; 35 bool equals(const CSSURIValue&) const;
29 36
30 DECLARE_TRACE_AFTER_DISPATCH(); 37 DECLARE_TRACE_AFTER_DISPATCH();
31 38
32 private: 39 private:
33 explicit CSSURIValue(const String&); 40 CSSURIValue(const AtomicString&, const KURL&);
41 CSSURIValue(const AtomicString& relativeUrl, const AtomicString& absoluteUrl);
34 42
35 String m_url; 43 KURL absoluteUrl() const;
44 AtomicString fragmentIdentifier() const;
45
46 AtomicString m_relativeUrl;
47 bool m_isLocal;
36 48
37 mutable Member<SVGElementProxy> m_proxy; 49 mutable Member<SVGElementProxy> m_proxy;
50 mutable AtomicString m_absoluteUrl;
38 }; 51 };
39 52
40 DEFINE_CSS_VALUE_TYPE_CASTS(CSSURIValue, isURIValue()); 53 DEFINE_CSS_VALUE_TYPE_CASTS(CSSURIValue, isURIValue());
41 54
42 } // namespace blink 55 } // namespace blink
43 56
44 #endif // CSSURIValue_h 57 #endif // CSSURIValue_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.cpp ('k') | third_party/WebKit/Source/core/css/CSSURIValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698