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

Unified Diff: sky/specs/style.md

Issue 727993002: Specs: hit testing (and some cleanup) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/examples/style/toolbar-layout.sky ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/specs/style.md
diff --git a/sky/specs/style.md b/sky/specs/style.md
index 96ff3af880b54b48a75a9856dd19a42537ed005b..2f87160174b54a275d6fed23095fa5c141d84490 100644
--- a/sky/specs/style.md
+++ b/sky/specs/style.md
@@ -410,16 +410,10 @@ Layout managers inherit from the following API:
// as provisional, clear them
Generator<StyleNode> walkChildren();
- // returns a generator that iterates over the children, skipping any whose ownerLayoutManager is not this
+ // returns a generator that iterates over the children, skipping any whose ownerLayoutManager is not |this|
- void paint(RenderingSurface canvas);
- // set a clip rect on the canvas
- // call the painter of each property, in order they were registered, which on this element has a painter
- // call this.paintChildren()
- // unset the clip
-
- virtual void paintChildren(RenderingSurface canvas);
- // just calls paint() for each child returned by walkChildren() whose needsPaint is true
+ Generator<StyleNode> walkChildrenBackwards();
+ // returns a generator that iterates over the children backwards, skipping any whose ownerLayoutManager is not |this|
void assumeDimensions(Float width, Float height);
// sets the assumed dimensions for calls to getProperty() on StyleNodes that have this as an ownerLayoutManager
@@ -441,6 +435,25 @@ Layout managers inherit from the following API:
// the return value should include the final value for whichever of the width and height arguments that is null
// TODO(ianh): should we just grab the width and height from assumeDimensions()?
+ void paint(RenderingSurface canvas);
+ // set a clip rect on the canvas
+ // call the painter of each property, in order they were registered, which on this element has a painter
+ // call this.paintChildren()
+ // unset the clip
+
+ virtual void paintChildren(RenderingSurface canvas);
+ // just calls paint() for each child returned by walkChildren() whose needsPaint is true
+
+ virtual Node hitTest(Float x, Float y);
+ // default implementation uses the node's children nodes' x, y,
+ // width, and height, skipping any that have width=0 or height=0, or
+ // whose ownerLayoutManager is not |this|
+ // default implementation walks the tree backwards from its built-in order
+ // if no child is hit, then return this.node
+ // override this if you changed your children's z-order, or if you used take() to
+ // hoist some descendants up to be your responsibility, or if your children aren't
+ // rectangular (e.g. you lay them out in a hex grid)
+
}
dictionary LayoutValueRange {
« no previous file with comments | « sky/examples/style/toolbar-layout.sky ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698