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

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 370843002: Allow touch adjustment to return Shadow DOM node. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add simple shadow dom test Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 ShadowRoot* Internals::youngerShadowRoot(Node* shadow, ExceptionState& exception State) 629 ShadowRoot* Internals::youngerShadowRoot(Node* shadow, ExceptionState& exception State)
630 { 630 {
631 if (!shadow || !shadow->isShadowRoot()) { 631 if (!shadow || !shadow->isShadowRoot()) {
632 exceptionState.throwDOMException(InvalidAccessError, "The node provided is not a valid shadow root."); 632 exceptionState.throwDOMException(InvalidAccessError, "The node provided is not a valid shadow root.");
633 return 0; 633 return 0;
634 } 634 }
635 635
636 return toShadowRoot(shadow)->youngerShadowRoot(); 636 return toShadowRoot(shadow)->youngerShadowRoot();
637 } 637 }
638 638
639 Element* Internals::shadowHost(Node* node, ExceptionState& exceptionState)
640 {
641 if (!node) {
642 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages:: argumentNullOrIncorrectType(1, "Node"));
643 return 0;
644 }
645
646 return node->shadowHost();
647
648 }
649
639 String Internals::shadowRootType(const Node* root, ExceptionState& exceptionStat e) const 650 String Internals::shadowRootType(const Node* root, ExceptionState& exceptionStat e) const
640 { 651 {
641 if (!root || !root->isShadowRoot()) { 652 if (!root || !root->isShadowRoot()) {
642 exceptionState.throwDOMException(InvalidAccessError, "The node provided is not a valid shadow root."); 653 exceptionState.throwDOMException(InvalidAccessError, "The node provided is not a valid shadow root.");
643 return String(); 654 return String();
644 } 655 }
645 656
646 switch (toShadowRoot(root)->type()) { 657 switch (toShadowRoot(root)->type()) {
647 case ShadowRoot::UserAgentShadowRoot: 658 case ShadowRoot::UserAgentShadowRoot:
648 return String("UserAgentShadowRoot"); 659 return String("UserAgentShadowRoot");
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
2350 } 2361 }
2351 networkStateNotifier().setWebConnectionTypeForTest(webtype); 2362 networkStateNotifier().setWebConnectionTypeForTest(webtype);
2352 } 2363 }
2353 2364
2354 unsigned Internals::countHitRegions(CanvasRenderingContext2D* context) 2365 unsigned Internals::countHitRegions(CanvasRenderingContext2D* context)
2355 { 2366 {
2356 return context->hitRegionsCount(); 2367 return context->hitRegionsCount();
2357 } 2368 }
2358 2369
2359 } // namespace WebCore 2370 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698