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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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: 4a3b676dc3TBR=esprehn@chromium.org,rafaelw@chromium.org,abarth@chromium.org,ojan@chromium.org
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/788383002
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
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
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
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
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