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 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
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
The StyleRule classes supported copy() operations and mutable
property sets so that we could do copy-on-write and mutate them
using the CSSOM. Sky doesn't have a CSSOM like this though,
so we can remove all this code and make the StyleRule classes
effectively immutable after construction (the parser does mutate some
rules though).
I also removed some other dead code in the StyleRule hierarchy,
like some left over mutation methods that the CSSOM used to use.
R=eseidel@chromium.org, ojan@chromium.org
Review URL: https://codereview.chromium.org/758573005
In preparation of simplifying how we collect and process sheets now
that we don't support descendant, sibling and tree boundary crossing
rules we should switch to always going down the Reconstruct path.
This might be somewhat slower to start, but because our rules are so
much simpler we should be able to rebuild the StyleEngine to do
something simpler and faster.
R=ojan@chromium.org
Review URL: https://codereview.chromium.org/774953002
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
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