OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/loader/HttpEquiv.h" | 5 #include "core/loader/HttpEquiv.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/dom/StyleEngine.h" | 8 #include "core/dom/StyleEngine.h" |
9 #include "core/dom/Suborigin.h" | 9 #include "core/dom/Suborigin.h" |
10 #include "core/fetch/ClientHintsPreferences.h" | 10 #include "core/fetch/ClientHintsPreferences.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 { | 62 { |
63 if (!document.frame()) | 63 if (!document.frame()) |
64 return; | 64 return; |
65 | 65 |
66 UseCounter::count(document, UseCounter::ClientHintsMetaAcceptCH); | 66 UseCounter::count(document, UseCounter::ClientHintsMetaAcceptCH); |
67 document.clientHintsPreferences().updateFromAcceptClientHintsHeader(content,
document.fetcher()); | 67 document.clientHintsPreferences().updateFromAcceptClientHintsHeader(content,
document.fetcher()); |
68 } | 68 } |
69 | 69 |
70 void HttpEquiv::processHttpEquivDefaultStyle(Document& document, const AtomicStr
ing& content) | 70 void HttpEquiv::processHttpEquivDefaultStyle(Document& document, const AtomicStr
ing& content) |
71 { | 71 { |
72 // The preferred style set has been overridden as per section | 72 document.styleEngine().setHttpDefaultStyle(content); |
73 // 14.3.2 of the HTML4.0 specification. We need to update the | |
74 // sheet used variable and then update our style selector. | |
75 // For more info, see the test at: | |
76 // http://www.hixie.ch/tests/evil/css/import/main/preferred.html | |
77 // -dwh | |
78 document.styleEngine().setSelectedStylesheetSetName(content); | |
79 document.styleEngine().setPreferredStylesheetSetName(content); | |
80 document.styleEngine().resolverChanged(FullStyleUpdate); | |
81 } | 73 } |
82 | 74 |
83 void HttpEquiv::processHttpEquivRefresh(Document& document, const AtomicString&
content) | 75 void HttpEquiv::processHttpEquivRefresh(Document& document, const AtomicString&
content) |
84 { | 76 { |
85 document.maybeHandleHttpRefresh(content, Document::HttpRefreshFromMetaTag); | 77 document.maybeHandleHttpRefresh(content, Document::HttpRefreshFromMetaTag); |
86 } | 78 } |
87 | 79 |
88 void HttpEquiv::processHttpEquivSetCookie(Document& document, const AtomicString
& content) | 80 void HttpEquiv::processHttpEquivSetCookie(Document& document, const AtomicString
& content) |
89 { | 81 { |
90 // FIXME: make setCookie work on XML documents too; e.g. in case of <html:me
ta .....> | 82 // FIXME: make setCookie work on XML documents too; e.g. in case of <html:me
ta .....> |
(...skipping 22 matching lines...) Expand all Loading... |
113 frame->loader().stopAllLoaders(); | 105 frame->loader().stopAllLoaders(); |
114 // Stopping the loader isn't enough, as we're already parsing the document;
to honor the header's | 106 // Stopping the loader isn't enough, as we're already parsing the document;
to honor the header's |
115 // intent, we must navigate away from the possibly partially-rendered docume
nt to a location that | 107 // intent, we must navigate away from the possibly partially-rendered docume
nt to a location that |
116 // doesn't inherit the parent's SecurityOrigin. | 108 // doesn't inherit the parent's SecurityOrigin. |
117 // TODO(dglazkov): This should probably check document lifecycle instead. | 109 // TODO(dglazkov): This should probably check document lifecycle instead. |
118 if (document.frame()) | 110 if (document.frame()) |
119 frame->navigate(document, SecurityOrigin::urlWithUniqueSecurityOrigin(),
true, UserGestureStatus::None); | 111 frame->navigate(document, SecurityOrigin::urlWithUniqueSecurityOrigin(),
true, UserGestureStatus::None); |
120 } | 112 } |
121 | 113 |
122 } // namespace blink | 114 } // namespace blink |
OLD | NEW |