Skip to content

Commit

Permalink
Remove LocalFrameView::UpdateCompositedSelectionIfNeeded
Browse files Browse the repository at this point in the history
With the launch of CompositeAfterPaint, this function is no longer
used. Selection is now updated via PaintArtifactCompositor.

Bug: 1277748
Change-Id: Id16b3c38f913354e009f58d43a67ff811682f0c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3331496
Auto-Submit: Philip Rogers <pdr@chromium.org>
Reviewed-by: Daniel Libby <dlibby@microsoft.com>
Commit-Queue: Daniel Libby <dlibby@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#951077}
  • Loading branch information
progers authored and Chromium LUCI CQ committed Dec 13, 2021
1 parent 04e80d4 commit 3e99b5b
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 375 deletions.
1 change: 0 additions & 1 deletion third_party/blink/public/web/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ include_rules = [
"+cc/input/browser_controls_state.h",
"+cc/input/event_listener_properties.h",
"+cc/input/overscroll_behavior.h",
"+cc/input/layer_selection_bound.h",
"+cc/layers/layer.h",
"+cc/metrics/begin_main_frame_metrics.h",
"+cc/paint/element_id.h",
Expand Down
1 change: 0 additions & 1 deletion third_party/blink/renderer/core/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ include_rules = [
"+cc/base/region.h",
"+cc/input/browser_controls_state.h",
"+cc/input/event_listener_properties.h",
"+cc/input/layer_selection_bound.h",
"+cc/input/main_thread_scrolling_reason.h",
"+cc/input/overscroll_behavior.h",
"+cc/input/scroll_utils.h",
Expand Down
2 changes: 0 additions & 2 deletions third_party/blink/renderer/core/editing/build.gni
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ blink_core_sources_editing = [
"commands/unlink_command.h",
"commands/wrap_contents_in_dummy_span_command.cc",
"commands/wrap_contents_in_dummy_span_command.h",
"compute_layer_selection.cc",
"compute_layer_selection.h",
"dom_selection.cc",
"dom_selection.h",
"drag_caret.cc",
Expand Down
240 changes: 0 additions & 240 deletions third_party/blink/renderer/core/editing/compute_layer_selection.cc

This file was deleted.

47 changes: 0 additions & 47 deletions third_party/blink/renderer/core/editing/compute_layer_selection.h

This file was deleted.

50 changes: 0 additions & 50 deletions third_party/blink/renderer/core/frame/local_frame_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
#include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h"
#include "third_party/blink/renderer/core/document_transition/document_transition_supplement.h"
#include "third_party/blink/renderer/core/dom/static_node_list.h"
#include "third_party/blink/renderer/core/editing/compute_layer_selection.h"
#include "third_party/blink/renderer/core/editing/drag_caret.h"
#include "third_party/blink/renderer/core/editing/frame_selection.h"
#include "third_party/blink/renderer/core/editing/markers/document_marker_controller.h"
Expand Down Expand Up @@ -1396,53 +1395,6 @@ void LocalFrameView::SetLayoutSizeFixedToFrameSize(bool is_fixed) {
SetLayoutSizeInternal(Size());
}

static cc::LayerSelection ComputeLayerSelection(LocalFrame& frame) {
if (!frame.View() || frame.View()->ShouldThrottleRendering())
return {};

return ComputeLayerSelection(frame.Selection());
}

void LocalFrameView::UpdateCompositedSelectionIfNeeded() {
if (!RuntimeEnabledFeatures::CompositedSelectionUpdateEnabled())
return;

if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled())
return;

TRACE_EVENT0("blink", "LocalFrameView::updateCompositedSelectionIfNeeded");

Page* page = GetFrame().GetPage();
DCHECK(page);

LocalFrame* focused_frame = page->GetFocusController().FocusedFrame();
LocalFrame* local_frame =
(focused_frame &&
(focused_frame->LocalFrameRoot() == frame_->LocalFrameRoot()))
? focused_frame
: nullptr;

if (local_frame) {
const cc::LayerSelection& selection = ComputeLayerSelection(*local_frame);
if (selection != cc::LayerSelection()) {
page->GetChromeClient().UpdateLayerSelection(local_frame, selection);
return;
}
}

if (!local_frame) {
// Clearing the mainframe when there is no focused frame (and hence
// no localFrame) is legacy behaviour, and implemented here to
// satisfy WebFrameTest.CompositedSelectionBoundsCleared's
// first check that the composited selection has been cleared even
// though no frame has focus yet. If this is not desired, then the
// expectation needs to be removed from the test.
local_frame = &frame_->LocalFrameRoot();
}
DCHECK(local_frame);
page->GetChromeClient().ClearLayerSelection(local_frame);
}

void LocalFrameView::SetNeedsCompositingUpdate(
CompositingUpdateType update_type) {
if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled())
Expand Down Expand Up @@ -2687,8 +2639,6 @@ bool LocalFrameView::RunCompositingAssignmentsLifecyclePhase(
});
}

UpdateCompositedSelectionIfNeeded();

frame_->GetPage()->GetValidationMessageClient().UpdatePrePaint();
ForAllNonThrottledLocalFrameViews([](LocalFrameView& view) {
view.frame_->UpdateFrameColorOverlayPrePaint();
Expand Down
1 change: 0 additions & 1 deletion third_party/blink/renderer/core/frame/local_frame_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,6 @@ class CORE_EXPORT LocalFrameView final
void UpdatePluginsTimerFired(TimerBase*);
bool UpdatePlugins();

void UpdateCompositedSelectionIfNeeded();
void SetNeedsCompositingUpdate(CompositingUpdateType);

AXObjectCache* ExistingAXObjectCache() const;
Expand Down
Loading

0 comments on commit 3e99b5b

Please sign in to comment.