Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Issue 1153543002: Make hit testing work in layout2.dart (Closed)

Created:
5 years, 7 months ago by abarth-chromium
Modified:
5 years, 7 months ago
Reviewers:
Hixie, eseidel
CC:
abarth-chromium, gregsimon, mojo-reviews_chromium.org, ojan, qsr+mojo_chromium.org, yzshen+watch_chromium.org
Base URL:
git@github.com:domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Make hit testing work in layout2.dart This CL makes simple_render_tree.dart interactive by making the hit testing system work. I've also added a mechanism for requesting an animation frame. R=eseidel@chromium.org, ianh@google.com Committed: https://chromium.googlesource.com/external/mojo/+/07f20d7a1f3fca9b7006f055dc8c35098266f903

Patch Set 1 #

Patch Set 2 : Add missing file #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -46 lines) Patch
M sky/engine/core/core.gni View 2 chunks +3 lines, -0 lines 0 comments Download
M sky/engine/core/script/dart_controller.cc View 1 chunk +1 line, -1 line 1 comment Download
A sky/engine/core/view/BeginFrameCallback.h View 1 chunk +18 lines, -0 lines 0 comments Download
A + sky/engine/core/view/BeginFrameCallback.idl View 1 chunk +2 lines, -2 lines 0 comments Download
M sky/engine/core/view/View.h View 3 chunks +9 lines, -4 lines 0 comments Download
M sky/engine/core/view/View.cpp View 3 chunks +21 lines, -8 lines 0 comments Download
M sky/engine/core/view/View.idl View 1 chunk +3 lines, -1 line 0 comments Download
M sky/engine/public/sky/sky_view.h View 2 chunks +4 lines, -1 line 0 comments Download
M sky/engine/public/sky/sky_view.cc View 3 chunks +7 lines, -3 lines 0 comments Download
M sky/engine/public/sky/sky_view_client.h View 1 chunk +1 line, -1 line 0 comments Download
M sky/examples/raw/hello_world.dart View 2 chunks +3 lines, -3 lines 0 comments Download
M sky/examples/raw/simple_render_tree.dart View 2 chunks +38 lines, -4 lines 1 comment Download
M sky/sdk/lib/framework/layout2.dart View 1 7 chunks +37 lines, -16 lines 4 comments Download
M sky/shell/ui/engine.h View 1 chunk +1 line, -1 line 0 comments Download
M sky/shell/ui/engine.cc View 2 chunks +4 lines, -1 line 0 comments Download

Messages

Total messages: 5 (1 generated)
abarth-chromium
5 years, 7 months ago (2015-05-21 16:41:15 UTC) #1
eseidel
lgtm red bots. https://codereview.chromium.org/1153543002/diff/20001/sky/engine/core/script/dart_controller.cc File sky/engine/core/script/dart_controller.cc (right): https://codereview.chromium.org/1153543002/diff/20001/sky/engine/core/script/dart_controller.cc#newcode261 sky/engine/core/script/dart_controller.cc:261: const intptr_t port = 8181; // ...
5 years, 7 months ago (2015-05-21 18:06:17 UTC) #3
abarth-chromium
Committed patchset #2 (id:20001) manually as 07f20d7a1f3fca9b7006f055dc8c35098266f903 (presubmit successful).
5 years, 7 months ago (2015-05-21 18:22:22 UTC) #4
Hixie
5 years, 7 months ago (2015-05-21 19:31:42 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/1153543002/diff/20001/sky/examples/raw/simple...
File sky/examples/raw/simple_render_tree.dart (right):

https://codereview.chromium.org/1153543002/diff/20001/sky/examples/raw/simple...
sky/examples/raw/simple_render_tree.dart:37: return false;
This is a rectangle with no holes, so it should always return true.

https://codereview.chromium.org/1153543002/diff/20001/sky/sdk/lib/framework/l...
File sky/sdk/lib/framework/layout2.dart (right):

https://codereview.chromium.org/1153543002/diff/20001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:221: bool handlePointer(sky.PointerEvent
event, { double x: 0.0, double y: 0.0 }) {
Remove the x/y arguments here.

https://codereview.chromium.org/1153543002/diff/20001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:224: }
Add the following (or something like it):

// The parent will call this if the pointer is within the bounds of the child.
For
// RenderBox, the bounds are defined by the height and width; other RenderNode
// subclasses may define this differently.
// If the child does not cover its entire bounds, for example if it has a hole
in
// the middle, then it can decide that the pointer in fact did not hit it, and
// should be propagated to any siblings that are below it in the stack.
// handlePointer() should return true if the pointer hit the child, and false if
// it missed (because the child doesn't cover its entire bounds).
// Note that the return value is _not_ whether the pointer was handled!

Also, add "return true" here. (Or false. I don't know what the right default is.
Probably true.)

https://codereview.chromium.org/1153543002/diff/20001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:701: return super.handlePointer(event, x: x,
y: y);
Render block should always return true, by definition it always covers its
entire bounds.

https://codereview.chromium.org/1153543002/diff/20001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:790: return super.handlePointer(event, x: x,
y: y);
I think ScaffoldBox.handlePointer should always return true (it's always
rectangular with no holes) and should always call super.handlePointer().

ScaffoldBox knows that its children never overlap, so it can just ignore the
return value.

Powered by Google App Engine
This is Rietveld 408576698