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

Side by Side Diff: Source/core/css/PropertySetCSSStyleDeclaration.cpp

Issue 119533003: Clear mutable inline style when it is empty. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed typo. Created 7 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 | « Source/core/css/PropertySetCSSStyleDeclaration.h ('k') | Source/core/css/VariablesIterator.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 *
11 * This library is distributed in the hope that it will be useful, 11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details. 14 * Library General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Library General Public License 16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to 17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA. 19 * Boston, MA 02110-1301, USA.
20 */ 20 */
21 21
22 #include "config.h" 22 #include "config.h"
23 #include "core/css/PropertySetCSSStyleDeclaration.h" 23 #include "core/css/PropertySetCSSStyleDeclaration.h"
24 24
25 #include "HTMLNames.h" 25 #include "HTMLNames.h"
26 #include "RuntimeEnabledFeatures.h" 26 #include "RuntimeEnabledFeatures.h"
27 #include "bindings/v8/ExceptionState.h" 27 #include "bindings/v8/ExceptionState.h"
28 #include "core/css/CSSParser.h" 28 #include "core/css/CSSParser.h"
29 #include "core/css/CSSStyleSheet.h" 29 #include "core/css/CSSStyleSheet.h"
30 #include "core/css/InlineVariablesIterator.h"
30 #include "core/css/StylePropertySet.h" 31 #include "core/css/StylePropertySet.h"
32 #include "core/css/VariablesIterator.h"
31 #include "core/dom/Element.h" 33 #include "core/dom/Element.h"
32 #include "core/dom/MutationObserverInterestGroup.h" 34 #include "core/dom/MutationObserverInterestGroup.h"
33 #include "core/dom/MutationRecord.h" 35 #include "core/dom/MutationRecord.h"
34 #include "core/inspector/InspectorInstrumentation.h" 36 #include "core/inspector/InspectorInstrumentation.h"
35 37
36 using namespace std; 38 using namespace std;
37 39
38 namespace WebCore { 40 namespace WebCore {
39 41
40 namespace { 42 namespace {
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 void InlineCSSStyleDeclaration::didMutate(MutationType type) 421 void InlineCSSStyleDeclaration::didMutate(MutationType type)
420 { 422 {
421 if (type == NoChanges) 423 if (type == NoChanges)
422 return; 424 return;
423 425
424 m_cssomCSSValueClones.clear(); 426 m_cssomCSSValueClones.clear();
425 427
426 if (!m_parentElement) 428 if (!m_parentElement)
427 return; 429 return;
428 430
431 m_parentElement->clearMutableInlineStyleIfEmpty();
429 m_parentElement->setNeedsStyleRecalc(LocalStyleChange); 432 m_parentElement->setNeedsStyleRecalc(LocalStyleChange);
430 m_parentElement->invalidateStyleAttribute(); 433 m_parentElement->invalidateStyleAttribute();
431 StyleAttributeMutationScope(this).didInvalidateStyleAttr(); 434 StyleAttributeMutationScope(this).didInvalidateStyleAttr();
432 } 435 }
433 436
434 CSSStyleSheet* InlineCSSStyleDeclaration::parentStyleSheet() const 437 CSSStyleSheet* InlineCSSStyleDeclaration::parentStyleSheet() const
435 { 438 {
436 return m_parentElement ? m_parentElement->document().elementSheet() : 0; 439 return m_parentElement ? m_parentElement->document().elementSheet() : 0;
437 } 440 }
438 441
439 void InlineCSSStyleDeclaration::ref() 442 void InlineCSSStyleDeclaration::ref()
440 { 443 {
441 m_parentElement->ref(); 444 m_parentElement->ref();
442 } 445 }
443 446
444 void InlineCSSStyleDeclaration::deref() 447 void InlineCSSStyleDeclaration::deref()
445 { 448 {
446 m_parentElement->deref(); 449 m_parentElement->deref();
447 } 450 }
448 451
452 PassRefPtr<CSSVariablesIterator> InlineCSSStyleDeclaration::variablesIterator() const
453 {
454 return InlineVariablesIterator::create(m_parentElement);
455 }
456
449 457
450 } // namespace WebCore 458 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/PropertySetCSSStyleDeclaration.h ('k') | Source/core/css/VariablesIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698