387 Commits

Author SHA1 Message Date
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
Rafael Weinstein
f38f80c9f8 Enable/Unprefix Animations & Transitions, add basic tests
This patch remove the Web Animations & CSS Animation runtime flags (and enables both). Removes prefixed Aninamations & Transitions and adds some basic tests & test support API.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/760183003
2014-12-10 10:38:34 -08:00
Colin Blundell
a450ba1353 Restructure public side of network service.
This CL goes from this:
  //mojo/services/public/cpp/network
  //mojo/services/public/interfaces/network

to this:
  //mojo/services/network/public/cpp
  //mojo/services/network/public/interfaces

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

TBR=beng

Review URL: https://codereview.chromium.org/789243002
2014-12-10 16:28:40 +01:00
Colin Blundell
3dc76a69df Restructure public side of view_manager service.
This CL goes from this:
//mojo/services/public/cpp/view_manager
//mojo/services/public/interfaces/view_manager

to this:
//mojo/services/view_manager/public/cpp
//mojo/services/view_manager/public/interfaces

This CL also makes the Mojo-side changes required to roll this change into
Chromium (for both view_manager and window_manager, which was converted in an
earlier CL but for which these updates were not made):
- Updates rev_sdk.py to pull over the new directory
- Updates //mojo/services/public/mojo_services_public.gyp

TBR=beng

Review URL: https://codereview.chromium.org/790623003
2014-12-10 14:16:27 +01:00
Ojan Vafai
1492a0d635 Remove the straggling DisableCompositingQueryAsserts.
We don't have compositing query asserts anymore,
so there's nothing to disable.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/787293002
2014-12-09 20:25:18 -08:00
Ojan Vafai
3ffd336ad5 Remove relayout due to scrollbars taking up width
We only have overlay scrollbars, so we never need to
relayout due to the lack or presence of scrollbars.

Also remove a few stracking has*Scrollbar methods.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/783393006
2014-12-09 19:48:50 -08:00
Elliott Sprehn
c6f3d36fe2 Simplify HTMLStyleElement.
The parser will never insert more than one child into a <style>, so we don't
need explicit logic to batch up parsing. Once I removed that it exposed that
all the line number and parser created logic is from error reporting in the
parser that's been dead in Blink for over a year.

By doing this simplification I was able to remove the finishParsingChildren()
callback entirely.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/788113002
2014-12-09 19:01:46 -08:00
Elliott Sprehn
dfd9a3faa5 Add clear() to Element.classList.
We should support a fast way to remove all classes through the
classList instead of having to call removeAttribute() directly.

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

Review URL: https://codereview.chromium.org/788093003
2014-12-09 17:56:41 -08:00
Elliott Sprehn
c2916617b4 Merge ClassList into DOMTokenList.
In Sky we only have one implementation of DOMTokenList so we don't
need this virtual interface.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/789843004
2014-12-09 16:06:29 -08:00