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

Unified Diff: sky/specs/style.md

Issue 787603005: Specs: Make pointer events go up the LayoutManager chain too; improve how you make custom event tar… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years 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/specs/apis.md ('k') | sky/specs/ui.md » ('j') | 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 32161cfc7b5dbc922eaeefd18d329f51b9f5b0b8..87e95947b6666b58b3c7c281efa365a9eff3edfc 100644
--- a/sky/specs/style.md
+++ b/sky/specs/style.md
@@ -281,7 +281,9 @@ class StyleDeclarationList {
Array<StyleDeclaration> getDeclarations(String? pseudoElement = null); // O(N) in number of declarations
}
-typedef StyleDeclaration Dictionary<ParsedValue>;
+class StyleDeclaration {
+ // TODO(ianh): define this
+}
```
Rule Matching
@@ -347,7 +349,7 @@ partial class Element {
callback any ValueResolver (any value, String propertyName, StyleNode node, Float containerWidth, Float containerHeight);
-class StyleNode {
+class StyleNode { // implemented in C++ with no virtual tables
// this is generated before layout
readonly attribute String text;
readonly attribute Node? parentNode;
@@ -434,10 +436,19 @@ sky:core by default registers:
Layout managers inherit from the following API:
```javascript
-class LayoutManager {
+class LayoutManager : EventTarget {
readonly attribute StyleNode node;
constructor LayoutManager(StyleNode node);
+ virtual Array<EventTarget> getEventDispatchChain(); // O(N) in number of this.node's ancestors // implements EventTarget.getEventDispatchChain()
+ // let result = [];
+ // let node = this.node;
+ // while (node && node.layoutManager) {
+ // result.push(node.layoutManager);
+ // node = node.parentNode;
+ // }
+ // return result;
+
void take(StyleNode victim); // sets victim.ownerLayoutManager = this;
// assert: victim hasn't been take()n yet during this layout
// assert: victim.needsLayout == true
@@ -565,7 +576,7 @@ class LayoutManager {
// that you don't skip the children that are visible in the new coordinate space but wouldn't be
// without the transform
- virtual Node hitTest(Float x, Float y);
+ virtual StyleNode 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|
« no previous file with comments | « sky/specs/apis.md ('k') | sky/specs/ui.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698