OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
8 * Copyright (C) 2011 Google Inc. All rights reserved. | 8 * Copyright (C) 2011 Google Inc. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 targetAncestor--; | 156 targetAncestor--; |
157 | 157 |
158 if (isShadowRootOrSVGShadowRoot(*i)) | 158 if (isShadowRootOrSVGShadowRoot(*i)) |
159 lowestCommonBoundary = targetAncestor; | 159 lowestCommonBoundary = targetAncestor; |
160 | 160 |
161 if ((*i) != (*targetAncestor).node()) | 161 if ((*i) != (*targetAncestor).node()) |
162 diverged = true; | 162 diverged = true; |
163 } | 163 } |
164 | 164 |
165 if (!diverged) { | 165 if (!diverged) { |
166 // The relatedTarget is a parent or shadowHost of the target. | 166 // The relatedTarget is an ancestor or shadowHost of the target. |
167 if (isShadowRootOrSVGShadowRoot(m_node.get())) | 167 if (m_node->shadowHost() == relatedTarget.get()) |
168 lowestCommonBoundary = m_ancestors.begin(); | 168 lowestCommonBoundary = m_ancestors.begin(); |
169 } else if ((*firstDivergentBoundary) == m_node.get()) { | 169 } else if ((*firstDivergentBoundary) == m_node.get()) { |
170 // Since ancestors does not contain target itself, we must account | 170 // Since ancestors does not contain target itself, we must account |
171 // for the possibility that target is a shadowHost of relatedTarget | 171 // for the possibility that target is a shadowHost of relatedTarget |
172 // and thus serves as the lowestCommonBoundary. | 172 // and thus serves as the lowestCommonBoundary. |
173 // Luckily, in this case the firstDivergentBoundary is target. | 173 // Luckily, in this case the firstDivergentBoundary is target. |
174 lowestCommonBoundary = m_ancestors.begin(); | 174 lowestCommonBoundary = m_ancestors.begin(); |
175 } | 175 } |
176 | 176 |
177 // Trim ancestors to lowestCommonBoundary to keep events inside of the commo
n shadow DOM subtree. | 177 // Trim ancestors to lowestCommonBoundary to keep events inside of the commo
n shadow DOM subtree. |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 // Changing this breaks existing sites. | 385 // Changing this breaks existing sites. |
386 // See https://bugs.webkit.org/show_bug.cgi?id=52195 for details. | 386 // See https://bugs.webkit.org/show_bug.cgi?id=52195 for details. |
387 if (event->type() == eventNames().selectstartEvent) | 387 if (event->type() == eventNames().selectstartEvent) |
388 return StayInsideShadowDOM; | 388 return StayInsideShadowDOM; |
389 | 389 |
390 return RetargetEvent; | 390 return RetargetEvent; |
391 } | 391 } |
392 | 392 |
393 } | 393 } |
394 | 394 |
OLD | NEW |