Git Product home page Git Product logo

css-houdini-drafts's Introduction

This is the repository containing the CSS/TAG Houdini Task Force specifications. For an overview of current status, see Is Houdini Ready Yet?

In addition to this git repository, a Mercurial mirror is maintained at https://hg.css-houdini.org/drafts, if for whatever reason you prefer Mercurial.

Specification issues are raised and discussed in GitHub Issues in this repository.

We also maintain the public-houdini mailing list for general-interest topics.

New specifications are generally first incubated in the WICG, in particular:

Tests

For normative changes, a corresponding web-platform-tests PR is highly appreciated. Typically, both PRs will be merged at the same time. Note that a test change that contradicts the spec should not be merged before the corresponding spec change. If testing is not practical, please explain why and if appropriate file an issue to follow up later. Add the type:untestable or type:missing-coverage label as appropriate.

css-houdini-drafts's People

Contributors

andruud avatar appsforartists avatar astearns avatar autokagami avatar bfgeek avatar darrnshn avatar dbaron avatar dholbert avatar fantasai avatar flackr avatar foolip avatar heycam avatar ianvollick avatar majido avatar nainar avatar nhiroki avatar plehegar avatar plinss avatar rbyers avatar rjwright avatar saschanaz avatar shans avatar stephenmcgruer avatar surma avatar svgeesus avatar tabatkins avatar wilddamon avatar xidachen avatar yoavweiss avatar zcorpan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

css-houdini-drafts's Issues

[css-properties-values] Apply hook triggering new style resolution?

During last meeting, Tab told that to accomodate changes made in the ApplyHook of css-propvals, a new round of style computation and resolution would happen to fix anything that would not be computed-compatible added by the hook.

To me, this means we've made something which is not a primitive of the web browser, but a new feature that will add more complexity to the system.

I propose we mark the ApplyHook as at-risk until we develop a ComputedStyle TypedOM and restrict the value of properties set in the ApplyHook to those values, in order to avoid any style recalc after this step.

Possible mistake in example 1

 #myElement {
    --circle-color: red;
    background-image: paint(circle);
}

Shouldn't this be paint(var(--circle-color))?

[css-properties-values-api] Apply hook limits use of custom property value on the same element

This was in the spec initially as a problem so I'm converting it to an issue so I can pull it out of the spec.

The apply model means that you can't have two custom properties that apply to the same used values coexisting on the same element. This is especially important to point out since our expectation is for these APIs to be utilized by libs and authors may not be aware of the conflicts.

registerProperty({
  name: '--layout',
  syntax: '<string>',
  inherit: false,
  initialValue: 'none',
  apply: function(used, value) {
    if (value == 'grid') {
        used.width = '500px';
    }
  }
});
registerProperty({
  name: '--extraBorder',
  syntax: '<length>',
  inherit: false,
  initialValue: '0px',
  apply: function(used, value) {
    used.width += value;
  }
});

[scrolling] Examples of interesting Scroll Effects

As part of understanding what we need for Compositing/UI Workers/Scroll API, it would be good to list the types of effects we're planning to enable. Rick and Ian have already mentioned:

  • pull to refresh
  • rubber banding
  • hidey bars
  • sticky positioning
  • scroll snap points
  • parallax

Some real work examples that are pretty interesting are:

What are others?

Add some additional types to specification.

  "<length-and-percentage>" (accepts "50px", "50%" and "calc(50px + 50%)")
  "<ident>" (any custom identifier)
  "<ident>(auto, none)" (a list of possible idents which the property does accept)
  "*" (any input, much like a unregistered custom property)

[isolated-workers] Specify what happens when a script in an isolated worker throws an error.

We need to be ability to report this error to a monitoring server or similar.

There should be an "onerror" handler on the main script handle for the worker(s).

For example:

// IsolatedWorkerGlobalScope
throw new Error('hi!');
// main execution context.
window.paintWorker.addEventListener('error', function(event) {
  // Do something with the error here. Report to a monitoring server or similar.
});

[css-paint-api] Create PaintRenderingContext2D which is a subset of the CanvasRenderingContext2D.

We explicitly don't want some APIs which currently exist on the CanvasRenderingContext2d object.

Specifically these APIs:

partial interface CanvasRenderingContext2D {
    readonly attribute HTMLCanvasElement canvas;

    void drawFocusIfNeeded(Element element);
    void drawFocusIfNeeded(Path2D path, Element element);

    void addHitRegion(optional HitRegionOptions options);
    void removeHitRegion(DOMString id);
    void clearHitRegions();

    ImageData getImageData(float sx, float sy, float sw, float sh);
};

[css-async-style] CompositorWorker use cases

To complement the list of scrolling use cases that's been started, it would be nice to build a list of non-scrolling effects that might be enabled via something like CompositorWorker.

Here are some examples to get the ball rolling:

  • Simple side-drawers which can be dragged out from the side, sticking to the finger
  • Simple custom panning that sticks to the finger and can fling in arbitrary directions (eg. google maps)
  • Drag-and-drop interfaces where elements “skootch” out of the way to make room for the dragged element (or other animations to illustrate potential drop targets).
  • Animating force-directed, springy/physical application layout. For example, drawers with inertia/friction or even more exotic, physics-based interfaces like BumpTop.
  • Animating constraint based application layout transitions (eg, responding to the addition of new views to a Cassowary layout).
  • Applications where the compositor thread is the control thread.
  • If access to input is available, input filtering.

[css-paint-api] Decide what to do about cursor.

The CSS property cursor accepts an <image>. Is there implementation complexity if we allow cursor to be invalidated every frame? Should cursor just have the opportunity just to paint once?

[css-typed-om] Calc representation not compatible with Custom Properties + var()

The current proposal https://lists.w3.org/Archives/Public/public-houdini/2015Aug/0004.html cannot accurately represent things like:

width: calc(var(--a) * var(--b));
--a: 3;
--b: 5px;

I think the TypedOM proposal is stuck somewhere between the specified and the computed style. Both need a possibly different OM, even if converting from the latter one to the first one is trivial and should be natively supported by the API.

Under this proposal, the Computed.CalcPercentLength would only contain "px" and "percent", while the Specified.CalcPercentLength would contain something more abstract which can contains additions, products, etc... We could allow user agents to simplify those calculations to pixels and percentages when it is possible to do so without impacting the result (calc(3px + 3cm) could be memorized as calc(158px)).

Anyway, this needs further thought.

[EDIT] Another option would be to support only the ComputedValue Typed OM and have one extra value ({value:string}) which would be returned for specified styles which cannot accurately be converted to a value of the ComputedValue Typed OM. Or we could just disallow this entirely and mark the specified style write-only.

[css-paint][isolated-workers] What happens if a script throws?

This could have an impact on other scripts running in the background worker.
Should we restart the environement after such an error or not?

That's important to know for scripts which may want to share data because if the worker can be restarted during a single-frame step, there's no way to accurately pass information from one script to another (or one run to another).

[css-properties-values-api] Consider moving output property conflict resolution to apply time rather than at register time.

Currently, if two custom properties try to call registerApplyHook() and identify the same output property, then the second call will fail with an exception. This is because the two properties might be used on the same element, in which case we don't know which order to apply the apply hooks in (and the order matters because both want to change the same property).

However, this is too inflexible. It seems very likely that multiple (e.g.) layout frameworks will want to register similar outputs with an expectation that they don't get used simultaneously on the same element.

We should consider switching the error detection to the point of application - i.e. if 2 applyHooks try to write to the same output property for a given element then deliver an error to window.onError. A downside here is that we are giving up the static guarantee that the custom properties were interoperable, and instead failing based on runtime state.

Add roadmap for houdini

We need to define the pipeline for not only authors but discussions during the meeting. When will the apply hooks be called, for example.

Additionally, we should show dependencies from one piece to another to help prioritize.

[other] We should create a CSS Dependencies spec

This specification would define how things like CustomPaint, the ApplyHook and other things like CustomLayout declaratively define their dependencies to css properties, layout properties and/or properties of the environment (parents, etc...).

In addition, I believe we should provide a StyleMutationObserver interface to the main javascript thread, with a behavior similar to the HTML MutationObserver, and which would allow to bind events for instance for when a CustomPaint needs input information but can't get access to it directly (the script running on the main thread may update the value of css custom properties to accurately update the painting to the current state).

This would also allow to trivially implement a querySelectorLive function, which is something a lot of people would like to have. Currently, most implementation rely on polling and other tricks to achieve this effect.

[css-paint-api] Decide how much information is in the "Geometry" passed into a paint function

The most basic information needed is the width and height of the fragment you are currently painting.

Other information that might be desirable is:
sibling fragment information - for example you want to know your position relative to you siblings so that you can paint an effect that spans multiple fragments.
previous sibling fragment information only - same as above, but you only receive your previous sibling fragment information.
children fragment information - you want to know your children fragments so that you can paint effects like a line between them (or something).

It is probably desirable to (upon registering the custom paint class) to decide which type of information here you are interested in. For example invalidating a polyfill of conic-gradient based on children fragment information isn't optimal.

Consider supporting existing CSS Property parsings

For example, being able to specify "<width>" or "<background-color>" as a syntax string.

Issue 1: this gates on the Typed OM specifying object representations of the values.

Issue 2: what should we do with "<width>|<font-size>"? "<font-size>|<width>"? Options:

  • don't allow this
  • allow this but try in-order parsing, so the first one would always return a width

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.