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

Side by Side Diff: Source/core/inspector/InspectorDOMAgent.cpp

Issue 206503002: DevTools: Allow general editing of author shadow DOM elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
« no previous file with comments | « LayoutTests/inspector/elements/edit-dom-test.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 461
462 return node; 462 return node;
463 } 463 }
464 464
465 Element* InspectorDOMAgent::assertEditableElement(ErrorString* errorString, int nodeId) 465 Element* InspectorDOMAgent::assertEditableElement(ErrorString* errorString, int nodeId)
466 { 466 {
467 Element* element = assertElement(errorString, nodeId); 467 Element* element = assertElement(errorString, nodeId);
468 if (!element) 468 if (!element)
469 return 0; 469 return 0;
470 470
471 if (element->isInShadowTree()) { 471 if (element->isInShadowTree() && userAgentShadowRoot(element)) {
472 *errorString = "Cannot edit elements from shadow trees"; 472 *errorString = "Cannot edit elements from user-agent shadow trees";
473 return 0; 473 return 0;
474 } 474 }
475 475
476 if (element->isPseudoElement()) { 476 if (element->isPseudoElement()) {
477 *errorString = "Cannot edit pseudo elements"; 477 *errorString = "Cannot edit pseudo elements";
478 return 0; 478 return 0;
479 } 479 }
480 480
481 return element; 481 return element;
482 } 482 }
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after
2097 if (!m_documentNodeToIdMap.contains(m_document)) { 2097 if (!m_documentNodeToIdMap.contains(m_document)) {
2098 RefPtr<TypeBuilder::DOM::Node> root; 2098 RefPtr<TypeBuilder::DOM::Node> root;
2099 getDocument(errorString, root); 2099 getDocument(errorString, root);
2100 return errorString->isEmpty(); 2100 return errorString->isEmpty();
2101 } 2101 }
2102 return true; 2102 return true;
2103 } 2103 }
2104 2104
2105 } // namespace WebCore 2105 } // namespace WebCore
2106 2106
OLDNEW
« no previous file with comments | « LayoutTests/inspector/elements/edit-dom-test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698