54 Commits

Author SHA1 Message Date
Adam Barth
fe31fd0e4c Port sky-scrollable to Dart
This CL ports sky-scrollable to the new sky-element.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/950603002
2015-02-21 09:56:22 -08:00
Adam Barth
16db84fde1 Add a basic sky-element custom element
After this CL, you can use <sky-element> to describe custom elements. The
current iteration is very basic and is hardcoded to "example", but its a start.

This CL renames the |init| function to |_init| to prevent importers from
calling it directly. Also, we now pass the <script> element to |_init| to give
some context.

R=ojan@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/950493003
2015-02-20 21:45:36 -08:00
Adam Barth
178be1d89d Remove almost all clients of isHTMLElement
This CL is progress towards deleting the concept of an HTMLElement entirely. We
won't actually get all the way there in this CL series, but we're getting
closer. This CL also will let us make custom elements just be Elements instead
of HTMLElements.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/942933003
2015-02-20 12:06:15 -08:00
Eric Seidel
c78cea7e54 Allow multiple dart <script> tags in .sky files
This does several things:
1.  Teaches sky about asynchronous script execution. Previously once all imports
were loaded and the script text was available, we executed a script and assumed
it completed synchronously.  We left the parser loop to do so, but that was fine
as the next chunk from the background thread would resume the parser.  In this
change scripts now load and execute separately.  The "load" step may trigger
further dart import loads which may cause the execution to happen asynchronously
which required teaching both the DartController and the HTMLScriptRunner to
take callbacks to allow HTMLDocumentParser to know to continue parsing after
the Dart script has resolved its imports and executed.

This required re-working some of how the parser executes scripts and I
re-purposed isWaitingForScripts to include "is the parser blocked" where
as before it was limited only to "does the treebuilder have a script", even
though the imports system may have had pending scripts as well.

I made HTMLScriptRunner live only as long as the script it was executing
since it only contained per-script state at this point.

2.  Fixed an error reporting bug whereby we would not show errors when "init"
failed to execute, only "main".  This required using the dart_mirrors_api.h
which required adding an include path to the core build. :(

3.  Made it possible for a single sky file to contain multiple dart <script>
tags.  Each <script> is a separate library and executes as
soon as </script> is seen.  main or init is called for each.  This required
mangling "urls" for these script blocks since Dart unique's libraries by urls.
Before this change it may have been possible to do <import 'foo.sky'> and then
<script>import 'foo.sky'</script> and have it work!?

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/938623005
2015-02-20 11:08:28 -08:00
Eric Seidel
4790abe2f7 Remove the concept of pendingScripts from HTMLScriptRunner
We shouldn't need pendingScripts in ScriptRunner since
we should never be trying to run scripts when we're
not ready to run them.

However this wasn't completely true in the case of imports
there was code to have us break before any start tag after
an <import> was seen, but it was subtly wrong in that it
it would include the start-tag it was trying to break before
in the chunk it sent to the main thread.

This didn't run out to be the problem I was facing, but I fixed
it anyway.  The problem which was actually preventing me from
removing pendingScripts was adding a check inside
didRecieveParsedChunk... to check if imports were pending and
add the chunk to the list of pending chunks.

I also renamed m_speculations to m_pendingChunks since these
chunks are never speculative anymore.

We can't test the off-by-one import-breaking code with our
current system, but it would be trivial to test with a
self-closing custom element if/when we ever add custom
elements back to the system.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/934083002
2015-02-17 16:13:30 -08:00
Adam Barth
52b56750a1 Rename sky/engine/bindings2 to sky/engine/bindings
There's only one bindings system now.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/915293003
2015-02-12 20:16:17 -08:00
Adam Barth
f2d2e80e59 Merge the Sky Engine changes from the SkyDart branch
This CL flips the switch to make Sky use Dart.

TBR=eseidel@chromium.org
BUG=454613

Review URL: https://codereview.chromium.org/922893002
2015-02-12 15:06:03 -08:00
Adam Barth
e962904c7a Remove TRACE_EVENT indirection through blink::Platform
Normal trace events already go directly to base. This CL removes the remaining
trace events that were still indirected through blink::Platform. These were
just the half-finished inspector timeline trace events, which currently aren't
actually hooked up to anything.

This CL also removes the redunant "convertable to trace format" wrappers and
moves their one remaining use over to just using the version in base directly.

R=eseidel@google.com, ojan@chromium.org

Review URL: https://codereview.chromium.org/889823002
2015-01-30 08:47:46 -08:00
Adam Barth
da75d15a1b Merge HTMLDocument into Document
HTMLDocument is the same as Document. We can merge them.

R=eseidel@google.com

Review URL: https://codereview.chromium.org/871383002
2015-01-25 23:48:53 -08:00
Elliott Sprehn
0275d42ac7 Add the <t> element and ignore whitespace outside it.
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
2015-01-23 16:50:00 -08:00
Adam Barth
2c0b2f7ff9 Remove UseCounter
We'll eventually add this back but sometime in the future when we actually have
users.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/867903002
2015-01-22 18:26:55 -08:00
Adam Barth
e89b1dda15 lowlevel/img.sky flaky crashes
We don't need to pump pending speculations if we don't have any.

R=esprehn@chromium.org, eseidel@chromium.org
BUG=447763

Review URL: https://codereview.chromium.org/852043003
2015-01-14 13:32:21 -08:00
Adam Barth
6b2c0b2c58 The Sky parser should yield before start tags
This CL makes the parser yield before non-import start tags if there are
outstanding imports. This will let use remove the upgrade path from custom
elements because we can require the registration to happen before the tree
building.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/814173005
2015-01-08 14:48:02 -08:00
Eric Seidel
a251cf3ecb Move Sky's DataPipeDrainer to mojo/common
I want to use DataPipeDrainer in some non-sky code
it seems generally useful (and compiled w/o modification).

R=jimbe@chromium.org, jamesr@chromium.org

Review URL: https://codereview.chromium.org/811873003
2014-12-17 12:16:34 -08:00
Elliott Sprehn
c6f3d36fe2 Simplify HTMLStyleElement.
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
2014-12-09 19:01:46 -08:00
Eric Seidel
295f920116 Fix sky include guards to match Chromium style
I wrote a script to do this which is attached
to the bug.

TBR=abarth@chromium.org
BUG=435361

Review URL: https://codereview.chromium.org/736373003
2014-11-21 02:48:38 -08:00
Eric Seidel
e0fd75b5ab Make absolute and sort all Sky headers
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
2014-11-20 17:42:05 -08:00
Eric Seidel
55b5bc485d Sort headers
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
2014-11-19 12:33:42 -08:00
Elliott Sprehn
a0abae6ce1 Remove parserRemoveChild.
This was for the adoption agency which we don't have anymore.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/734063005
2014-11-17 13:48:49 -08:00
Elliott Sprehn
0a474a4c0b Remove parserInsertBefore.
This code was for the foster parenting algorithm.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/729713003
2014-11-17 13:10:12 -08:00
Elliott Sprehn
42d362ff6b Remove tons of OILPAN.
This removes ::trace, traceAfterDispatch and finalizeGarbageCollectedObject.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/723253004
2014-11-13 16:56:13 -08:00
Adam Barth
5192329f25 Script-based imports should basically work
This CL adds the beginning of a new module loading system that matches the
conceptual module in the spec. I've writed it up to the import API on
AbstractModule. In a future CL, I'll replace the old module loading system with
this one.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/720903002
2014-11-12 13:29:14 -08:00
Adam Barth
a8cf7c7b43 Remove dynamic cast from DocumentPaser interface
This CL cleans up the DocumentParser interface to match what's actually needed
by clients. As part of this cleanup, I've removed the asHTMLDocumentParser
dynamic cast and just exposed virtual functions for the state folks were
accessing via the dynamic cast.

R=ojan@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/722743002
2014-11-12 13:23:50 -08:00
Eric Seidel
5bdc6515b9 Re-land 714393002 after fixing android build.
Original CL:
https://codereview.chromium.org/714393002

Reverted in:
https://codereview.chromium.org/719063002

One fix was to use static_assert instead
of _Static_assert in COMPILE_ASSERT.

_Static_assert is C11, static_assert is C++11
and Android's stdlib doesn't have C11 support,
but we don't care since we never use COMPILE_ASSERT
in plain C code.

The second fix was also for the android STL
and was adding back the nullptr_t type
definition in NullPtr.h for old versions of STL.

I compile this locally for android to verify
that it works
mojo/tools/mojob.py build --android

TBR=jamesr@chromium.org,qsr@chromium.org

Review URL: https://codereview.chromium.org/722723003
2014-11-12 12:16:05 -08:00
Benjamin Lerman
59f42240ba Revert "Remove support for MSVC"
This reverts commit d9cfbefcfe8710f1cb190ae817757853c8058797.

This CL broke android build:
http://build.chromium.org/p/client.mojo/builders/Mojo%20Android%20Builder%20%28dbg%29/builds/248

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/719063002
2014-11-12 13:31:10 +01:00
Eric Seidel
4ab80f640b Remove support for MSVC
I also removed COMPILER_SUPPORTS since
all of the checks were for old versions of
GCC which we no longer support.

Mojo requires GCC 4.8 or later.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/714393002
2014-11-11 16:59:04 -08:00
Adam Barth
b71fee9e48 Move exports from Document to Module
This CL moves the |exports| from Document to the new |Module| interface,
matching the spec. Also, the |module| object available to scripts is now really
an instance of |Module|.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/703593003
2014-11-10 15:34:25 -08:00
Elliott Sprehn
d1e3759806 Remove more oilpan.
I also unraveled lots of transitive deps from Handle.h

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/709203002
2014-11-07 18:11:03 -08:00
Elliott Sprehn
d11b95703b Remove many attributes.
This removes many attributes we don't want from HTMLAttributeNames.in
and the associated code.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/708233002
2014-11-07 16:48:59 -08:00
Elliott Sprehn
ca3b2661ef Remove a lot of API surface from Element.
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/696903002
2014-10-31 16:48:20 -07:00
Adam Barth
fc451b47eb Unfork Sky's trace events
This CL remove the body of Sky's TraceEvent.h in favor of the version in base.
There's still some more of the system to unwind before we can remove all the
other boilerplate.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/691663002
2014-10-30 09:39:46 -07:00
Adam Barth
8385799d73 Fix line numbers in JavaScript stack traces
Instead of calling the function constructor to compile script in Sky, we now
concatenate strings. This has the advantage of making the line numbers
generated in error messages correct but the disadvantage of being a hack. I've
filed https://code.google.com/p/v8/issues/detail?id=3624 to request a proper
API for this purpose.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/688033003
2014-10-29 14:00:57 -07:00
Eric Seidel
70c382c012 Remove wtf/Functional.h
The background parser was the last client.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/684813003
2014-10-28 10:41:02 -07:00
Adam Barth
26813e1c3c Update tokenizer to match spec
This CL is a rough pass over the HTMLTokenizer to align it with parsing.md.
We'll need to do another pass more carefully in the future, but this CL gets us
roughly in the right ballpark.

We're not handling EOF properly. The parsing.md spec doesn't push the EOF
though the parser, which breaks our current way of handling EOF. We do ok if we
get EOF in the DataState, and that's enough to pass the tests for now.

Also, update camel-case.sky to reflect the fact that the parser doesn't
lower-case tag names anymore.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/678263002
2014-10-27 20:38:29 -07:00
Adam Barth
7639e0fe39 Simplify HTMLInputStream
We don't need to deal with all the insertion point complexity.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/683693002
2014-10-27 17:06:10 -07:00
Adam Barth
82cdb4de3b Remove HTMLTokenizerNames
We don't need these anymore.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/682903002
2014-10-27 17:05:46 -07:00
Adam Barth
6df700c6ff Remove HTML entity crazy
This CL removes the bulk of the old HTML entity machinery. We don't need this
anymore.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/680173002
2014-10-27 17:05:17 -07:00
Adam Barth
710a717192 Parse comments according to parsing.md
Now we don't even generate comment tokens. The new tokenizer for comments is
much easier.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/682893002
2014-10-27 17:04:52 -07:00
Eric Seidel
64b5cb61a1 Remove all oilpan transitional types
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
2014-10-27 14:13:01 -07:00
Adam Barth
5d98345d17 Parse Sky entities according to the spec
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/678073002
2014-10-27 13:05:31 -07:00
Adam Barth
1bceb35cdf Remove ScriptData* states
In the new parsing.md spec, we parse <script> the same way as <style> so we
don't need all these tokenizer states.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/678913002
2014-10-27 13:04:45 -07:00
Adam Barth
2e40b82606 Remove more unused HTMLTokenizer features
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/678903002
2014-10-27 13:04:17 -07:00
Adam Barth
51b354f23a Fix bad merge 2014-10-24 22:57:53 -07:00
Adam Barth
22b946ab61 Remove HTMLParserOptions
We always use threading now and there aren't any other options.

R=eseidel@chromium.org, esprehn@chromium.org

Review URL: https://codereview.chromium.org/676133002
2014-10-24 22:49:38 -07:00
Adam Barth
8f729a9b64 Delete DecodedDataDocumentParser
It doesn't do anything.

R=eseidel@chromium.org, esprehn@chromium.org

Review URL: https://codereview.chromium.org/675313003
2014-10-24 22:47:58 -07:00
Adam Barth
61a2a00c78 Live the dream
This CL plumbs the data pipe from the network stack all the way to the parser
thread. We now drain the data pipe on the parser thread, which means network
bytes don't need to transit the main thread to reach the parser.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/664573004
2014-10-24 16:51:56 -07:00
Adam Barth
b07dff7033 Remove the ability to parse HTML fragments
Also, removed a bunch of show() function from the custom element microtask
queue that bottom out in innerHTML.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/665613003
2014-10-24 16:51:11 -07:00
Adam Barth
e8c9ecc556 Use override and final instead of OVERRIDE and FINAL 2014-10-24 15:15:13 -07:00
Adam Barth
08164a0e81 Delete ScriptableDocumentParser
There's only one parser: the HTMLDocumentParser. No need for the complex class
hierarchy.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/680583003
2014-10-24 11:04:40 -07:00
Adam Barth
0bf6b1a8eb Delete HTMLStackItem
The stack now just has ContainerNodes.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/666913005
2014-10-23 16:39:13 -07:00