Commit 0cd36b0f authored by vabr's avatar vabr Committed by Commit bot

Revert of Remove FrameView::Root (patchset #2 id:20001 of...

Revert of Remove FrameView::Root (patchset #2 id:20001 of https://codereview.chromium.org/2849383002/ )

Reason for revert:
This broke compilation (details later).

Today's sheriff

Original issue's description:
> Remove FrameView::Root
>
> BUG=637460
>
> Review-Url: https://codereview.chromium.org/2849383002
> Cr-Commit-Position: refs/heads/master@{#468588}
> Committed: https://chromium.googlesource.com/chromium/src/+/561e38ff8dc24f23f0293c54777bbc2eda99a2b5

TBR=haraken@chromium.org,dcheng@chromium.org,joelhockey@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=637460

Review-Url: https://codereview.chromium.org/2857523002
Cr-Commit-Position: refs/heads/master@{#468589}
parent 561e38ff
...@@ -3848,6 +3848,13 @@ void FrameView::RemoveAnimatingScrollableArea(ScrollableArea* scrollable_area) { ...@@ -3848,6 +3848,13 @@ void FrameView::RemoveAnimatingScrollableArea(ScrollableArea* scrollable_area) {
animating_scrollable_areas_->erase(scrollable_area); animating_scrollable_areas_->erase(scrollable_area);
} }
FrameView* FrameView::Root() const {
const FrameView* top = this;
while (top->Parent())
top = ToFrameView(top->Parent());
return const_cast<FrameView*>(top);
}
void FrameView::SetParent(FrameViewBase* parent_frame_view_base) { void FrameView::SetParent(FrameViewBase* parent_frame_view_base) {
FrameView* parent = ToFrameView(parent_frame_view_base); FrameView* parent = ToFrameView(parent_frame_view_base);
if (parent == parent_) if (parent == parent_)
......
...@@ -498,6 +498,7 @@ class CORE_EXPORT FrameView final ...@@ -498,6 +498,7 @@ class CORE_EXPORT FrameView final
void SetSelfVisible(bool v) { self_visible_ = v; } void SetSelfVisible(bool v) { self_visible_ = v; }
void SetParent(FrameViewBase*) override; void SetParent(FrameViewBase*) override;
FrameViewBase* Parent() const override { return parent_; } FrameViewBase* Parent() const override { return parent_; }
FrameView* Root() const;
void RemoveChild(FrameViewBase*); void RemoveChild(FrameViewBase*);
void AddChild(FrameViewBase*); void AddChild(FrameViewBase*);
const ChildrenSet* Children() const { return &children_; } const ChildrenSet* Children() const { return &children_; }
......
...@@ -51,7 +51,7 @@ namespace { ...@@ -51,7 +51,7 @@ namespace {
float FrameScale(const FrameView* frame_view) { float FrameScale(const FrameView* frame_view) {
float scale = 1; float scale = 1;
if (frame_view) { if (frame_view) {
FrameView* root_view = frame_view->GetFrame().LocalFrameRoot()->View(); FrameView* root_view = frame_view->Root();
if (root_view) if (root_view)
scale = root_view->InputEventsScaleFactor(); scale = root_view->InputEventsScaleFactor();
} }
...@@ -64,7 +64,7 @@ FloatPoint FrameTranslation(const FrameView* frame_view) { ...@@ -64,7 +64,7 @@ FloatPoint FrameTranslation(const FrameView* frame_view) {
IntPoint visual_viewport; IntPoint visual_viewport;
FloatSize overscroll_offset; FloatSize overscroll_offset;
if (frame_view) { if (frame_view) {
FrameView* root_view = frame_view->GetFrame().LocalFrameRoot()->View(); FrameView* root_view = frame_view->Root();
if (root_view) { if (root_view) {
scale = root_view->InputEventsScaleFactor(); scale = root_view->InputEventsScaleFactor();
offset = FloatSize(root_view->InputEventsOffsetForEmulation()); offset = FloatSize(root_view->InputEventsOffsetForEmulation());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment