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

Side by Side Diff: Source/WebCore/dom/ScriptElement.cpp

Issue 7163002: Merge 88549 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 years, 6 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
« no previous file with comments | « LayoutTests/svg/dom/use-style-recalc-script-execute-crash-expected.txt ('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) 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 196
197 // FIXME: Eventually we'd like to evaluate scripts which are inserted into a 197 // FIXME: Eventually we'd like to evaluate scripts which are inserted into a
198 // viewless document but this'll do for now. 198 // viewless document but this'll do for now.
199 // See http://bugs.webkit.org/show_bug.cgi?id=5727 199 // See http://bugs.webkit.org/show_bug.cgi?id=5727
200 if (!m_element->document()->frame()) 200 if (!m_element->document()->frame())
201 return false; 201 return false;
202 202
203 if (!m_element->document()->frame()->script()->canExecuteScripts(AboutToExec uteScript)) 203 if (!m_element->document()->frame()->script()->canExecuteScripts(AboutToExec uteScript))
204 return false; 204 return false;
205 205
206 // FIXME: This is non-standard. Remove this after https://bugs.webkit.org/sh ow_bug.cgi?id=62412.
207 Node* ancestor = m_element->parentNode();
208 while (ancestor) {
209 if (ancestor->isSVGShadowRoot())
210 return false;
211 ancestor = ancestor->parentNode();
212 }
213
206 if (!isScriptForEventSupported()) 214 if (!isScriptForEventSupported())
207 return false; 215 return false;
208 216
209 if (!charsetAttributeValue().isEmpty()) 217 if (!charsetAttributeValue().isEmpty())
210 m_characterEncoding = charsetAttributeValue(); 218 m_characterEncoding = charsetAttributeValue();
211 else 219 else
212 m_characterEncoding = m_element->document()->charset(); 220 m_characterEncoding = m_element->document()->charset();
213 221
214 if (hasSourceAttribute()) 222 if (hasSourceAttribute())
215 if (!requestScript(sourceAttributeValue())) 223 if (!requestScript(sourceAttributeValue()))
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 377
370 #if ENABLE(SVG) 378 #if ENABLE(SVG)
371 if (element->isSVGElement() && element->hasTagName(SVGNames::scriptTag)) 379 if (element->isSVGElement() && element->hasTagName(SVGNames::scriptTag))
372 return static_cast<SVGScriptElement*>(element); 380 return static_cast<SVGScriptElement*>(element);
373 #endif 381 #endif
374 382
375 return 0; 383 return 0;
376 } 384 }
377 385
378 } 386 }
OLDNEW
« no previous file with comments | « LayoutTests/svg/dom/use-style-recalc-script-execute-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698