| OLD | NEW |
| 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 StyleRuleNamespace_h | 5 #ifndef StyleRuleNamespace_h |
| 6 #define StyleRuleNamespace_h | 6 #define StyleRuleNamespace_h |
| 7 | 7 |
| 8 #include "core/css/StyleRule.h" | 8 #include "core/css/StyleRule.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 // This class is never actually stored anywhere currently, but only used for | 12 // This class is never actually stored anywhere currently, but only used for |
| 13 // the parser to pass to a stylesheet | 13 // the parser to pass to a stylesheet |
| 14 class StyleRuleNamespace final : public StyleRuleBase { | 14 class StyleRuleNamespace final : public StyleRuleBase { |
| 15 public: | 15 public: |
| 16 static StyleRuleNamespace* create(AtomicString prefix, AtomicString uri) { | 16 static StyleRuleNamespace* create(AtomicString prefix, AtomicString uri) { |
| 17 return new StyleRuleNamespace(prefix, uri); | 17 return new StyleRuleNamespace(prefix, uri); |
| 18 } | 18 } |
| 19 | 19 |
| 20 StyleRuleNamespace* copy() const { |
| 21 return new StyleRuleNamespace(m_prefix, m_uri); |
| 22 } |
| 23 |
| 20 AtomicString prefix() const { return m_prefix; } | 24 AtomicString prefix() const { return m_prefix; } |
| 21 AtomicString uri() const { return m_uri; } | 25 AtomicString uri() const { |
| 26 DCHECK(!m_uri.isHashTableDeletedValue()); |
| 27 return m_uri; |
| 28 } |
| 22 | 29 |
| 23 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { | 30 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { |
| 24 StyleRuleBase::traceAfterDispatch(visitor); | 31 StyleRuleBase::traceAfterDispatch(visitor); |
| 25 } | 32 } |
| 26 | 33 |
| 27 private: | 34 private: |
| 28 StyleRuleNamespace(AtomicString prefix, AtomicString uri) | 35 StyleRuleNamespace(AtomicString prefix, AtomicString uri) |
| 29 : StyleRuleBase(Namespace), m_prefix(prefix), m_uri(uri) {} | 36 : StyleRuleBase(Namespace), m_prefix(prefix), m_uri(uri) {} |
| 30 | 37 |
| 31 AtomicString m_prefix; | 38 AtomicString m_prefix; |
| 32 AtomicString m_uri; | 39 AtomicString m_uri; |
| 33 }; | 40 }; |
| 34 | 41 |
| 35 DEFINE_STYLE_RULE_TYPE_CASTS(Namespace); | 42 DEFINE_STYLE_RULE_TYPE_CASTS(Namespace); |
| 36 | 43 |
| 37 } // namespace blink | 44 } // namespace blink |
| 38 | 45 |
| 39 #endif // StyleRuleNamespace_h | 46 #endif // StyleRuleNamespace_h |
| OLD | NEW |