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
The update doesn't actually do anything until the resolver
is created, just skip the tree walk.
This also removes the special case for document from StyleSheetCollection
which didn't make any sense. It would cause us to discard the entire
resolver whenever the sheets in the document changed which is far more
work than is actually needed. We probably are missing some font invalidation
code now, but we can add that back later.
R=ojan@chromium.org
Review URL: https://codereview.chromium.org/836383005
ShadowRoot should deal with adding and removing itself from the active
scope list. HTMLStyleElement should just add/remove itself directy from
the StyleSheetCollection on the scope its entering or leaving in
insertedInto/removedFrom.
R=ojan@chromium.org
Review URL: https://codereview.chromium.org/844133002
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
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
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
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 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
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
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