40 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Elliott Sprehn
8b97399df3 Simplify ScopedStyleResolver keyframe handling.
Just linearly search for keyframes in the set of stylesheets.
Components rarely have many sheets, and sheets rarely have many
keyframes so this should be quite fast. It's also much simpler
than having to collect all the keyframes from all the rulesets.

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

Review URL: https://codereview.chromium.org/839473005
2015-01-07 10:47:43 -08:00
Elliott Sprehn
f4546b7716 Store features in the ScopedStyleResoolver.
This now means that using a class/id/attribute selector in one scope will
not cause style recalcs in other scopes in the page when something with
that feature changes.

It also removes an iteration over all the scopes that used to collect
features.

I also removed all the extra cases around adding/removing classes since
the general case can handle them.

In addition I removed the check for classStringHasClassName which looked
to see if the string was all whitespace. This check dated way back to
fixing an assert in code we don't even have anymore. Assertion fix aside
all the extra check optimized for was if you wrote class="  " with no
names, which will now cause an extra malloc of the SpaceSplitString::Data.
This seems super rare, it makes more sense to not scan the class string
every time the list of classes changes which is far more common than
setting a string of only whitespace.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/837883002
2015-01-06 22:22:44 -08:00
Elliott Sprehn
3ffc5ab932 StyleSheetContents doesn't need a set of clients.
The clients were only used to call clearResolver(), but all clients in Sky
are from the same document, so we can just store the document instead. We
can also use the lifetime of the StyleSheetContents object to manage the
cache in the StyleEngine instead of the list of clients.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/791633010
2014-12-16 16:22:04 -08:00
Elliott Sprehn
2a1d0c5abb Remove global set of ScopedStyleResolvers.
Just walk the DOM instead. This will be slower, but I'm going to get rid
of the global RuleFeatureSet anyway, so this is just a temporary measure
to simplify the system. Removing the set also means removing a bunch of
special cases for when the document didn't have any ShadowRoots with
styles (which is very unlikely in Sky).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/810893002
2014-12-16 15:57:47 -08:00
Elliott Sprehn
f44ab040a3 Remove @media rules.
In sky we only support inline styles and <style media>, not
@media rules. This removes the Bison support for parsing them
which was also removed in Blink in favor of the other media
query parser which was added for use on the pre-scanner thread.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/807703003
2014-12-15 18:29:19 -08:00
Elliott Sprehn
e1c6f5561c Remove style element counting in ShadowRoot.
This optimization doesn't make sense, all it does is avoid adding
the ScopedStyleResolver for the ShadowRoot when looking for host
styles, but having that extra resolver shouldn't be slow, and in
sky it's very rare to have a ShadowRoot without styles unlike
on the web where <input> is very common and gets its style from
the UA instead of from a <style> like a normal component.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/797873002
2014-12-11 17:33:56 -08:00
Elliott Sprehn
0af96f055d Turn StyleSharing to 11.
In Sky we can style share if our TreeScopes have the same styles, our :host
styles are the same, and we'd inherit the same styles. This allows a lot of
simplification to the style sharing logic since we don't need to deal with
descendant selectors or tree boundary crossing rules:

- We can remove the logic that was checking that we were distributed
to the same insertion points since there's no ::content selectors.

- We can check the actual inherited values instead of looking at the
parentOrSHadowHostNode(). We used to look at the node in Blink because we
were checking that you'd get the same descendant selectors applied. In Sky
we instead want to make sure you'd inherit the same values. This also
means we don't need the element().parentOrShadowHostElement() != parent case
in the SharedStyleFinder which was trying to deal with descendant selectors
again.

I also removed the checks that were redundant with the checks inside
supportsStyleSharing() which we always check before adding sharing
candidates.

Finally by refactoring the code to make the TreeScope style check work it
exposed that the Document::styleSheets() and TreeScope::styleSheets() APIs
are now dead. A future patch will delete the now dead StyleSheetList class
as well.

This change makes the city-list application share between all the items in
the list, and all of the headers of the same type now share as well.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/796713002
2014-12-11 15:34:24 -08:00
Elliott Sprehn
2be9b79d94 Use the HashSet of attribute names in SharedStyleFinder.
Instead of trying to match the actual attribute rules, lets just look
at the HashSet of attribute names. This is faster, though possibly less
optimal if you use compound rules like .foo[attr]. That's rare though,
and removing this extra RuleSet will allow simplifying SelectorChecker
since hasAnyMatchingRules required a special mode where it tried to
match selectors but ignored if the scope could really match. This paves
the way to moving the RuleFeatureSet to be per-TreeScope instead of
per-Document.

I also made the API of classNamesAffectedByRules match the newly added
attributesAffectedByRules to make SharedStyleFinder consistent.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/796583002
2014-12-10 17:12:07 -08:00
Elliott Sprehn
6c94c18612 Remove the CSSOM.
This leaves CSSValue, but removes everything else.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/780483002
2014-12-03 10:50:02 -08:00
Elliott Sprehn
1ace39304c Remove code to collect rules when matching.
We should come up with a better way to implement this feature for the
inspector, the current implementation uses CSSOM wrappers and is n^2
over the number of rules in the page.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/772363002
2014-12-02 23:10:58 -08:00
Elliott Sprehn
1f1d90bc70 Remove ScopedStyleResolver::treeScopeFor.
We only support inline stylesheets or <style scoped> so we can remove
this helper.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/767013004
2014-12-02 10:06:48 -08:00
Elliott Sprehn
65c353a334 Remove parent() concept from ScopedStyleResolver.
This isn't needed, we don't have any tree boundary crossing rules.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/767273003
2014-12-01 20:04:48 -08:00
Elliott Sprehn
253b5bed74 Only allow one shadowRoot.
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/759663003
2014-11-26 13:54:14 -05:00
Eric Seidel
e0fd75b5ab Make absolute and sort all Sky headers
This caused us to lose our gn check certification. :(

Turns out gn check was just ignoring all the header
paths it didn't understand and so gn check passing
for sky wasn't meaning much.  I tried to straighten
out some of the mess in this CL, but its going to take
several more rounds of massaging before gn check
passes again.  On the bright side (almost) all of
our headers are absolute now.  Turns out my script
(attached to the bug) didn't notice ../ includes
but I'll fix that in the next patch.

R=abarth@chromium.org
BUG=435361

Review URL: https://codereview.chromium.org/746023002
2014-11-20 17:42:05 -08:00
Eric Seidel
55b5bc485d Sort headers
Fix (most) generated includes to have gen/ in their path.

This makes it easier to tell where files exist on disk.

Unfortunately I had to leave the old include path
in engine/BUILD.gn to support all the v8 includes
which were too many to deal with in this patch.

It's a little nasty to have the raw build directory
in our include path, but it produces nicer paths.

R=abarth@chromium.org
2014-11-19 12:33:42 -08:00
Elliott Sprehn
42d362ff6b Remove tons of OILPAN.
This removes ::trace, traceAfterDispatch and finalizeGarbageCollectedObject.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/723253004
2014-11-13 16:56:13 -08:00
Elliott Sprehn
89d5919878 Merge CSSDefaultStyleSheets into StyleResolver.
R=abarth@chromium.org, ojan@chromium.org

Review URL: https://codereview.chromium.org/712143004
2014-11-10 18:50:13 -08:00
Elliott Sprehn
9c7987a6e1 Remove StyleInvalidator machinery.
We don't support descendant selectors, so switch everything back to
basic hash table lookups.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/712173002
2014-11-10 17:35:11 -08:00
Ojan Vafai
275c5e291c Remove zoom() and effectiveZoom().
No change in behavior since we already removed the zoom setters.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/711203002
2014-11-10 17:32:52 -08:00
Ojan Vafai
e00f34ccf6 Initial step of removing CSS zoom related properties.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/710113003
2014-11-10 13:07:29 -08:00
Elliott Sprehn
d1e3759806 Remove more oilpan.
I also unraveled lots of transitive deps from Handle.h

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/709203002
2014-11-07 18:11:03 -08:00
Ojan Vafai
21bde7479d Remove final instances of WritingMode in Sky.
After this patch, the only instance of WritingMode is in a comment.
No change in behavior.

TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/674073005
2014-10-29 19:58:14 -07:00
Ojan Vafai
959c404854 Remove all writing mode function arguments and remove writing mode from RenderStyle.
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/683803006
2014-10-29 12:18:30 -07:00
Ojan Vafai
8b0d9e8ac9 First past at removing writing mode.
This removes the parsing and the enum. This leaves a bunch of
dead code around to fix in a followup.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/689743002
2014-10-29 12:17:11 -07:00
Eric Seidel
64b5cb61a1 Remove all oilpan transitional types
I used do-webcore-rename from Blink/WebKit
which is very good at doing this kind
of search-replace.

Also removed toRefPrtNativeArray after
conversion since it previously had two
separate flavors.  Both versions are no longer
used so I've removed the code until we
need one again.

https://www.irccloud.com/pastebin/5C16p5cE
is the diff I used to do-webcore-rename

TBR=abarth@chromium.org
2014-10-27 14:13:01 -07:00
Ojan Vafai
f9e0a463af Remove meta viewport and @viewport CSS rules.
We won't need configurations like this since we don't have things
like page zoom and a default width.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/654693004
2014-10-25 23:08:58 -07:00
Adam Barth
ae72930937 Open the Sky 2014-10-23 11:17:19 -07:00