| 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 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| (...skipping 5375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5386 | 5386 |
| 5387 bool Document::isSecureTransitionTo(const KURL& url) const { | 5387 bool Document::isSecureTransitionTo(const KURL& url) const { |
| 5388 RefPtr<SecurityOrigin> other = SecurityOrigin::create(url); | 5388 RefPtr<SecurityOrigin> other = SecurityOrigin::create(url); |
| 5389 return getSecurityOrigin()->canAccess(other.get()); | 5389 return getSecurityOrigin()->canAccess(other.get()); |
| 5390 } | 5390 } |
| 5391 | 5391 |
| 5392 bool Document::allowInlineEventHandler(Node* node, | 5392 bool Document::allowInlineEventHandler(Node* node, |
| 5393 EventListener* listener, | 5393 EventListener* listener, |
| 5394 const String& contextURL, | 5394 const String& contextURL, |
| 5395 const WTF::OrdinalNumber& contextLine) { | 5395 const WTF::OrdinalNumber& contextLine) { |
| 5396 Element* element = node && node->isElementNode() ? toElement(node) : nullptr; |
| 5396 if (!ContentSecurityPolicy::shouldBypassMainWorld(this) && | 5397 if (!ContentSecurityPolicy::shouldBypassMainWorld(this) && |
| 5397 !contentSecurityPolicy()->allowInlineEventHandler( | 5398 !contentSecurityPolicy()->allowInlineEventHandler( |
| 5398 listener->code(), contextURL, contextLine)) | 5399 element, listener->code(), contextURL, contextLine)) |
| 5399 return false; | 5400 return false; |
| 5400 | 5401 |
| 5401 // HTML says that inline script needs browsing context to create its execution | 5402 // HTML says that inline script needs browsing context to create its execution |
| 5402 // environment. | 5403 // environment. |
| 5403 // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html
#event-handler-attributes | 5404 // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html
#event-handler-attributes |
| 5404 // Also, if the listening node came from other document, which happens on | 5405 // Also, if the listening node came from other document, which happens on |
| 5405 // context-less event dispatching, we also need to ask the owner document of | 5406 // context-less event dispatching, we also need to ask the owner document of |
| 5406 // the node. | 5407 // the node. |
| 5407 LocalFrame* frame = executingFrame(); | 5408 LocalFrame* frame = executingFrame(); |
| 5408 if (!frame) | 5409 if (!frame) |
| (...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6400 } | 6401 } |
| 6401 | 6402 |
| 6402 void showLiveDocumentInstances() { | 6403 void showLiveDocumentInstances() { |
| 6403 WeakDocumentSet& set = liveDocumentSet(); | 6404 WeakDocumentSet& set = liveDocumentSet(); |
| 6404 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6405 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6405 for (Document* document : set) | 6406 for (Document* document : set) |
| 6406 fprintf(stderr, "- Document %p URL: %s\n", document, | 6407 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6407 document->url().getString().utf8().data()); | 6408 document->url().getString().utf8().data()); |
| 6408 } | 6409 } |
| 6409 #endif | 6410 #endif |
| OLD | NEW |