395 Commits

Author SHA1 Message Date
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
1da814b4c2 Remove custom element type extensions.
Sky doesn't really have many built in elements, we no longer support
<foo is="my-element">. This does mean you can't extend <import>,
<script> or <style>, but we'll figure that out later.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/831993005
2015-01-06 16:07:15 -08:00
Benjamin Lerman
f87209c43f Update from https://crrev.com/309415
Review URL: https://codereview.chromium.org/822713002
2014-12-22 13:08:16 +01:00
Etienne Membrives
a4ea8c30fe Update from https://crrev.com/308996
Add patch for V8 build rules

R=qsr@chromium.org

Review URL: https://codereview.chromium.org/816543004
2014-12-19 15:45:38 +01:00
Elliott Sprehn
4e176ff90e Remove dead StyleEngine::removeFontFaceRules.
This existed to support the incremental stylesheet updates
(AnalyzedStyleUpdate) that sky doesn't support.

R=eseidel@google.com

Review URL: https://codereview.chromium.org/793933004
2014-12-17 21:54:32 -08:00
Elliott Sprehn
de9440a990 Simplify StyleEngine clean up.
The StyleEngine only lives as long as the document is attached,
and the document is always detached before it is destroyed. This also
means the document for the style engine always has a frame, so we
don't need to conditionally create the CSSFontSelector.

R=eseidel@google.com

Review URL: https://codereview.chromium.org/786933008
2014-12-17 21:39:42 -08:00
Elliott Sprehn
344d558935 Remove global list map of TreeScope to StyleSheetCollection.
StyleSheetCollection is tied to TreeScope in lifetime, and should
really just be a member of it like the ScopedStyleResolver. Doing
this makes the StyleEngine simpler and removes the error prone
manual clean up.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/815653002
2014-12-17 18:03:54 -08:00
Elliott Sprehn
e84233f202 Null check StyleEngine in ~ShadowRoot.
Not all documents have a StyleEngine, only displayed (active) ones.
We need a null check to avoid crashing in the ShadowRoot destructor.

BUG=443423
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/814713002
2014-12-17 17:20:30 -08:00
Elliott Sprehn
28b94b796c Remove <video controls> hack.
insertedInto and removedFrom should always be paired, there's no
reason to track this state separately when updating the childShadowRoot
bits.

I also removed the inDocument() checks from ShadowRoot::insertedInto
and removed from since distribution happens in detached subtrees too.
It appears that while they were wrong, it didn't matter because the
state was only used together with containsContentElements() in a check
of the form:

if (!containsShadowRoots() && !containsContentElements())
  return;

which meant that while the containsShadowRoots bit might be wrong false
incorrectly, the containsContentElements is always correct so we'd
never take the early out incorrectly.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/801643009
2014-12-17 17:20:13 -08:00
Elliott Sprehn
b8ae95165b Implement Node.ownerScope
The ownerScope property is equivalent to walking up the parentNode
pointers until you hit the top and returning that node if it's a
Document or ShadowRoot.

This means that the ownerScope of ShadowRoot and Document is always
itself, and the ownerScope of an Element that is not the descendant
of a ShadowRoot, and is not in the document is null.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/810793005
2014-12-17 16:05:15 -08:00
Elliott Sprehn
4a9e21a78c Custom elements should have class side inheritance.
We were not setting the __proto__ property of the generated constructor
so the generated class didn't inherit from the passed class which meant
that statics were not available.

This patch adds the missing call to setPrototype (which sets __proto__).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/814683002
2014-12-17 14:24:34 -08:00
Elliott Sprehn
0ef7c1c7ba Fix attribute selectors.
There was a return missing in SelectorChecker, we were also making
the attribute names lowercase which is not neccesary in Sky.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/815613002
2014-12-17 14:00:17 -08:00
Eric Seidel
a251cf3ecb Move Sky's DataPipeDrainer to mojo/common
I want to use DataPipeDrainer in some non-sky code
it seems generally useful (and compiled w/o modification).

R=jimbe@chromium.org, jamesr@chromium.org

Review URL: https://codereview.chromium.org/811873003
2014-12-17 12:16:34 -08:00
Elliott Sprehn
58d3a54d7b Remove dirtyTreeScopes tracking code from StyleEngine.
This code is dead, nothing ever reads m_dirtyTreeScopes.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/812593004
2014-12-16 18:44:40 -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
27c8ff819e Don't sort tree scopes in StyleEngine.
Sky doesn't have tree boundary crossing rules so we don't need to sort
the list of tree scopes in the StyleEngine. This was needed to make
tree boundary crossing rules apply in the right order.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/807933003
2014-12-16 15:11:15 -08:00
Elliott Sprehn
ab2499fad9 Only the main document should have a StyleEngine.
In Sky <style> elements in import documents don't apply to the main document,
so we don't need the StyleEngine to be aware of the import tree. This change
makes us only create the StyleEngine for active documents.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/813493003
2014-12-16 13:14:54 -08:00
Elliott Sprehn
c282ac1c40 Merge all StyleSheetCollections.
We don't need all these subtypes, or to create the base class as to
what amounts to a thin wrapper around a Vector. Instead lets merge all
the types together. Future patches will remove the special cases inside
the collection for Document vs ShadowRoot.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/799393005
2014-12-16 12:41:13 -08:00
Benjamin Lerman
6c362ec3dc Fix gn check.
TBR=etiennej@chromium.org

Review URL: https://codereview.chromium.org/809703002
2014-12-16 14:05:16 +01:00
Etienne Membrives
404a0cc6db Update from https://crrev.com/308331
Fix ui/compositor/compositor.(h|cpp) based on http://crrev.com/738983002

Fix sky/engine based on current Blink code

R=qsr@chromium.org

Review URL: https://codereview.chromium.org/812543002
2014-12-16 13:56:09 +01: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
ca96d732de Remove REM units.
The code to make them dynamically update was already removed when
Document::inheritHtmlAndBodyElementStyles was removed. We might want
to add them back later, but probably in a different way, so lets
remove the code for now to make refactoring the style system easier.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/788883005
2014-12-15 17:29:04 -08:00
Elliott Sprehn
4b7e60d511 Remove dead StyleRuleFilter.
This was for custom shaders, which we don't support (and neither
does Blink).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/810543002
2014-12-15 16:29:47 -08:00
Elliott Sprehn
e9806c1a88 Remove containsAttributeSelector() checks.
We can just set the style as unique from inside the SelectorChecker
instead. That's not ideal either, but it's simpler, and we'll eventually
use a hashing function to instead make elements with attribute selectors
that have the same values share their style instead of disabling
sharing.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/803113004
2014-12-15 13:43:40 -08:00
Elliott Sprehn
4dea02214c Remove dead methods from CSSStyleSheet and StyleSheetContents.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/809513003
2014-12-15 13:24:48 -08:00
Elliott Sprehn
ab533f0210 Remove second set of clients from StyleSheetContents.
It used to track loading and completed clients to deal with remote
loading sheets (@import, <link>), but all sheets are inline in Sky
so this is now dead code.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/808563002
2014-12-15 12:45:13 -08:00
Elliott Sprehn
e0cde8499a Remove single client special cases for StyleSheetContents.
We can also remove all single document checks since in Sky we
don't have the cross document cache so all sheets are always
connected to a single document.

I also did some minor code simplification and removed an
OILPAN ifdef.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/799143002
2014-12-12 17:08:43 -08:00
Elliott Sprehn
89b5468c3b Remove dead code from StyleSheetContents and CSSStyleSheet.
This code was for external stylesheets which we don't
support.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/799073004
2014-12-12 16:27:23 -08:00
Elliott Sprehn
586a535b7f Delete StyleSheetList and support code.
We don't need this since we don't expose the list of sheets from Document
or ShadowRoot in Sky. After removing this code I also simplified the
system and deleted StyleSheetCandidate and DocumentStyleSheetCollector
which don't really do anything anymore.

Even if we do want to add back a list of sheets later it won't need code
because we don't have a concept of a remote sheet like <link rel> did,
and we don't have to deal with non-CSS sheets.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/803673003
2014-12-12 15:47:57 -08:00
Elliott Sprehn
85c3691e29 Remove hasSyntacticallyValidCSSHeader.
This existed apparently to track if a CSS file had at least
a valid CSS rule at the start to attempt to mitigate cross
origin CSS attacks where a file with an invalid mime was
sniffed as CSS and then we skipped the first part which
was not valid, but then interpreted the latter half of
the file as valid CSS.

In Sky all content is same origin, so we don't need this
mitigation.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/800083003
2014-12-12 15:44:21 -08:00
Elliott Sprehn
3bccf6139d Remove hasFailedOrCanceledSubresources.
This was used to skip caching sheets across documents that had failed
resource loads so that when you loaded a new tab with the same resource
we'd attempt to load it again.

The cross document cache (which was only used by <link>) doesn't exist
in Sky, and neither does CSSStyleSheetResource which used it, so we can
remove all this code.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/799113003
2014-12-12 15:41:52 -08:00
Elliott Sprehn
15f795fcc3 Simplify the internals of HTMLStyleElement.
addStyleSheetCandidateNode already checks inDocument(), so we can remove
that check. We can also merge processStyleSheet, process and createSheet

I also removed the print media query check, and inlined
clearDocumentData into the destructor.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/798563005
2014-12-12 13:14:12 -08:00
Eric Seidel
870da02623 Fix hit-testing
It was broken during removal of RenderLayer::collectFragments:
https://codereview.chromium.org/778043005/

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

Review URL: https://codereview.chromium.org/791933004
2014-12-12 09:25:48 -08:00
Colin Blundell
e55c96e96a Run gn format on all gni files (gn version 307087)
Change generated by running the following command:

for x in `git ls-files *.gni`; do gn format --in-place $x; done

This came up as an issue in https://codereview.chromium.org/801523002/, but I
didn't want to add noise to that CL.

R=qsr@chromium.org, qsr

Review URL: https://codereview.chromium.org/794413003
2014-12-12 09:51:24 +01:00
Elliott Sprehn
9c5454bdd9 Remove candidate tracking bit from <style>.
This bit doesn't really seem to do anything except prevent a hash table
lookup in removeChild. I'm hoping to remove the hash tables anyway, so
lets just remove this bit.

I also removed the dead m_loading bit.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/789603003
2014-12-11 18:43:27 -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
7d4ebad24b Remove the type attribute from <style>.
In Sky there's only CSS.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/791453004
2014-12-11 17:32:45 -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
Colin Blundell
b5be4a0945 Restructure public side of navigation service.
This CL goes from this:
  //mojo/services/public/interfaces/navigation

to this:
  //mojo/services/navigation/public/interfaces

This CL also makes the Mojo-side changes necessary to roll this change into
Chromium.

TBR=beng

Review URL: https://codereview.chromium.org/796783002
2014-12-11 08:49:15 +01:00
Rafael Weinstein
be846a56b7 Remove CompositingReasons.*
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/794733004
2014-12-09 17:19:00 -08:00
James Robinson
3302673761 Update from https://crrev.com/307758
Review URL: https://codereview.chromium.org/796663002
2014-12-10 17:32:33 -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
Eric Seidel
d4de7b0d3e Reverted the wrong one.
Revert "Revert "Get rid of LayerFragment.""

This reverts commit e68e8688f1105ca9fe7c49bac73246297ee76fb0.

TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/793123002
2014-12-10 15:01:32 -08:00
Eric Seidel
f353cd6cac Revert of Remove RenderLayer::collectFragments. (patchset #1 id:1 of https://codereview.chromium.org/778043005/)
Reason for revert:
This broke hit testing.  Hit testing always returns the root node now. :)

Original issue's description:
> Remove RenderLayer::collectFragments.
>
> Sky always has exactly one per RenderLayer. This patch
> gets rid of the hitTestLayer use of LayerFragment
> and gets paintLayerContents to create the list of
> fragments itself since it's the only caller.
>
> Also, delete dead code from LayerFragment.h.
>
> R=abarth@chromium.org
>
> Committed: 4a3b676dc3

TBR=esprehn@chromium.org,rafaelw@chromium.org,abarth@chromium.org,ojan@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/788383002
2014-12-10 14:58:48 -08:00
James Robinson
15db886b19 Simplify //mojo/public/c/system targets
We don't support building mojo apps in the component build, so we can
simplify these system targets a bit. We don't need to have everything
depend on a forwarding group that always evaluates to the same thing in
the mojo repo.

The new targets are:

//mojo/public/c/system which contains the system headers but no
implementation.

//mojo/public/platform/native:system which contains the system thunks
and exported thunk setter, used by anything run by the shell. This is
mostly used by the mojo_native_application template but is also used
by a few targets that need to link as shared_lib but will ultimately
be loaded by the shell.

//mojo/edk/system provides the real implementation of the system calls
and is used by the shell and a few tests.

The :for_... groups need to stick around for now to keep chromium
working, but once this rolls in to the chromium tree then these can
be fixed up as well.

R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/754963008
2014-12-10 13:56:25 -08:00