We now only preserve the whitespace inside a <t> element inside
the parser. This removes the known n^2 from reattaching whitespace
which should make parsing and appending nodes faster. I also
removed the dead WhitespaceMode code from the parser, and made
the dom-seralizer.sky auto indent the markup so the test output
would be readable.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/867963006
In Sky most elements with a ShadowRoot will have rare data since they'll
have elements inside them with more ShadowRoots which would increment
the m_childShadowRootCount field, or they'll contain a <content> element
which would increment m_descendantContentElementCount. Only leaf elements
that don't contain either will not get one, and everyone pays the price
for the rare data ptr.
This should be mostly net netural for memory usage and it makes the code
simpler. We can add it back later if we realize there's lots of leaf
widgets.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/862183003
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
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
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 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 hook existed because some elements wanted to run script inside
::insertedInto, but that wasn't a safe time. Now nothing can run script
inside there so we don't need this extra hook.
HTMLStyleElement's usage of this hook is not clear, but it seems like
it might have related to a pre-lazy attach bug.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/758623002
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