Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 // Prefer ids over classes. | 54 // Prefer ids over classes. |
| 55 if (current->match() == CSSSelector::Id) | 55 if (current->match() == CSSSelector::Id) |
| 56 scopeSelector = current; | 56 scopeSelector = current; |
| 57 else if (current->match() == CSSSelector::Class && (!scopeSelector | | scopeSelector->match() != CSSSelector::Id)) | 57 else if (current->match() == CSSSelector::Class && (!scopeSelector | | scopeSelector->match() != CSSSelector::Id)) |
| 58 scopeSelector = current; | 58 scopeSelector = current; |
| 59 CSSSelector::Relation relation = current->relation(); | 59 CSSSelector::Relation relation = current->relation(); |
| 60 // FIXME: it would be better to use setNeedsStyleRecalc for all shad ow hosts matching | 60 // FIXME: it would be better to use setNeedsStyleRecalc for all shad ow hosts matching |
| 61 // scopeSelector. Currently requests full style recalc. | 61 // scopeSelector. Currently requests full style recalc. |
| 62 if (relation == CSSSelector::ShadowDeep || relation == CSSSelector:: ShadowPseudo) | 62 if (relation == CSSSelector::ShadowDeep || relation == CSSSelector:: ShadowPseudo) |
| 63 return false; | 63 return false; |
| 64 if (relation != CSSSelector::Descendant && relation != CSSSelector:: Child && relation != CSSSelector::SubSelector) | |
|
Timothy Loh
2015/09/10 06:09:40
This doesn't seem related?
rune
2015/09/10 13:54:50
This might actually work with the current code giv
Eric Willigers
2015/09/14 07:20:24
Reverted, it isn't needed.
| |
| 65 break; | |
| 66 } | 64 } |
| 67 if (!scopeSelector) | 65 if (!scopeSelector) |
| 68 return false; | 66 return false; |
| 69 ASSERT(scopeSelector->match() == CSSSelector::Class || scopeSelector->ma tch() == CSSSelector::Id); | 67 ASSERT(scopeSelector->match() == CSSSelector::Class || scopeSelector->ma tch() == CSSSelector::Id); |
| 70 if (scopeSelector->match() == CSSSelector::Id) | 68 if (scopeSelector->match() == CSSSelector::Id) |
| 71 idScopes.add(scopeSelector->value().impl()); | 69 idScopes.add(scopeSelector->value().impl()); |
| 72 else | 70 else |
| 73 classScopes.add(scopeSelector->value().impl()); | 71 classScopes.add(scopeSelector->value().impl()); |
| 74 } | 72 } |
| 75 return true; | 73 return true; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 element->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonFo rTracing::create(StyleChangeReason::StyleSheetChange)); | 203 element->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonFo rTracing::create(StyleChangeReason::StyleSheetChange)); |
| 206 // The whole subtree is now invalidated, we can skip to the next sib ling. | 204 // The whole subtree is now invalidated, we can skip to the next sib ling. |
| 207 element = ElementTraversal::nextSkippingChildren(*element); | 205 element = ElementTraversal::nextSkippingChildren(*element); |
| 208 continue; | 206 continue; |
| 209 } | 207 } |
| 210 element = ElementTraversal::next(*element); | 208 element = ElementTraversal::next(*element); |
| 211 } | 209 } |
| 212 } | 210 } |
| 213 | 211 |
| 214 } | 212 } |
| OLD | NEW |