141 Commits

Author SHA1 Message Date
Adam Barth
52b56750a1 Rename sky/engine/bindings2 to sky/engine/bindings
There's only one bindings system now.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/915293003
2015-02-12 20:16:17 -08:00
Adam Barth
f2d2e80e59 Merge the Sky Engine changes from the SkyDart branch
This CL flips the switch to make Sky use Dart.

TBR=eseidel@chromium.org
BUG=454613

Review URL: https://codereview.chromium.org/922893002
2015-02-12 15:06:03 -08:00
Ojan Vafai
effdf28e11 Remove position:relative.
The use-cases we care about are met better by translate2d.
Remove the parsing so that people writing on sky don't
depend on it. Followup patches will remove the functionality.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/904613005
2015-02-06 12:46:04 +11:00
Ojan Vafai
b139ec4316 Delete remaining masks dead code.
Removes the straggling code related to masks now that
we've removed the CSS properties.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/893093002
2015-02-03 13:56:34 +11:00
Ojan Vafai
81ae67c906 Remove -webkit-mask-*.
This is for doing masking based off the alpha channel of
an image. This is a feature we want to support, but we
want a more general imperative API that the declarative thing
is built on top of.

In the meantime, the code is getting in our way and the
feature was already broken (likely from before making sky public).
We just paint the mask image on top instead of doing the actual
masking.

This patch just removes the parsing. Followup patches will
remove the implementation code.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/892903002
2015-02-01 18:45:44 -08:00
Adam Barth
54809a8877 Remove more scrolling code from Sky
None of this code does anything anymore.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/878303002
2015-01-27 15:20:14 -08:00
Adam Barth
c33c565f8b Remove ScrollableArea and Scrollbar
This code is unused.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/879993004
2015-01-27 12:08:24 -08:00
Ojan Vafai
b854dc1ebf Remove negative z-index.
There's no good use-case for putting descendants behind
their ancestors.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/873983007
2015-01-26 18:55:09 -08:00
Elliott Sprehn
bd7bbc8967 Remove CSSCanvas values.
This was to support doing background: -webkit-canvas(#id) where you could then
get the canvas with document.getCSSCanvasContext(id) and draw into it which
is a poor form of custom drawing for elements. In Sky we'll have real custom
painting instead of just background images hacked in like this.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/876913002
2015-01-26 15:12:38 -08:00
Elliott Sprehn
ff2cde060f Remove more properties from the global Window.
StyleMedia seems to have been removed from the web too, and self is a
legacy-ism we don't want. I also removed the global find() which is a
document feature.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/872143004
2015-01-26 15:12:04 -08:00
Elliott Sprehn
ed2912af0b Remove PseudoId.
Sky doesn't have pseudo elements (::before, ::after, etc.)

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/883443003
2015-01-26 13:51:56 -08:00
Elliott Sprehn
86f47baf88 Remove even more @keyframes related code.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/876433002
2015-01-26 11:38:20 -08:00
Adam Barth
da75d15a1b Merge HTMLDocument into Document
HTMLDocument is the same as Document. We can merge them.

R=eseidel@google.com

Review URL: https://codereview.chromium.org/871383002
2015-01-25 23:48:53 -08:00
Elliott Sprehn
0275d42ac7 Add the <t> element and ignore whitespace outside it.
We now only preserve the whitespace inside a <t> element inside
the parser. This removes the known n^2 from reattaching whitespace
which should make parsing and appending nodes faster. I also
removed the dead WhitespaceMode code from the parser, and made
the dom-seralizer.sky auto indent the markup so the test output
would be readable.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/867963006
2015-01-23 16:50:00 -08:00
Elliott Sprehn
1d994fbaf0 Remove lots of @keyframes related code.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/872893002
2015-01-23 13:24:09 -08:00
Elliott Sprehn
c9a152c464 Remove @keyframe parsing.
We still have the code internally, but the parser won't create
StyleRuleKeyframes anymore.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/871773003
2015-01-22 20:48:22 -08:00
Adam Barth
2c0b2f7ff9 Remove UseCounter
We'll eventually add this back but sometime in the future when we actually have
users.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/867903002
2015-01-22 18:26:55 -08:00
Elliott Sprehn
93af6b3bf1 Don't store a RuleFeatureSet on ScopedStyleResolver.
Instead lets just iterate the list of sheets and ask each one questions. This
shouldn't be much slower since most widgets only have one sheet anyway.

I also moved the media query matching to the sheet collection. We weren't
correctly matching them since we only guarded the feature set, not the
addition to the list of active sheets.

R=abarth@chromium.org, ojan@chromium.org

Review URL: https://codereview.chromium.org/858423002
2015-01-21 17:00:06 -08:00
Elliott Sprehn
a489bb7128 Remove css !important
Sky doesn't have important, it just orders properties in the same order
as the rules you specified.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/860423004
2015-01-21 14:34:02 -08:00
Elliott Sprehn
5ebbdf3db6 Eliminate RuleRange.
In Sky there's no UA rules so we don't need to keep track of the
range of UA vs Author rules for running applyMatchedProperties later.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/863883002
2015-01-20 19:50:35 -08:00
Elliott Sprehn
b05eec5f30 Prune the API of StyleResolver.
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/858073003
2015-01-20 19:10:03 -08:00
Elliott Sprehn
f0e8f7c7d3 Treat UA rules like author rules when matching.
Sky doesn't have a concept of UA rules, just some default style
rules you can override.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/864693002
2015-01-20 18:49:23 -08:00
Elliott Sprehn
1d3828fb29 Put the StyleResourceLoader on the stack.
It has no state, we should just put it on the stack during style
resolve.

I also combined the methods inside StyleResourceLoader to make it
simpler.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/825433003
2015-01-20 16:49:40 -08:00
Elliott Sprehn
7686fb0b8f Simplify media query handling for stylesheets.
Just rebuild the sheets when the viewport changes sizes since that's
super rare in sky right now. This also causes a full document style
recalc, but we'll fix that later too. For now lets make the system
simpler.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/848483003
2015-01-20 15:35:25 -08:00
Elliott Sprehn
38c4d27f53 Remove custom element :unresolved.
Sky doesn't do upgrades and unknown elements become <error>
so this doesn't make sense.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/842033004
2015-01-16 17:50:18 -08:00
Elliott Sprehn
9bb2664b06 Get rid of ensureStyleResolver().
It doesn't have side effects anymore, and active documents always
have a StyleResolver.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/838003008
2015-01-16 17:49:32 -08:00
Elliott Sprehn
8f1c3bacfc Trim the deps of StyleResolver.h
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/794783003
2015-01-15 13:11:10 -08:00
Ojan Vafai
d563e42443 Unprefix -webkit-filter and add a pixel test for it.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/850103003
2015-01-14 15:14:46 -08:00
Elliott Sprehn
6f8568037a Move @font-face logic from ScopedStyleResolver to StyleEngine.
R=abarth@chromium.org, ojan@chromium.org

Review URL: https://codereview.chromium.org/851873002
2015-01-14 11:07:22 -08:00
Elliott Sprehn
e71cf28f76 Merge StyleSheetCollection into ScopedStyleResolver.
There's no reason to keep two identical lists of the sheets
and have this separate object. I also moved the updating
logic out of StyleResolver and into ScopedStyleResolver
which makes more sense. There's still some weirdness since
some global state still exists in the StyleResolver, but
that's something we can fix in future patches.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/852703002
2015-01-13 18:37:00 -08:00
Elliott Sprehn
d8f1313e81 Always set affected by bits in ElementRuleCollector.
We need to always set these bits, not just if the selector
matched otherwise :hover and friends won't ever match.

BUG=448465
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/852643002
2015-01-13 14:11:02 -08:00
Elliott Sprehn
1eb36b8721 Remove RuleSet::viewportDependentMediaQueryResults.
Sky doesn't support @media rules, <style> elements must use
the media attribute which instead stores the media query
info on the CSSStyleSheet instead.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/850463003
2015-01-13 11:34:14 -08:00
Elliott Sprehn
689b91c36d Replace sheet change methods with styleResolverChanged.
Unlike blink in sky we just want to mark tree scopes dirty. We can
remove these methods, the dirty tree scope tracking we'll add in
the future will take care of this.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/836893003
2015-01-12 18:23:55 -08:00
Elliott Sprehn
7fd0df2238 Remove tracking of pending sheets.
I was going to remove all this anyway since we don't need it in sky, all sheets
are local and there's no concept of a pending sheet now.

I also removed the dirty bit I added to StyleSheetCollection. The bit
is not correct and is preventing us from correctly processing sheets and
invalidating style. I'll add it back later when I understand how to add
the dirty bit correctly.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/846183002
2015-01-12 18:15:23 -08:00
Elliott Sprehn
9931dadd39 Don't check shareElement for attribute rules in SharedStyleFinder.
There's no reason to do this, if an element matched
an attribute rule then it'll have a unique style and
RenderStyle::isSharable() will return false so we
wouldn't even get here.

If we could have matched an attribute rule, but didn't
actually match one then we can continue to share with
other elements that aren't affected by attribute rules
since even though our attributes could affect styling
the rules didn't match us.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/843233002
2015-01-09 19:14:33 -08:00
Elliott Sprehn
47b217c64c Don't scope check in SelectorChecker.
Instead of checking if the rule is from the right scope
in SelectorChecker, just store :host rules separately
and always assume rules are in the right scope in the
checker.

This removes a lot of complexity that was passing around
the scope and checking it, and also the need to plumb
if we're matching UA rules down into the checker.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/848493003
2015-01-09 19:00:51 -08:00
Elliott Sprehn
b7336cd862 Remove shadowPseudoElementRules.
Nothing uses this now, it was for custom pseudo elements
that don't exist in Sky.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/786953008
2015-01-09 18:18:47 -08:00
Elliott Sprehn
c5d1426457 Remove all attribute selectors that are not Set or Exact.
Sky doesn't support prefix, suffix, list, contains
or other fancy attribute selectors.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/836383004
2015-01-09 18:09:47 -08:00
Elliott Sprehn
bbd0b89106 Get rid of SelectorCheckingContext.
We can just pass the Element and the scope.

I also deleted checkExactAttribute which was not called, and inlined
tagMatches which only had a single caller.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/801283006
2015-01-09 15:17:20 -08:00
Elliott Sprehn
29ce4f5a9a Make SelectorChecker a const operation over element.
We now store the bits about what was matched inside the SelectorChecker
and map them to operations that mutate the style after matching the
selector. This eliminates the SelectorChecker::Mode.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/840163003
2015-01-08 18:06:12 -08:00
Elliott Sprehn
7b0d1d8fda Remove CascadeScope.
It's always zero in sky.

This was for sorting tree boundary crossing rules and rules in multiple
ShadowRoots on the same element. Neither of those things exist in Sky
so we can remove it.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/800483006
2015-01-08 18:02:23 -08:00
Elliott Sprehn
c953075f5f Remove includeEmptyRules.
No one ever sets this, and I'm not sure why we'd ever want to
keep around empty property sets.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/828373005
2015-01-08 17:23:05 -08:00
Ojan Vafai
7ae966e650 Fix crash in continuations.
Style sharing didn't play nicely with elements getting
their display adjusted based off the parent's display.
We style share without doing adjusting, so we need to
avoid style sharing if adjusting would result in
a different style. Particularly, we need to make sure
that the display coercion would happen in the same way.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/839153002
2015-01-08 17:20:00 -08:00
Elliott Sprehn
e737df55fb Simplify the style sharing list code.
We don't need separate lists per depth now, in fact we never
increment the depth so everything is already at depth 0.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/844873002
2015-01-08 13:53:00 -08:00
Elliott Sprehn
967cc9ed34 Move StyleResolver code out of ScopedStyleResolver.
Instead lets process the ruleset into the global lists in
the StyleResolver itself. I also combined the methods in
StyleResolver and removed the now dead AddRuleFlags
argument.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/838313002
2015-01-08 13:44:12 -08:00
Elliott Sprehn
c42957e7e7 Combine match methods on StyleResolver.
We can combine matchAuthorRulesForShadowHost into
matchAuthorRules, and also combine the two matchUARules
methods.

collectScopedResolversForHostedShadowTrees and the Vector
of ScopedStyleResolvers was also not needed. Sky can only
ever have two resolvers, the one for your scope, and the
one for your host rules.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/836193003
2015-01-08 10:16:59 -08:00
Elliott Sprehn
8fc2d586cb Remove SelectorChecker::ContextFlags.
We don't need the flags, we can just use an explicit
check for :host().

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/838863002
2015-01-07 11:57:32 -08:00
Elliott Sprehn
8bdd05a389 Remove applyAuthorStyles flag.
This flag doesn't really make sense in sky, rules should
only match if they're from the same scope or are a :host
rule in the ShadowRoot on the element. Removing this also
eliminates the ScopeContainsLastMatchedElement flag. For
now we just check if the scope is null for the same
behavior, in the future we'll never let scope be null
and we'll just enforce the normal style scoping rules.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/833443003
2015-01-07 11:35:40 -08:00
Elliott Sprehn
61d08323e8 Remove dead enums from StyleResolver.
We never disable style sharing with DisallowStyleSharing
now, and SMIL doesn't exist in Sky so the
MatchAllRulesExcludingSMIL flag is just dead code.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/823633006
2015-01-07 11:19:29 -08:00
Elliott Sprehn
059ceb6e3f Remove the remaining parts of ignorePendingStylesheets and placeholder styles.
This patch is largely just a rename since updateLayoutIgnorePendingStylesheets()
didn't really do anything except call updateLayout() now as nothing was reading
the ignorePendingStyleSheets state, and no callers used the synchronous post
layout task option which was meant for plugins (which Sky doesn't have).

Placeholder styles were related and just add confusion since things pretend to
be display: none while <import>'s are loading. We should expose a real API for
avoiding FOUC instead of pumping frames with display: none elements when
imports are loading.

I had to skip the layout/continuations.sky test since it always crashes now
with an ASSERT failure about a bad cast (filed as bug 446739). The bug already
existed, this patch just makes that one test hit it.

BUG=446739
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/834693007
2015-01-07 10:54:41 -08:00