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 #include "config.h" | 5 #include "config.h" |
6 #include "core/dom/CompositorProxy.h" | 6 #include "core/dom/CompositorProxy.h" |
7 | 7 |
8 #include "bindings/core/v8/ExceptionMessages.h" | 8 #include "bindings/core/v8/ExceptionMessages.h" |
9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
10 #include "core/dom/DOMNodeIds.h" | 10 #include "core/dom/DOMNodeIds.h" |
11 #include "core/dom/ExceptionCode.h" | 11 #include "core/dom/ExceptionCode.h" |
12 #include "core/dom/ExecutionContext.h" | 12 #include "core/dom/ExecutionContext.h" |
13 #include "core/style/ComputedStyle.h" | |
13 | 14 |
14 namespace blink { | 15 namespace blink { |
15 | 16 |
16 struct AttributeFlagMapping { | 17 struct AttributeFlagMapping { |
17 const char* name; | 18 const char* name; |
18 unsigned length; | 19 unsigned length; |
19 CompositorProxy::Attributes attribute; | 20 CompositorProxy::Attributes attribute; |
20 }; | 21 }; |
21 | 22 |
22 static AttributeFlagMapping allowedAttributes[] = { | 23 static AttributeFlagMapping allowedAttributes[] = { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 return new CompositorProxy(elementId, attributeFlags); | 108 return new CompositorProxy(elementId, attributeFlags); |
108 } | 109 } |
109 | 110 |
110 CompositorProxy::CompositorProxy(Element& element, const Vector<String>& attribu teArray) | 111 CompositorProxy::CompositorProxy(Element& element, const Vector<String>& attribu teArray) |
111 : m_elementId(DOMNodeIds::idForNode(&element)) | 112 : m_elementId(DOMNodeIds::idForNode(&element)) |
112 , m_bitfieldsSupported(attributesBitfieldFromNames(attributeArray)) | 113 , m_bitfieldsSupported(attributesBitfieldFromNames(attributeArray)) |
113 { | 114 { |
114 ASSERT(isMainThread()); | 115 ASSERT(isMainThread()); |
115 ASSERT(m_bitfieldsSupported); | 116 ASSERT(m_bitfieldsSupported); |
116 ASSERT(sanityCheckAttributeFlags(m_bitfieldsSupported)); | 117 ASSERT(sanityCheckAttributeFlags(m_bitfieldsSupported)); |
118 | |
119 element.setHasCompositorProxy(true); | |
Ian Vollick
2015/04/07 16:40:15
Where do we set this to false?
sadrul
2015/04/07 16:43:23
We currently do not. The API will need to have a C
| |
120 element.setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing: :create(StyleChangeReason::CompositorProxy)); | |
117 } | 121 } |
118 | 122 |
119 CompositorProxy::CompositorProxy(uint64_t elementId, uint32_t attributeFlags) | 123 CompositorProxy::CompositorProxy(uint64_t elementId, uint32_t attributeFlags) |
120 : m_elementId(elementId) | 124 : m_elementId(elementId) |
121 , m_bitfieldsSupported(attributeFlags) | 125 , m_bitfieldsSupported(attributeFlags) |
122 { | 126 { |
123 ASSERT(isControlThread()); | 127 ASSERT(isControlThread()); |
124 ASSERT(sanityCheckAttributeFlags(m_bitfieldsSupported)); | 128 ASSERT(sanityCheckAttributeFlags(m_bitfieldsSupported)); |
125 } | 129 } |
126 | 130 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 | 215 |
212 bool CompositorProxy::raiseExceptionIfNotMutable(Attributes attribute, Exception State& exceptionState) const | 216 bool CompositorProxy::raiseExceptionIfNotMutable(Attributes attribute, Exception State& exceptionState) const |
213 { | 217 { |
214 if (m_bitfieldsSupported & static_cast<uint32_t>(attribute)) | 218 if (m_bitfieldsSupported & static_cast<uint32_t>(attribute)) |
215 return false; | 219 return false; |
216 exceptionState.throwDOMException(NoModificationAllowedError, "Attempted to m utate non-mutable attribute."); | 220 exceptionState.throwDOMException(NoModificationAllowedError, "Attempted to m utate non-mutable attribute."); |
217 return true; | 221 return true; |
218 } | 222 } |
219 | 223 |
220 } // namespace blink | 224 } // namespace blink |
OLD | NEW |