| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 #include "core/dom/Element.h" | 54 #include "core/dom/Element.h" |
| 55 #include "core/dom/ExceptionCode.h" | 55 #include "core/dom/ExceptionCode.h" |
| 56 #include "core/dom/FullscreenElementStack.h" | 56 #include "core/dom/FullscreenElementStack.h" |
| 57 #include "core/dom/NodeRenderingContext.h" | 57 #include "core/dom/NodeRenderingContext.h" |
| 58 #include "core/dom/PseudoElement.h" | 58 #include "core/dom/PseudoElement.h" |
| 59 #include "core/dom/Range.h" | 59 #include "core/dom/Range.h" |
| 60 #include "core/dom/StaticNodeList.h" | 60 #include "core/dom/StaticNodeList.h" |
| 61 #include "core/dom/TreeScope.h" | 61 #include "core/dom/TreeScope.h" |
| 62 #include "core/dom/ViewportArguments.h" | 62 #include "core/dom/ViewportArguments.h" |
| 63 #include "core/dom/shadow/ComposedShadowTreeWalker.h" | 63 #include "core/dom/shadow/ComposedShadowTreeWalker.h" |
| 64 #include "core/dom/shadow/ContentDistributor.h" | |
| 65 #include "core/dom/shadow/ElementShadow.h" | 64 #include "core/dom/shadow/ElementShadow.h" |
| 65 #include "core/dom/shadow/ScopeContentDistribution.h" |
| 66 #include "core/dom/shadow/SelectRuleFeatureSet.h" | 66 #include "core/dom/shadow/SelectRuleFeatureSet.h" |
| 67 #include "core/dom/shadow/ShadowRoot.h" | 67 #include "core/dom/shadow/ShadowRoot.h" |
| 68 #include "core/editing/Editor.h" | 68 #include "core/editing/Editor.h" |
| 69 #include "core/editing/SpellChecker.h" | 69 #include "core/editing/SpellChecker.h" |
| 70 #include "core/editing/TextIterator.h" | 70 #include "core/editing/TextIterator.h" |
| 71 #include "core/fetch/MemoryCache.h" | 71 #include "core/fetch/MemoryCache.h" |
| 72 #include "core/fetch/ResourceFetcher.h" | 72 #include "core/fetch/ResourceFetcher.h" |
| 73 #include "core/history/BackForwardController.h" | 73 #include "core/history/BackForwardController.h" |
| 74 #include "core/history/HistoryItem.h" | 74 #include "core/history/HistoryItem.h" |
| 75 #include "core/html/FormController.h" | 75 #include "core/html/FormController.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 return parentTreeScope ? parentTreeScope->rootNode() : 0; | 334 return parentTreeScope ? parentTreeScope->rootNode() : 0; |
| 335 } | 335 } |
| 336 | 336 |
| 337 bool Internals::hasSelectorForIdInShadow(Element* host, const String& idValue, E
xceptionState& es) | 337 bool Internals::hasSelectorForIdInShadow(Element* host, const String& idValue, E
xceptionState& es) |
| 338 { | 338 { |
| 339 if (!host || !host->shadow()) { | 339 if (!host || !host->shadow()) { |
| 340 es.throwDOMException(InvalidAccessError); | 340 es.throwDOMException(InvalidAccessError); |
| 341 return 0; | 341 return 0; |
| 342 } | 342 } |
| 343 | 343 |
| 344 return host->shadow()->distributor().ensureSelectFeatureSet(host->shadow()).
hasSelectorForId(idValue); | 344 return host->shadow()->ensureSelectFeatureSet().hasSelectorForId(idValue); |
| 345 } | 345 } |
| 346 | 346 |
| 347 bool Internals::hasSelectorForClassInShadow(Element* host, const String& classNa
me, ExceptionState& es) | 347 bool Internals::hasSelectorForClassInShadow(Element* host, const String& classNa
me, ExceptionState& es) |
| 348 { | 348 { |
| 349 if (!host || !host->shadow()) { | 349 if (!host || !host->shadow()) { |
| 350 es.throwDOMException(InvalidAccessError); | 350 es.throwDOMException(InvalidAccessError); |
| 351 return 0; | 351 return 0; |
| 352 } | 352 } |
| 353 | 353 |
| 354 return host->shadow()->distributor().ensureSelectFeatureSet(host->shadow()).
hasSelectorForClass(className); | 354 return host->shadow()->ensureSelectFeatureSet().hasSelectorForClass(classNam
e); |
| 355 } | 355 } |
| 356 | 356 |
| 357 bool Internals::hasSelectorForAttributeInShadow(Element* host, const String& att
ributeName, ExceptionState& es) | 357 bool Internals::hasSelectorForAttributeInShadow(Element* host, const String& att
ributeName, ExceptionState& es) |
| 358 { | 358 { |
| 359 if (!host || !host->shadow()) { | 359 if (!host || !host->shadow()) { |
| 360 es.throwDOMException(InvalidAccessError); | 360 es.throwDOMException(InvalidAccessError); |
| 361 return 0; | 361 return 0; |
| 362 } | 362 } |
| 363 | 363 |
| 364 return host->shadow()->distributor().ensureSelectFeatureSet(host->shadow()).
hasSelectorForAttribute(attributeName); | 364 return host->shadow()->ensureSelectFeatureSet().hasSelectorForAttribute(attr
ibuteName); |
| 365 } | 365 } |
| 366 | 366 |
| 367 bool Internals::hasSelectorForPseudoClassInShadow(Element* host, const String& p
seudoClass, ExceptionState& es) | 367 bool Internals::hasSelectorForPseudoClassInShadow(Element* host, const String& p
seudoClass, ExceptionState& es) |
| 368 { | 368 { |
| 369 if (!host || !host->shadow()) { | 369 if (!host || !host->shadow()) { |
| 370 es.throwDOMException(InvalidAccessError); | 370 es.throwDOMException(InvalidAccessError); |
| 371 return 0; | 371 return 0; |
| 372 } | 372 } |
| 373 | 373 |
| 374 const SelectRuleFeatureSet& featureSet = host->shadow()->distributor().ensur
eSelectFeatureSet(host->shadow()); | 374 const SelectRuleFeatureSet& featureSet = host->shadow()->ensureSelectFeature
Set(); |
| 375 if (pseudoClass == "checked") | 375 if (pseudoClass == "checked") |
| 376 return featureSet.hasSelectorForChecked(); | 376 return featureSet.hasSelectorForChecked(); |
| 377 if (pseudoClass == "enabled") | 377 if (pseudoClass == "enabled") |
| 378 return featureSet.hasSelectorForEnabled(); | 378 return featureSet.hasSelectorForEnabled(); |
| 379 if (pseudoClass == "disabled") | 379 if (pseudoClass == "disabled") |
| 380 return featureSet.hasSelectorForDisabled(); | 380 return featureSet.hasSelectorForDisabled(); |
| 381 if (pseudoClass == "indeterminate") | 381 if (pseudoClass == "indeterminate") |
| 382 return featureSet.hasSelectorForIndeterminate(); | 382 return featureSet.hasSelectorForIndeterminate(); |
| 383 if (pseudoClass == "link") | 383 if (pseudoClass == "link") |
| 384 return featureSet.hasSelectorForLink(); | 384 return featureSet.hasSelectorForLink(); |
| (...skipping 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2147 return false; | 2147 return false; |
| 2148 sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CON
TEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB); | 2148 sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CON
TEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB); |
| 2149 // To prevent tests that call loseSharedGraphicsContext3D from being | 2149 // To prevent tests that call loseSharedGraphicsContext3D from being |
| 2150 // flaky, we call finish so that the context is guaranteed to be lost | 2150 // flaky, we call finish so that the context is guaranteed to be lost |
| 2151 // synchronously (i.e. before returning). | 2151 // synchronously (i.e. before returning). |
| 2152 sharedContext->finish(); | 2152 sharedContext->finish(); |
| 2153 return true; | 2153 return true; |
| 2154 } | 2154 } |
| 2155 | 2155 |
| 2156 } | 2156 } |
| OLD | NEW |