Instead just use textContent() and teach HTMLStyleElement how to atomize
its children. I also added the optimization to Node::textContent so that
Text just returns its value instead of allocating a new buffer which
avoids malloc and copy when getting the textContent of text.
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/864613002
There's no reason to keep two identical lists of the sheets
and have this separate object. I also moved the updating
logic out of StyleResolver and into ScopedStyleResolver
which makes more sense. There's still some weirdness since
some global state still exists in the StyleResolver, but
that's something we can fix in future patches.
R=ojan@chromium.org
Review URL: https://codereview.chromium.org/852703002
Unlike blink in sky we just want to mark tree scopes dirty. We can
remove these methods, the dirty tree scope tracking we'll add in
the future will take care of this.
R=ojan@chromium.org
Review URL: https://codereview.chromium.org/836893003
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
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
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
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
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
Fix (most) generated includes to have gen/ in their path.
This makes it easier to tell where files exist on disk.
Unfortunately I had to leave the old include path
in engine/BUILD.gn to support all the v8 includes
which were too many to deal with in this patch.
It's a little nasty to have the raw build directory
in our include path, but it produces nicer paths.
R=abarth@chromium.org
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