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

Side by Side Diff: sky/engine/core/css/PropertySetCSSStyleDeclaration.cpp

Issue 780483002: Remove the CSSOM. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « sky/engine/core/css/PropertySetCSSStyleDeclaration.h ('k') | sky/engine/core/css/RuleSet.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 PassRefPtr<MutableStylePropertySet> AbstractPropertySetCSSStyleDeclaration::copy Properties() const 273 PassRefPtr<MutableStylePropertySet> AbstractPropertySetCSSStyleDeclaration::copy Properties() const
274 { 274 {
275 return propertySet().mutableCopy(); 275 return propertySet().mutableCopy();
276 } 276 }
277 277
278 bool AbstractPropertySetCSSStyleDeclaration::cssPropertyMatches(CSSPropertyID pr opertyID, const CSSValue* propertyValue) const 278 bool AbstractPropertySetCSSStyleDeclaration::cssPropertyMatches(CSSPropertyID pr opertyID, const CSSValue* propertyValue) const
279 { 279 {
280 return propertySet().propertyMatches(propertyID, propertyValue); 280 return propertySet().propertyMatches(propertyID, propertyValue);
281 } 281 }
282 282
283 StyleRuleCSSStyleDeclaration::StyleRuleCSSStyleDeclaration(MutableStylePropertyS et& propertySetArg, CSSRule* parentRule)
284 : PropertySetCSSStyleDeclaration(propertySetArg)
285 #if !ENABLE(OILPAN)
286 , m_refCount(1)
287 #endif
288 , m_parentRule(parentRule)
289 {
290 #if !ENABLE(OILPAN)
291 m_propertySet->ref();
292 #endif
293 }
294
295 StyleRuleCSSStyleDeclaration::~StyleRuleCSSStyleDeclaration()
296 {
297 #if !ENABLE(OILPAN)
298 m_propertySet->deref();
299 #endif
300 }
301
302 #if !ENABLE(OILPAN)
303 void StyleRuleCSSStyleDeclaration::ref()
304 {
305 ++m_refCount;
306 }
307
308 void StyleRuleCSSStyleDeclaration::deref()
309 {
310 ASSERT(m_refCount);
311 if (!--m_refCount)
312 delete this;
313 }
314 #endif
315
316 void StyleRuleCSSStyleDeclaration::willMutate()
317 {
318 if (m_parentRule && m_parentRule->parentStyleSheet())
319 m_parentRule->parentStyleSheet()->willMutateRules();
320 }
321
322 void StyleRuleCSSStyleDeclaration::didMutate(MutationType type)
323 {
324 if (type == PropertyChanged)
325 m_cssomCSSValueClones.clear();
326
327 // Style sheet mutation needs to be signaled even if the change failed. will MutateRules/didMutateRules must pair.
328 if (m_parentRule && m_parentRule->parentStyleSheet())
329 m_parentRule->parentStyleSheet()->didMutateRules();
330 }
331
332 CSSStyleSheet* StyleRuleCSSStyleDeclaration::parentStyleSheet() const
333 {
334 return m_parentRule ? m_parentRule->parentStyleSheet() : 0;
335 }
336
337 void StyleRuleCSSStyleDeclaration::reattach(MutableStylePropertySet& propertySet )
338 {
339 #if !ENABLE(OILPAN)
340 m_propertySet->deref();
341 #endif
342 m_propertySet = &propertySet;
343 #if !ENABLE(OILPAN)
344 m_propertySet->ref();
345 #endif
346 }
347
348 MutableStylePropertySet& InlineCSSStyleDeclaration::propertySet() const 283 MutableStylePropertySet& InlineCSSStyleDeclaration::propertySet() const
349 { 284 {
350 return m_parentElement->ensureMutableInlineStyle(); 285 return m_parentElement->ensureMutableInlineStyle();
351 } 286 }
352 287
353 void InlineCSSStyleDeclaration::didMutate(MutationType type) 288 void InlineCSSStyleDeclaration::didMutate(MutationType type)
354 { 289 {
355 if (type == NoChanges) 290 if (type == NoChanges)
356 return; 291 return;
357 292
(...skipping 19 matching lines...) Expand all
377 m_parentElement->ref(); 312 m_parentElement->ref();
378 } 313 }
379 314
380 void InlineCSSStyleDeclaration::deref() 315 void InlineCSSStyleDeclaration::deref()
381 { 316 {
382 m_parentElement->deref(); 317 m_parentElement->deref();
383 } 318 }
384 #endif 319 #endif
385 320
386 } // namespace blink 321 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/css/PropertySetCSSStyleDeclaration.h ('k') | sky/engine/core/css/RuleSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698