| 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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 { | 389 { |
| 390 ASSERT(host); | 390 ASSERT(host); |
| 391 if (!host->shadow()) { | 391 if (!host->shadow()) { |
| 392 exceptionState.throwDOMException(InvalidAccessError, "The host element d
oes not have a shadow."); | 392 exceptionState.throwDOMException(InvalidAccessError, "The host element d
oes not have a shadow."); |
| 393 return false; | 393 return false; |
| 394 } | 394 } |
| 395 | 395 |
| 396 return host->shadow()->ensureSelectFeatureSet().hasSelectorForAttribute(attr
ibuteName); | 396 return host->shadow()->ensureSelectFeatureSet().hasSelectorForAttribute(attr
ibuteName); |
| 397 } | 397 } |
| 398 | 398 |
| 399 bool Internals::hasSelectorForPseudoClassInShadow(Element* host, const String& p
seudoClass, ExceptionState& exceptionState) | |
| 400 { | |
| 401 ASSERT(host); | |
| 402 if (!host->shadow()) { | |
| 403 exceptionState.throwDOMException(InvalidAccessError, "The host element d
oes not have a shadow."); | |
| 404 return 0; | |
| 405 } | |
| 406 return host->shadow()->ensureSelectFeatureSet().hasSelectorForPseudoType(CSS
Selector::parsePseudoType(AtomicString(pseudoClass), false)); | |
| 407 } | |
| 408 | |
| 409 unsigned short Internals::compareTreeScopePosition(const Node* node1, const Node
* node2, ExceptionState& exceptionState) const | 399 unsigned short Internals::compareTreeScopePosition(const Node* node1, const Node
* node2, ExceptionState& exceptionState) const |
| 410 { | 400 { |
| 411 ASSERT(node1 && node2); | 401 ASSERT(node1 && node2); |
| 412 const TreeScope* treeScope1 = node1->isDocumentNode() ? static_cast<const Tr
eeScope*>(toDocument(node1)) : | 402 const TreeScope* treeScope1 = node1->isDocumentNode() ? static_cast<const Tr
eeScope*>(toDocument(node1)) : |
| 413 node1->isShadowRoot() ? static_cast<const TreeScope*>(toShadowRoot(node1
)) : 0; | 403 node1->isShadowRoot() ? static_cast<const TreeScope*>(toShadowRoot(node1
)) : 0; |
| 414 const TreeScope* treeScope2 = node2->isDocumentNode() ? static_cast<const Tr
eeScope*>(toDocument(node2)) : | 404 const TreeScope* treeScope2 = node2->isDocumentNode() ? static_cast<const Tr
eeScope*>(toDocument(node2)) : |
| 415 node2->isShadowRoot() ? static_cast<const TreeScope*>(toShadowRoot(node2
)) : 0; | 405 node2->isShadowRoot() ? static_cast<const TreeScope*>(toShadowRoot(node2
)) : 0; |
| 416 if (!treeScope1 || !treeScope2) { | 406 if (!treeScope1 || !treeScope2) { |
| 417 exceptionState.throwDOMException(InvalidAccessError, String::format("The
%s node is neither a document node, nor a shadow root.", treeScope1 ? "second"
: "first")); | 407 exceptionState.throwDOMException(InvalidAccessError, String::format("The
%s node is neither a document node, nor a shadow root.", treeScope1 ? "second"
: "first")); |
| 418 return 0; | 408 return 0; |
| (...skipping 1952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2371 | 2361 |
| 2372 ClientRectList* Internals::focusRingRects(Element* element) | 2362 ClientRectList* Internals::focusRingRects(Element* element) |
| 2373 { | 2363 { |
| 2374 Vector<LayoutRect> rects; | 2364 Vector<LayoutRect> rects; |
| 2375 if (element && element->layoutObject()) | 2365 if (element && element->layoutObject()) |
| 2376 element->layoutObject()->addFocusRingRects(rects, LayoutPoint()); | 2366 element->layoutObject()->addFocusRingRects(rects, LayoutPoint()); |
| 2377 return ClientRectList::create(rects); | 2367 return ClientRectList::create(rects); |
| 2378 } | 2368 } |
| 2379 | 2369 |
| 2380 } // namespace blink | 2370 } // namespace blink |
| OLD | NEW |