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) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. |
6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> | 6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 191 |
192 // FIXME: Eventually we'd like to evaluate scripts which are inserted into a | 192 // FIXME: Eventually we'd like to evaluate scripts which are inserted into a |
193 // viewless document but this'll do for now. | 193 // viewless document but this'll do for now. |
194 // See http://bugs.webkit.org/show_bug.cgi?id=5727 | 194 // See http://bugs.webkit.org/show_bug.cgi?id=5727 |
195 if (!m_element->document()->frame()) | 195 if (!m_element->document()->frame()) |
196 return false; | 196 return false; |
197 | 197 |
198 if (!m_element->document()->frame()->script()->canExecuteScripts(AboutToExec
uteScript)) | 198 if (!m_element->document()->frame()->script()->canExecuteScripts(AboutToExec
uteScript)) |
199 return false; | 199 return false; |
200 | 200 |
| 201 // FIXME: This is non-standard. Remove this after https://bugs.webkit.org/sh
ow_bug.cgi?id=62412. |
| 202 Node* ancestor = m_element->parentNode(); |
| 203 while (ancestor) { |
| 204 if (ancestor->isSVGShadowRoot()) |
| 205 return false; |
| 206 ancestor = ancestor->parentNode(); |
| 207 } |
| 208 |
201 if (!isScriptForEventSupported()) | 209 if (!isScriptForEventSupported()) |
202 return false; | 210 return false; |
203 | 211 |
204 if (!charsetAttributeValue().isEmpty()) | 212 if (!charsetAttributeValue().isEmpty()) |
205 m_characterEncoding = charsetAttributeValue(); | 213 m_characterEncoding = charsetAttributeValue(); |
206 else | 214 else |
207 m_characterEncoding = m_element->document()->charset(); | 215 m_characterEncoding = m_element->document()->charset(); |
208 | 216 |
209 if (hasSourceAttribute()) | 217 if (hasSourceAttribute()) |
210 if (!requestScript(sourceAttributeValue())) | 218 if (!requestScript(sourceAttributeValue())) |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 371 |
364 #if ENABLE(SVG) | 372 #if ENABLE(SVG) |
365 if (element->isSVGElement() && element->hasTagName(SVGNames::scriptTag)) | 373 if (element->isSVGElement() && element->hasTagName(SVGNames::scriptTag)) |
366 return static_cast<SVGScriptElement*>(element); | 374 return static_cast<SVGScriptElement*>(element); |
367 #endif | 375 #endif |
368 | 376 |
369 return 0; | 377 return 0; |
370 } | 378 } |
371 | 379 |
372 } | 380 } |
OLD | NEW |