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 5105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5116 const KURL& about_blank_url = BlankURL(); | 5116 const KURL& about_blank_url = BlankURL(); |
5117 should_use_parent_base_url = (base_url_override == about_blank_url); | 5117 should_use_parent_base_url = (base_url_override == about_blank_url); |
5118 } | 5118 } |
5119 if (should_use_parent_base_url) { | 5119 if (should_use_parent_base_url) { |
5120 if (Document* parent = ParentDocument()) | 5120 if (Document* parent = ParentDocument()) |
5121 base_url_from_parent = &parent->BaseURL(); | 5121 base_url_from_parent = &parent->BaseURL(); |
5122 } | 5122 } |
5123 return base_url_from_parent ? *base_url_from_parent : base_url_override; | 5123 return base_url_from_parent ? *base_url_from_parent : base_url_override; |
5124 } | 5124 } |
5125 | 5125 |
5126 // static | |
5127 bool Document::ShouldInheritSecurityOriginFromOwner(const KURL& url) { | |
5128 // https://html.spec.whatwg.org/multipage/browsers.html#origin | |
5129 // | |
5130 // If a Document is the initial "about:blank" document The origin and | |
lunalu1
2017/04/13 20:54:04
nit: s/The/, the
| |
5131 // effective script origin of the Document are those it was assigned when its | |
5132 // browsing context was created. | |
5133 // | |
5134 // Note: We generalize this to all "blank" URLs and invalid URLs because we | |
5135 // treat all of these URLs as about:blank. | |
5136 return url.IsEmpty() || url.ProtocolIsAbout(); | |
5137 } | |
5138 | |
5126 KURL Document::OpenSearchDescriptionURL() { | 5139 KURL Document::OpenSearchDescriptionURL() { |
5127 static const char kOpenSearchMIMEType[] = | 5140 static const char kOpenSearchMIMEType[] = |
5128 "application/opensearchdescription+xml"; | 5141 "application/opensearchdescription+xml"; |
5129 static const char kOpenSearchRelation[] = "search"; | 5142 static const char kOpenSearchRelation[] = "search"; |
5130 | 5143 |
5131 // FIXME: Why do only top-level frames have openSearchDescriptionURLs? | 5144 // FIXME: Why do only top-level frames have openSearchDescriptionURLs? |
5132 if (!GetFrame() || GetFrame()->Tree().Parent()) | 5145 if (!GetFrame() || GetFrame()->Tree().Parent()) |
5133 return KURL(); | 5146 return KURL(); |
5134 | 5147 |
5135 // FIXME: Why do we need to wait for load completion? | 5148 // FIXME: Why do we need to wait for load completion? |
(...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6660 } | 6673 } |
6661 | 6674 |
6662 void showLiveDocumentInstances() { | 6675 void showLiveDocumentInstances() { |
6663 WeakDocumentSet& set = liveDocumentSet(); | 6676 WeakDocumentSet& set = liveDocumentSet(); |
6664 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6677 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6665 for (blink::Document* document : set) | 6678 for (blink::Document* document : set) |
6666 fprintf(stderr, "- Document %p URL: %s\n", document, | 6679 fprintf(stderr, "- Document %p URL: %s\n", document, |
6667 document->Url().GetString().Utf8().Data()); | 6680 document->Url().GetString().Utf8().Data()); |
6668 } | 6681 } |
6669 #endif | 6682 #endif |
OLD | NEW |