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 5095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5106 const KURL& about_blank_url = BlankURL(); | 5106 const KURL& about_blank_url = BlankURL(); |
5107 should_use_parent_base_url = (base_url_override == about_blank_url); | 5107 should_use_parent_base_url = (base_url_override == about_blank_url); |
5108 } | 5108 } |
5109 if (should_use_parent_base_url) { | 5109 if (should_use_parent_base_url) { |
5110 if (Document* parent = ParentDocument()) | 5110 if (Document* parent = ParentDocument()) |
5111 base_url_from_parent = &parent->BaseURL(); | 5111 base_url_from_parent = &parent->BaseURL(); |
5112 } | 5112 } |
5113 return base_url_from_parent ? *base_url_from_parent : base_url_override; | 5113 return base_url_from_parent ? *base_url_from_parent : base_url_override; |
5114 } | 5114 } |
5115 | 5115 |
| 5116 // static |
| 5117 bool Document::ShouldInheritSecurityOriginFromOwner(const KURL& url) { |
| 5118 // https://html.spec.whatwg.org/multipage/browsers.html#origin |
| 5119 // |
| 5120 // If a Document is the initial "about:blank" document The origin and |
| 5121 // effective script origin of the Document are those it was assigned when its |
| 5122 // browsing context was created. |
| 5123 // |
| 5124 // Note: We generalize this to all "blank" URLs and invalid URLs because we |
| 5125 // treat all of these URLs as about:blank. |
| 5126 return url.IsEmpty() || url.ProtocolIsAbout(); |
| 5127 } |
| 5128 |
5116 KURL Document::OpenSearchDescriptionURL() { | 5129 KURL Document::OpenSearchDescriptionURL() { |
5117 static const char kOpenSearchMIMEType[] = | 5130 static const char kOpenSearchMIMEType[] = |
5118 "application/opensearchdescription+xml"; | 5131 "application/opensearchdescription+xml"; |
5119 static const char kOpenSearchRelation[] = "search"; | 5132 static const char kOpenSearchRelation[] = "search"; |
5120 | 5133 |
5121 // FIXME: Why do only top-level frames have openSearchDescriptionURLs? | 5134 // FIXME: Why do only top-level frames have openSearchDescriptionURLs? |
5122 if (!GetFrame() || GetFrame()->Tree().Parent()) | 5135 if (!GetFrame() || GetFrame()->Tree().Parent()) |
5123 return KURL(); | 5136 return KURL(); |
5124 | 5137 |
5125 // FIXME: Why do we need to wait for load completion? | 5138 // FIXME: Why do we need to wait for load completion? |
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6645 } | 6658 } |
6646 | 6659 |
6647 void showLiveDocumentInstances() { | 6660 void showLiveDocumentInstances() { |
6648 WeakDocumentSet& set = liveDocumentSet(); | 6661 WeakDocumentSet& set = liveDocumentSet(); |
6649 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6662 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6650 for (blink::Document* document : set) | 6663 for (blink::Document* document : set) |
6651 fprintf(stderr, "- Document %p URL: %s\n", document, | 6664 fprintf(stderr, "- Document %p URL: %s\n", document, |
6652 document->Url().GetString().Utf8().Data()); | 6665 document->Url().GetString().Utf8().Data()); |
6653 } | 6666 } |
6654 #endif | 6667 #endif |
OLD | NEW |