OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |