Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
| 4 * All rights reserved. | 4 * All rights reserved. |
| 5 * Copyright (C) 2012 Google Inc. All rights reserved. | 5 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 if (!m_treeBoundaryCrossingRuleSet) { | 291 if (!m_treeBoundaryCrossingRuleSet) { |
| 292 m_treeBoundaryCrossingRuleSet = new CSSStyleSheetRuleSubSet(); | 292 m_treeBoundaryCrossingRuleSet = new CSSStyleSheetRuleSubSet(); |
| 293 treeScope().document().styleEngine().addTreeBoundaryCrossingScope( | 293 treeScope().document().styleEngine().addTreeBoundaryCrossingScope( |
| 294 treeScope()); | 294 treeScope()); |
| 295 } | 295 } |
| 296 | 296 |
| 297 m_treeBoundaryCrossingRuleSet->push_back( | 297 m_treeBoundaryCrossingRuleSet->push_back( |
| 298 RuleSubSet::create(parentStyleSheet, sheetIndex, ruleSetForScope)); | 298 RuleSubSet::create(parentStyleSheet, sheetIndex, ruleSetForScope)); |
| 299 } | 299 } |
| 300 | 300 |
| 301 bool ScopedStyleResolver::hasSameStyles(const ScopedStyleResolver* first, | |
| 302 const ScopedStyleResolver* second) { | |
| 303 unsigned firstCount = first ? first->m_authorStyleSheets.size() : 0; | |
| 304 unsigned secondCount = second ? second->m_authorStyleSheets.size() : 0; | |
|
sof
2017/01/03 18:48:34
Using size_t would avoid the (unlikely) problem of
rune
2017/01/03 21:33:01
Done.
| |
| 305 if (firstCount != secondCount) | |
| 306 return false; | |
| 307 while (firstCount--) { | |
| 308 if (first->m_authorStyleSheets[firstCount]->contents() != | |
| 309 second->m_authorStyleSheets[firstCount]->contents()) | |
| 310 return false; | |
| 311 } | |
| 312 return true; | |
| 313 } | |
| 314 | |
| 301 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) { | 315 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) { |
| 302 visitor->trace(m_parentStyleSheet); | 316 visitor->trace(m_parentStyleSheet); |
| 303 visitor->trace(m_ruleSet); | 317 visitor->trace(m_ruleSet); |
| 304 } | 318 } |
| 305 | 319 |
| 306 } // namespace blink | 320 } // namespace blink |
| OLD | NEW |