| 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 4511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4522 Event* Document::createEvent(ScriptState* script_state, | 4522 Event* Document::createEvent(ScriptState* script_state, |
| 4523 const String& event_type, | 4523 const String& event_type, |
| 4524 ExceptionState& exception_state) { | 4524 ExceptionState& exception_state) { |
| 4525 Event* event = nullptr; | 4525 Event* event = nullptr; |
| 4526 ExecutionContext* execution_context = script_state->GetExecutionContext(); | 4526 ExecutionContext* execution_context = script_state->GetExecutionContext(); |
| 4527 for (const auto& factory : EventFactories()) { | 4527 for (const auto& factory : EventFactories()) { |
| 4528 event = factory->Create(execution_context, event_type); | 4528 event = factory->Create(execution_context, event_type); |
| 4529 if (event) { | 4529 if (event) { |
| 4530 // createEvent for TouchEvent should throw DOM exception if touch event | 4530 // createEvent for TouchEvent should throw DOM exception if touch event |
| 4531 // feature detection is not enabled. See crbug.com/392584#c22 | 4531 // feature detection is not enabled. See crbug.com/392584#c22 |
| 4532 if (EqualIgnoringCase(event_type, "TouchEvent") && | 4532 if (DeprecatedEqualIgnoringCase(event_type, "TouchEvent") && |
| 4533 !RuntimeEnabledFeatures::touchEventFeatureDetectionEnabled()) | 4533 !RuntimeEnabledFeatures::touchEventFeatureDetectionEnabled()) |
| 4534 break; | 4534 break; |
| 4535 return event; | 4535 return event; |
| 4536 } | 4536 } |
| 4537 } | 4537 } |
| 4538 exception_state.ThrowDOMException( | 4538 exception_state.ThrowDOMException( |
| 4539 kNotSupportedError, | 4539 kNotSupportedError, |
| 4540 "The provided event type ('" + event_type + "') is invalid."); | 4540 "The provided event type ('" + event_type + "') is invalid."); |
| 4541 return nullptr; | 4541 return nullptr; |
| 4542 } | 4542 } |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5137 if (!LoadEventFinished()) | 5137 if (!LoadEventFinished()) |
| 5138 return KURL(); | 5138 return KURL(); |
| 5139 | 5139 |
| 5140 if (!head()) | 5140 if (!head()) |
| 5141 return KURL(); | 5141 return KURL(); |
| 5142 | 5142 |
| 5143 for (HTMLLinkElement* link_element = | 5143 for (HTMLLinkElement* link_element = |
| 5144 Traversal<HTMLLinkElement>::FirstChild(*head()); | 5144 Traversal<HTMLLinkElement>::FirstChild(*head()); |
| 5145 link_element; | 5145 link_element; |
| 5146 link_element = Traversal<HTMLLinkElement>::NextSibling(*link_element)) { | 5146 link_element = Traversal<HTMLLinkElement>::NextSibling(*link_element)) { |
| 5147 if (!EqualIgnoringCase(link_element->GetType(), kOpenSearchMIMEType) || | 5147 if (!DeprecatedEqualIgnoringCase(link_element->GetType(), |
| 5148 !EqualIgnoringCase(link_element->Rel(), kOpenSearchRelation)) | 5148 kOpenSearchMIMEType) || |
| 5149 !DeprecatedEqualIgnoringCase(link_element->Rel(), kOpenSearchRelation)) |
| 5149 continue; | 5150 continue; |
| 5150 if (link_element->Href().IsEmpty()) | 5151 if (link_element->Href().IsEmpty()) |
| 5151 continue; | 5152 continue; |
| 5152 | 5153 |
| 5153 // Count usage; perhaps we can lock this to secure contexts. | 5154 // Count usage; perhaps we can lock this to secure contexts. |
| 5154 UseCounter::Feature osd_disposition; | 5155 UseCounter::Feature osd_disposition; |
| 5155 RefPtr<SecurityOrigin> target = | 5156 RefPtr<SecurityOrigin> target = |
| 5156 SecurityOrigin::Create(link_element->Href()); | 5157 SecurityOrigin::Create(link_element->Href()); |
| 5157 if (IsSecureContext()) { | 5158 if (IsSecureContext()) { |
| 5158 osd_disposition = target->IsPotentiallyTrustworthy() | 5159 osd_disposition = target->IsPotentiallyTrustworthy() |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5191 void Document::SetTransformSource(std::unique_ptr<TransformSource> source) { | 5192 void Document::SetTransformSource(std::unique_ptr<TransformSource> source) { |
| 5192 transform_source_ = std::move(source); | 5193 transform_source_ = std::move(source); |
| 5193 } | 5194 } |
| 5194 | 5195 |
| 5195 String Document::designMode() const { | 5196 String Document::designMode() const { |
| 5196 return InDesignMode() ? "on" : "off"; | 5197 return InDesignMode() ? "on" : "off"; |
| 5197 } | 5198 } |
| 5198 | 5199 |
| 5199 void Document::setDesignMode(const String& value) { | 5200 void Document::setDesignMode(const String& value) { |
| 5200 bool new_value = design_mode_; | 5201 bool new_value = design_mode_; |
| 5201 if (EqualIgnoringCase(value, "on")) { | 5202 if (DeprecatedEqualIgnoringCase(value, "on")) { |
| 5202 new_value = true; | 5203 new_value = true; |
| 5203 UseCounter::Count(*this, UseCounter::kDocumentDesignModeEnabeld); | 5204 UseCounter::Count(*this, UseCounter::kDocumentDesignModeEnabeld); |
| 5204 } else if (EqualIgnoringCase(value, "off")) { | 5205 } else if (DeprecatedEqualIgnoringCase(value, "off")) { |
| 5205 new_value = false; | 5206 new_value = false; |
| 5206 } | 5207 } |
| 5207 if (new_value == design_mode_) | 5208 if (new_value == design_mode_) |
| 5208 return; | 5209 return; |
| 5209 design_mode_ = new_value; | 5210 design_mode_ = new_value; |
| 5210 SetNeedsStyleRecalc(kSubtreeStyleChange, StyleChangeReasonForTracing::Create( | 5211 SetNeedsStyleRecalc(kSubtreeStyleChange, StyleChangeReasonForTracing::Create( |
| 5211 StyleChangeReason::kDesignMode)); | 5212 StyleChangeReason::kDesignMode)); |
| 5212 } | 5213 } |
| 5213 | 5214 |
| 5214 Document* Document::ParentDocument() const { | 5215 Document* Document::ParentDocument() const { |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5462 return icon_ur_ls; | 5463 return icon_ur_ls; |
| 5463 } | 5464 } |
| 5464 | 5465 |
| 5465 Color Document::ThemeColor() const { | 5466 Color Document::ThemeColor() const { |
| 5466 auto root_element = documentElement(); | 5467 auto root_element = documentElement(); |
| 5467 if (!root_element) | 5468 if (!root_element) |
| 5468 return Color(); | 5469 return Color(); |
| 5469 for (HTMLMetaElement& meta_element : | 5470 for (HTMLMetaElement& meta_element : |
| 5470 Traversal<HTMLMetaElement>::DescendantsOf(*root_element)) { | 5471 Traversal<HTMLMetaElement>::DescendantsOf(*root_element)) { |
| 5471 Color color = Color::kTransparent; | 5472 Color color = Color::kTransparent; |
| 5472 if (EqualIgnoringCase(meta_element.GetName(), "theme-color") && | 5473 if (DeprecatedEqualIgnoringCase(meta_element.GetName(), "theme-color") && |
| 5473 CSSParser::ParseColor( | 5474 CSSParser::ParseColor( |
| 5474 color, meta_element.Content().GetString().StripWhiteSpace(), true)) | 5475 color, meta_element.Content().GetString().StripWhiteSpace(), true)) |
| 5475 return color; | 5476 return color; |
| 5476 } | 5477 } |
| 5477 return Color(); | 5478 return Color(); |
| 5478 } | 5479 } |
| 5479 | 5480 |
| 5480 HTMLLinkElement* Document::LinkManifest() const { | 5481 HTMLLinkElement* Document::LinkManifest() const { |
| 5481 HTMLHeadElement* head = this->head(); | 5482 HTMLHeadElement* head = this->head(); |
| 5482 if (!head) | 5483 if (!head) |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5788 | 5789 |
| 5789 // Inherit DNS prefetch opt-out from parent frame | 5790 // Inherit DNS prefetch opt-out from parent frame |
| 5790 if (Document* parent = ParentDocument()) { | 5791 if (Document* parent = ParentDocument()) { |
| 5791 if (!parent->IsDNSPrefetchEnabled()) | 5792 if (!parent->IsDNSPrefetchEnabled()) |
| 5792 is_dns_prefetch_enabled_ = false; | 5793 is_dns_prefetch_enabled_ = false; |
| 5793 } | 5794 } |
| 5794 } | 5795 } |
| 5795 | 5796 |
| 5796 void Document::ParseDNSPrefetchControlHeader( | 5797 void Document::ParseDNSPrefetchControlHeader( |
| 5797 const String& dns_prefetch_control) { | 5798 const String& dns_prefetch_control) { |
| 5798 if (EqualIgnoringCase(dns_prefetch_control, "on") && | 5799 if (DeprecatedEqualIgnoringCase(dns_prefetch_control, "on") && |
| 5799 !have_explicitly_disabled_dns_prefetch_) { | 5800 !have_explicitly_disabled_dns_prefetch_) { |
| 5800 is_dns_prefetch_enabled_ = true; | 5801 is_dns_prefetch_enabled_ = true; |
| 5801 return; | 5802 return; |
| 5802 } | 5803 } |
| 5803 | 5804 |
| 5804 is_dns_prefetch_enabled_ = false; | 5805 is_dns_prefetch_enabled_ = false; |
| 5805 have_explicitly_disabled_dns_prefetch_ = true; | 5806 have_explicitly_disabled_dns_prefetch_ = true; |
| 5806 } | 5807 } |
| 5807 | 5808 |
| 5808 IntersectionObserverController* Document::GetIntersectionObserverController() { | 5809 IntersectionObserverController* Document::GetIntersectionObserverController() { |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6663 } | 6664 } |
| 6664 | 6665 |
| 6665 void showLiveDocumentInstances() { | 6666 void showLiveDocumentInstances() { |
| 6666 WeakDocumentSet& set = liveDocumentSet(); | 6667 WeakDocumentSet& set = liveDocumentSet(); |
| 6667 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6668 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6668 for (blink::Document* document : set) | 6669 for (blink::Document* document : set) |
| 6669 fprintf(stderr, "- Document %p URL: %s\n", document, | 6670 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6670 document->Url().GetString().Utf8().Data()); | 6671 document->Url().GetString().Utf8().Data()); |
| 6671 } | 6672 } |
| 6672 #endif | 6673 #endif |
| OLD | NEW |