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

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

Issue 2405153002: Remove CSS.unregisterProperty as the WG resolved to remove it for now (Closed)
Patch Set: Created 4 years, 2 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/PropertyRegistration.h" 5 #include "core/css/PropertyRegistration.h"
6 6
7 #include "core/css/CSSSyntaxDescriptor.h" 7 #include "core/css/CSSSyntaxDescriptor.h"
8 #include "core/css/CSSValueList.h" 8 #include "core/css/CSSValueList.h"
9 #include "core/css/CSSVariableReferenceValue.h" 9 #include "core/css/CSSVariableReferenceValue.h"
10 #include "core/css/PropertyDescriptor.h" 10 #include "core/css/PropertyDescriptor.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 registry.registerProperty(atomicName, syntaxDescriptor, 121 registry.registerProperty(atomicName, syntaxDescriptor,
122 descriptor.inherits(), nullptr, nullptr); 122 descriptor.inherits(), nullptr, nullptr);
123 } 123 }
124 124
125 // TODO(timloh): Invalidate only elements with this custom property set 125 // TODO(timloh): Invalidate only elements with this custom property set
126 document->setNeedsStyleRecalc(SubtreeStyleChange, 126 document->setNeedsStyleRecalc(SubtreeStyleChange,
127 StyleChangeReasonForTracing::create( 127 StyleChangeReasonForTracing::create(
128 StyleChangeReason::PropertyRegistration)); 128 StyleChangeReason::PropertyRegistration));
129 } 129 }
130 130
131 void PropertyRegistration::unregisterProperty(
132 ExecutionContext* executionContext,
133 const String& property,
134 ExceptionState& exceptionState) {
135 Document* document = toDocument(executionContext);
136 PropertyRegistry& registry = *document->propertyRegistry();
137 AtomicString atomicProperty(property);
138 if (!registry.registration(atomicProperty)) {
139 exceptionState.throwDOMException(
140 NotFoundError,
141 "CSS.unregisterProperty() called with non-registered property " +
142 property);
143 return;
144 }
145 registry.unregisterProperty(atomicProperty);
146
147 document->setNeedsStyleRecalc(SubtreeStyleChange,
148 StyleChangeReasonForTracing::create(
149 StyleChangeReason::PropertyUnregistration));
150 }
151
152 } // namespace blink 131 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/PropertyRegistration.h ('k') | third_party/WebKit/Source/core/css/PropertyRegistration.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698