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

Side by Side Diff: Source/core/css/resolver/ViewportStyleResolver.cpp

Issue 1094003002: CSSStyleDeclaration::setProperty should override important style (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review feedback Created 5 years, 8 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
« no previous file with comments | « Source/core/css/parser/CSSParser.cpp ('k') | Source/core/editing/EditingStyle.cpp » ('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 * Copyright (C) 2012-2013 Intel Corporation. All rights reserved. 2 * Copyright (C) 2012-2013 Intel Corporation. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 if (origin == AuthorOrigin) 91 if (origin == AuthorOrigin)
92 m_hasAuthorStyle = true; 92 m_hasAuthorStyle = true;
93 93
94 if (!m_propertySet) { 94 if (!m_propertySet) {
95 m_propertySet = propertySet.mutableCopy(); 95 m_propertySet = propertySet.mutableCopy();
96 return; 96 return;
97 } 97 }
98 98
99 // We cannot use mergeAndOverrideOnConflict() here because it doesn't 99 // We cannot use mergeAndOverrideOnConflict() here because it doesn't
100 // respect the !important declaration (but addParsedProperty() does). 100 // respect the !important declaration (but addRespectingCascade() does).
101 for (unsigned i = 0; i < propertyCount; ++i) 101 for (unsigned i = 0; i < propertyCount; ++i)
102 m_propertySet->addParsedProperty(propertySet.propertyAt(i).toCSSProperty ()); 102 m_propertySet->addRespectingCascade(propertySet.propertyAt(i).toCSSPrope rty());
103 } 103 }
104 104
105 void ViewportStyleResolver::resolve() 105 void ViewportStyleResolver::resolve()
106 { 106 {
107 if (!m_propertySet) { 107 if (!m_propertySet) {
108 m_document->setViewportDescription(ViewportDescription(ViewportDescripti on::UserAgentStyleSheet)); 108 m_document->setViewportDescription(ViewportDescription(ViewportDescripti on::UserAgentStyleSheet));
109 return; 109 return;
110 } 110 }
111 111
112 ViewportDescription description(m_hasAuthorStyle ? ViewportDescription::Auth orStyleSheet : ViewportDescription::UserAgentStyleSheet); 112 ViewportDescription description(m_hasAuthorStyle ? ViewportDescription::Auth orStyleSheet : ViewportDescription::UserAgentStyleSheet);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 return result; 220 return result;
221 } 221 }
222 222
223 DEFINE_TRACE(ViewportStyleResolver) 223 DEFINE_TRACE(ViewportStyleResolver)
224 { 224 {
225 visitor->trace(m_propertySet); 225 visitor->trace(m_propertySet);
226 visitor->trace(m_document); 226 visitor->trace(m_document);
227 } 227 }
228 228
229 } // namespace blink 229 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSParser.cpp ('k') | Source/core/editing/EditingStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698