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

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

Issue 2416893002: CSSMediaRule and CSSSupportsRule inherit from CSSConditionRule (Closed)
Patch Set: Fix supports test case 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 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2002, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2002, 2005, 2006, 2008, 2012 Apple Inc. 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 291
292 void StyleRuleGroup::wrapperRemoveRule(unsigned index) { 292 void StyleRuleGroup::wrapperRemoveRule(unsigned index) {
293 m_childRules.remove(index); 293 m_childRules.remove(index);
294 } 294 }
295 295
296 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleGroup) { 296 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleGroup) {
297 visitor->trace(m_childRules); 297 visitor->trace(m_childRules);
298 StyleRuleBase::traceAfterDispatch(visitor); 298 StyleRuleBase::traceAfterDispatch(visitor);
299 } 299 }
300 300
301 StyleRuleCondition::StyleRuleCondition(
302 RuleType type,
303 HeapVector<Member<StyleRuleBase>>& adoptRules)
304 : StyleRuleGroup(type, adoptRules) {}
305
306 StyleRuleCondition::StyleRuleCondition(
307 RuleType type,
308 const String& conditionText,
309 HeapVector<Member<StyleRuleBase>>& adoptRules)
310 : StyleRuleGroup(type, adoptRules), m_conditionText(conditionText) {}
311
312 StyleRuleCondition::StyleRuleCondition(const StyleRuleCondition& o)
meade_UTC10 2016/10/17 02:58:44 o -> condition This also exists below; don't abbre
313 : StyleRuleGroup(o), m_conditionText(o.m_conditionText) {}
314
301 StyleRuleMedia::StyleRuleMedia(MediaQuerySet* media, 315 StyleRuleMedia::StyleRuleMedia(MediaQuerySet* media,
302 HeapVector<Member<StyleRuleBase>>& adoptRules) 316 HeapVector<Member<StyleRuleBase>>& adoptRules)
303 : StyleRuleGroup(Media, adoptRules), m_mediaQueries(media) {} 317 : StyleRuleCondition(Media, adoptRules), m_mediaQueries(media) {}
304 318
305 StyleRuleMedia::StyleRuleMedia(const StyleRuleMedia& o) : StyleRuleGroup(o) { 319 StyleRuleMedia::StyleRuleMedia(const StyleRuleMedia& o)
320 : StyleRuleCondition(o) {
306 if (o.m_mediaQueries) 321 if (o.m_mediaQueries)
307 m_mediaQueries = o.m_mediaQueries->copy(); 322 m_mediaQueries = o.m_mediaQueries->copy();
308 } 323 }
309 324
310 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleMedia) { 325 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleMedia) {
311 visitor->trace(m_mediaQueries); 326 visitor->trace(m_mediaQueries);
312 StyleRuleGroup::traceAfterDispatch(visitor); 327 StyleRuleCondition::traceAfterDispatch(visitor);
313 } 328 }
314 329
315 StyleRuleSupports::StyleRuleSupports( 330 StyleRuleSupports::StyleRuleSupports(
316 const String& conditionText, 331 const String& conditionText,
317 bool conditionIsSupported, 332 bool conditionIsSupported,
318 HeapVector<Member<StyleRuleBase>>& adoptRules) 333 HeapVector<Member<StyleRuleBase>>& adoptRules)
319 : StyleRuleGroup(Supports, adoptRules), 334 : StyleRuleCondition(Supports, conditionText, adoptRules),
320 m_conditionText(conditionText),
321 m_conditionIsSupported(conditionIsSupported) {} 335 m_conditionIsSupported(conditionIsSupported) {}
322 336
323 StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& o) 337 StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& o)
324 : StyleRuleGroup(o), 338 : StyleRuleCondition(o), m_conditionIsSupported(o.m_conditionIsSupported) {}
325 m_conditionText(o.m_conditionText),
326 m_conditionIsSupported(o.m_conditionIsSupported) {}
327 339
328 StyleRuleViewport::StyleRuleViewport(StylePropertySet* properties) 340 StyleRuleViewport::StyleRuleViewport(StylePropertySet* properties)
329 : StyleRuleBase(Viewport), m_properties(properties) {} 341 : StyleRuleBase(Viewport), m_properties(properties) {}
330 342
331 StyleRuleViewport::StyleRuleViewport(const StyleRuleViewport& o) 343 StyleRuleViewport::StyleRuleViewport(const StyleRuleViewport& o)
332 : StyleRuleBase(o), m_properties(o.m_properties->mutableCopy()) {} 344 : StyleRuleBase(o), m_properties(o.m_properties->mutableCopy()) {}
333 345
334 StyleRuleViewport::~StyleRuleViewport() {} 346 StyleRuleViewport::~StyleRuleViewport() {}
335 347
336 MutableStylePropertySet& StyleRuleViewport::mutableProperties() { 348 MutableStylePropertySet& StyleRuleViewport::mutableProperties() {
337 if (!m_properties->isMutable()) 349 if (!m_properties->isMutable())
338 m_properties = m_properties->mutableCopy(); 350 m_properties = m_properties->mutableCopy();
339 return *toMutableStylePropertySet(m_properties); 351 return *toMutableStylePropertySet(m_properties);
340 } 352 }
341 353
342 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleViewport) { 354 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleViewport) {
343 visitor->trace(m_properties); 355 visitor->trace(m_properties);
344 StyleRuleBase::traceAfterDispatch(visitor); 356 StyleRuleBase::traceAfterDispatch(visitor);
345 } 357 }
346 358
347 } // namespace blink 359 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698