diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/html')
7 files changed, 51 insertions, 10 deletions
diff --git a/chromium/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc b/chromium/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc index 98176198d5c..334198dff21 100644 --- a/chromium/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc +++ b/chromium/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc @@ -147,8 +147,6 @@ intptr_t HTMLCanvasElement::global_gpu_memory_usage_ = 0; unsigned HTMLCanvasElement::global_accelerated_context_count_ = 0; HTMLCanvasElement::~HTMLCanvasElement() { - if (surface_layer_bridge_ && surface_layer_bridge_->GetCcLayer()) - GraphicsLayer::UnregisterContentsLayer(surface_layer_bridge_->GetCcLayer()); v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory( -externally_allocated_memory_); } @@ -177,6 +175,19 @@ void HTMLCanvasElement::Dispose() { global_accelerated_context_count_--; } global_gpu_memory_usage_ -= gpu_memory_usage_; + + if (surface_layer_bridge_) { + if (surface_layer_bridge_->GetCcLayer()) { + GraphicsLayer::UnregisterContentsLayer( + surface_layer_bridge_->GetCcLayer()); + } + // Observer has to be cleared out at this point. Otherwise the + // SurfaceLayerBridge may call back into the observer which is undefined + // behavior. In the worst case, the dead canvas element re-adds itself into + // a data structure which may crash at a later point in time. See + // https://crbug.com/976577. + surface_layer_bridge_->ClearObserver(); + } } void HTMLCanvasElement::ParseAttribute( diff --git a/chromium/third_party/blink/renderer/core/html/forms/radio_input_type.cc b/chromium/third_party/blink/renderer/core/html/forms/radio_input_type.cc index 390b142468a..ac8f7326720 100644 --- a/chromium/third_party/blink/renderer/core/html/forms/radio_input_type.cc +++ b/chromium/third_party/blink/renderer/core/html/forms/radio_input_type.cc @@ -155,8 +155,6 @@ void RadioInputType::HandleKeyupEvent(KeyboardEvent& event) { event.key() == "Enter")) { DispatchSimulatedClickIfActive(event); } - - DispatchSimulatedClickIfActive(event); } bool RadioInputType::IsKeyboardFocusable() const { diff --git a/chromium/third_party/blink/renderer/core/html/html_anchor_element.cc b/chromium/third_party/blink/renderer/core/html/html_anchor_element.cc index 94733fedf25..786167ccc30 100644 --- a/chromium/third_party/blink/renderer/core/html/html_anchor_element.cc +++ b/chromium/third_party/blink/renderer/core/html/html_anchor_element.cc @@ -429,8 +429,10 @@ void HTMLAnchorElement::HandleClick(Event& event) { } request.SetRequestContext(mojom::RequestContextType::HYPERLINK); - FrameLoadRequest frame_request(&GetDocument(), request, - getAttribute(kTargetAttr)); + const AtomicString& target = getAttribute(kTargetAttr); + FrameLoadRequest frame_request( + &GetDocument(), request, + target.IsEmpty() ? GetDocument().BaseTarget() : target); frame_request.SetNavigationPolicy(NavigationPolicyFromEvent(&event)); if (HasRel(kRelationNoReferrer)) { frame_request.SetShouldSendReferrer(kNeverSendReferrer); diff --git a/chromium/third_party/blink/renderer/core/html/html_element.cc b/chromium/third_party/blink/renderer/core/html/html_element.cc index 8803bea1c77..8a830c69504 100644 --- a/chromium/third_party/blink/renderer/core/html/html_element.cc +++ b/chromium/third_party/blink/renderer/core/html/html_element.cc @@ -1332,6 +1332,8 @@ bool HTMLElement::MatchesReadWritePseudoClass() const { void HTMLElement::HandleKeypressEvent(KeyboardEvent& event) { if (!IsSpatialNavigationEnabled(GetDocument().GetFrame()) || !SupportsFocus()) return; + if (RuntimeEnabledFeatures::FocuslessSpatialNavigationEnabled()) + return; GetDocument().UpdateStyleAndLayoutTree(); // if the element is a text form control (like <input type=text> or // <textarea>) or has contentEditable attribute on, we should enter a space or diff --git a/chromium/third_party/blink/renderer/core/html/html_frame_owner_element.cc b/chromium/third_party/blink/renderer/core/html/html_frame_owner_element.cc index bfc6b9530d1..9501d2dd946 100644 --- a/chromium/third_party/blink/renderer/core/html/html_frame_owner_element.cc +++ b/chromium/third_party/blink/renderer/core/html/html_frame_owner_element.cc @@ -25,6 +25,7 @@ #include "third_party/blink/renderer/core/css/style_change_reason.h" #include "third_party/blink/renderer/core/dom/events/event.h" #include "third_party/blink/renderer/core/dom/node_computed_style.h" +#include "third_party/blink/renderer/core/events/current_input_event.h" #include "third_party/blink/renderer/core/exported/web_plugin_container_impl.h" #include "third_party/blink/renderer/core/frame/csp/content_security_policy.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" @@ -403,13 +404,12 @@ bool HTMLFrameOwnerElement::LoadOrRedirectSubframe( KURL url_to_request = url.IsNull() ? BlankURL() : url; if (ContentFrame()) { // TODO(sclittle): Support lazily loading frame navigations. + FrameLoadRequest request(&GetDocument(), ResourceRequest(url_to_request)); + request.SetClientRedirectReason(ClientNavigationReason::kFrameNavigation); WebFrameLoadType frame_load_type = WebFrameLoadType::kStandard; if (replace_current_item) frame_load_type = WebFrameLoadType::kReplaceCurrentItem; - - ContentFrame()->ScheduleNavigation(GetDocument(), url_to_request, - frame_load_type, - UserGestureStatus::kNone); + ContentFrame()->Navigate(request, frame_load_type); return true; } diff --git a/chromium/third_party/blink/renderer/core/html/media/html_video_element.cc b/chromium/third_party/blink/renderer/core/html/media/html_video_element.cc index 07f6c2998fa..723c7faf25b 100644 --- a/chromium/third_party/blink/renderer/core/html/media/html_video_element.cc +++ b/chromium/third_party/blink/renderer/core/html/media/html_video_element.cc @@ -402,6 +402,8 @@ void HTMLVideoElement::OnPlay() { return; } + std::unique_ptr<UserGestureIndicator> gesture = + LocalFrame::NotifyUserActivation(GetDocument().GetFrame()); webkitEnterFullscreen(); } diff --git a/chromium/third_party/blink/renderer/core/html/media/video_auto_fullscreen_test.cc b/chromium/third_party/blink/renderer/core/html/media/video_auto_fullscreen_test.cc index c1a36918ec0..749e6a68982 100644 --- a/chromium/third_party/blink/renderer/core/html/media/video_auto_fullscreen_test.cc +++ b/chromium/third_party/blink/renderer/core/html/media/video_auto_fullscreen_test.cc @@ -157,4 +157,30 @@ TEST_F(VideoAutoFullscreen, ExitFullscreenDoesNotPauseWithPlaysInline) { EXPECT_FALSE(Video()->paused()); } +TEST_F(VideoAutoFullscreen, OnPlayTriggersFullscreenWithoutGesture) { + Video()->SetSrc("http://example.com/foo.mp4"); + { + std::unique_ptr<UserGestureIndicator> user_gesture_scope = + LocalFrame::NotifyUserActivation(GetFrame(), + UserGestureToken::kNewGesture); + Video()->Play(); + } + MakeGarbageCollected<WaitForEvent>(Video(), event_type_names::kPlay); + test::RunPendingTasks(); + + EXPECT_TRUE(Video()->IsFullscreen()); + + GetWebView()->ExitFullscreen(*GetFrame()); + test::RunPendingTasks(); + + EXPECT_TRUE(Video()->paused()); + EXPECT_FALSE(Video()->IsFullscreen()); + + Video()->Play(); + test::RunPendingTasks(); + + EXPECT_FALSE(Video()->paused()); + EXPECT_TRUE(Video()->IsFullscreen()); +} + } // namespace blink |