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

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp

Issue 2607403002: Disallow setting invalid values for registered properties via CSSOM (Closed)
Patch Set: fix comments Created 3 years, 11 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 | « third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp ('k') | no next file » | 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) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 StyleSheetContents* styleSheetContents = 111 StyleSheetContents* styleSheetContents =
112 StyleSheetContents::create(strictCSSParserContext()); 112 StyleSheetContents::create(strictCSSParserContext());
113 String text = " div { " + shorthand + ": " + oldText + "; }"; 113 String text = " div { " + shorthand + ": " + oldText + "; }";
114 CSSParser::parseSheet(CSSParserContext(*document, nullptr), 114 CSSParser::parseSheet(CSSParserContext(*document, nullptr),
115 styleSheetContents, text); 115 styleSheetContents, text);
116 116
117 CSSStyleSheet* styleSheet = CSSStyleSheet::create(styleSheetContents); 117 CSSStyleSheet* styleSheet = CSSStyleSheet::create(styleSheetContents);
118 CSSStyleRule* rule = toCSSStyleRule(styleSheet->item(0)); 118 CSSStyleRule* rule = toCSSStyleRule(styleSheet->item(0));
119 CSSStyleDeclaration* style = rule->style(); 119 CSSStyleDeclaration* style = rule->style();
120 DummyExceptionStateForTesting exceptionState; 120 DummyExceptionStateForTesting exceptionState;
121 style->setProperty(longhand, newValue, style->getPropertyPriority(longhand), 121 style->setProperty(nullptr, longhand, newValue,
122 exceptionState); 122 style->getPropertyPriority(longhand), exceptionState);
123 return style->getPropertyValue(shorthand); 123 return style->getPropertyValue(shorthand);
124 } 124 }
125 125
126 HeapVector<Member<CSSStyleRule>> filterDuplicateRules(CSSRuleList* ruleList) { 126 HeapVector<Member<CSSStyleRule>> filterDuplicateRules(CSSRuleList* ruleList) {
127 HeapVector<Member<CSSStyleRule>> uniqRules; 127 HeapVector<Member<CSSStyleRule>> uniqRules;
128 HeapHashSet<Member<CSSRule>> uniqRulesSet; 128 HeapHashSet<Member<CSSRule>> uniqRulesSet;
129 for (unsigned i = ruleList ? ruleList->length() : 0; i > 0; --i) { 129 for (unsigned i = ruleList ? ruleList->length() : 0; i > 0; --i) {
130 CSSRule* rule = ruleList->item(i - 1); 130 CSSRule* rule = ruleList->item(i - 1);
131 if (!rule || rule->type() != CSSRule::kStyleRule || 131 if (!rule || rule->type() != CSSRule::kStyleRule ||
132 uniqRulesSet.contains(rule)) 132 uniqRulesSet.contains(rule))
(...skipping 2382 matching lines...) Expand 10 before | Expand all | Expand 10 after
2515 visitor->trace(m_cssStyleSheetToInspectorStyleSheet); 2515 visitor->trace(m_cssStyleSheetToInspectorStyleSheet);
2516 visitor->trace(m_documentToCSSStyleSheets); 2516 visitor->trace(m_documentToCSSStyleSheets);
2517 visitor->trace(m_invalidatedDocuments); 2517 visitor->trace(m_invalidatedDocuments);
2518 visitor->trace(m_nodeToInspectorStyleSheet); 2518 visitor->trace(m_nodeToInspectorStyleSheet);
2519 visitor->trace(m_inspectorUserAgentStyleSheet); 2519 visitor->trace(m_inspectorUserAgentStyleSheet);
2520 visitor->trace(m_tracker); 2520 visitor->trace(m_tracker);
2521 InspectorBaseAgent::trace(visitor); 2521 InspectorBaseAgent::trace(visitor);
2522 } 2522 }
2523 2523
2524 } // namespace blink 2524 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698