| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 DEFINE_NODE_FACTORY(HTMLShadowElement) | 48 DEFINE_NODE_FACTORY(HTMLShadowElement) |
| 49 | 49 |
| 50 HTMLShadowElement::~HTMLShadowElement() | 50 HTMLShadowElement::~HTMLShadowElement() |
| 51 { | 51 { |
| 52 } | 52 } |
| 53 | 53 |
| 54 ShadowRoot* HTMLShadowElement::olderShadowRoot() | 54 ShadowRoot* HTMLShadowElement::olderShadowRoot() |
| 55 { | 55 { |
| 56 ShadowRoot* containingRoot = containingShadowRoot(); | 56 ShadowRoot* containingRoot = containingShadowRoot(); |
| 57 if (!containingRoot) | 57 if (!containingRoot) |
| 58 return 0; | 58 return nullptr; |
| 59 | 59 |
| 60 document().updateDistributionForNodeIfNeeded(this); | 60 document().updateDistributionForNodeIfNeeded(this); |
| 61 | 61 |
| 62 ShadowRoot* older = containingRoot->olderShadowRoot(); | 62 ShadowRoot* older = containingRoot->olderShadowRoot(); |
| 63 if (!older || !older->shouldExposeToBindings() || older->shadowInsertionPoin
tOfYoungerShadowRoot() != this) | 63 if (!older || !older->shouldExposeToBindings() || older->shadowInsertionPoin
tOfYoungerShadowRoot() != this) |
| 64 return 0; | 64 return nullptr; |
| 65 | 65 |
| 66 ASSERT(older->shouldExposeToBindings()); | 66 ASSERT(older->shouldExposeToBindings()); |
| 67 return older; | 67 return older; |
| 68 } | 68 } |
| 69 | 69 |
| 70 Node::InsertionNotificationRequest HTMLShadowElement::insertedInto(ContainerNode
* insertionPoint) | 70 Node::InsertionNotificationRequest HTMLShadowElement::insertedInto(ContainerNode
* insertionPoint) |
| 71 { | 71 { |
| 72 if (insertionPoint->inDocument()) { | 72 if (insertionPoint->inDocument()) { |
| 73 // Warn if trying to reproject between user agent and author shadows. | 73 // Warn if trying to reproject between user agent and author shadows. |
| 74 ShadowRoot* root = containingShadowRoot(); | 74 ShadowRoot* root = containingShadowRoot(); |
| 75 if (root && root->olderShadowRoot() && root->type() != root->olderShadow
Root()->type()) { | 75 if (root && root->olderShadowRoot() && root->type() != root->olderShadow
Root()->type()) { |
| 76 String message = String::format("<shadow> doesn't work for %s elemen
t host.", root->host()->tagName().utf8().data()); | 76 String message = String::format("<shadow> doesn't work for %s elemen
t host.", root->host()->tagName().utf8().data()); |
| 77 document().addConsoleMessage(ConsoleMessage::create(RenderingMessage
Source, WarningMessageLevel, message)); | 77 document().addConsoleMessage(ConsoleMessage::create(RenderingMessage
Source, WarningMessageLevel, message)); |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 return InsertionPoint::insertedInto(insertionPoint); | 80 return InsertionPoint::insertedInto(insertionPoint); |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace blink | 83 } // namespace blink |
| 84 | 84 |
| OLD | NEW |