97 Commits

Author SHA1 Message Date
Elliott Sprehn
d3fbe58e94 Add shadowRootReady callback for SkyElement.
This is called right after stamping the template into the ShadowRoot.
This is a useful place to querySelector/getElementById for elements
inside the ShadowRoot.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/817053002
2014-12-19 14:01:49 -08:00
Elliott Sprehn
c7d8c77498 Add declarataive event handlers.
Now inside the <template> of a SkyElement you can use
on-eventName="method" on any element to add event listeners.

For example you can write <sky-button on-click="handleClick">
and then define handleClick(event) on the element class that
contains the button.

In adding this and tests I also realized that property bindings
were not setup on the initial call to bind(), which is now
fixed in this patch (See change to Node.prototype.bind).

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

Review URL: https://codereview.chromium.org/812713005
2014-12-19 13:10:16 -08:00
Elliott Sprehn
b8ae95165b Implement Node.ownerScope
The ownerScope property is equivalent to walking up the parentNode
pointers until you hit the top and returning that node if it's a
Document or ShadowRoot.

This means that the ownerScope of ShadowRoot and Document is always
itself, and the ownerScope of an Element that is not the descendant
of a ShadowRoot, and is not in the document is null.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/810793005
2014-12-17 16:05:15 -08:00
Elliott Sprehn
bb7f5d05bf Improve custom-elements/generated-constructor.sky test.
We should inherit from HTMLElement, Sky (and blink) don't currently
enforce this but they probably should. We should also explicitly
check that the prototype is what we expect.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/809183002
2014-12-17 15:01:17 -08:00
Elliott Sprehn
4a9e21a78c Custom elements should have class side inheritance.
We were not setting the __proto__ property of the generated constructor
so the generated class didn't inherit from the passed class which meant
that statics were not available.

This patch adds the missing call to setPrototype (which sets __proto__).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/814683002
2014-12-17 14:24:34 -08:00
Elliott Sprehn
0ef7c1c7ba Fix attribute selectors.
There was a return missing in SelectorChecker, we were also making
the attribute names lowercase which is not neccesary in Sky.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/815613002
2014-12-17 14:00:17 -08:00
Eric Seidel
a9776838ee Add POST support to XHR as well as .status and statusText support
Also fixed all the XHR tests to actually run and work
I learned from elliot that the it function has to
take a "done" argument to be treated asynchronously.

My utf8 conversion is a hack, but we deleted
window.TextEncoder (it was a module) when we forked.
We could resurrect TextEncoder (and probably should)
but I've left that for a separate change.

I also augmented sky_server to have a special /echo_post
handler so we can test POST requests.

R=esprehn@chromium.org
BUG=

Committed: 5ef81d249b

Review URL: https://codereview.chromium.org/810523002
2014-12-16 11:20:40 -08:00
Eric Seidel
1fb39d65dd Revert "Add POST support to XHR as well as .status and statusText support"
This reverts commit 5ef81d249b841f44c9593ffb0158d64c7e0febfc.

This appeared to make 5 XHR tests timeout.  Not sure why yet.
TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/808663002
2014-12-15 18:37:44 -08:00
Eric Seidel
6f33a75051 Add POST support to XHR as well as .status and statusText support
Also fixed all the XHR tests to actually run and work
I learned from elliot that the it function has to
take a "done" argument to be treated asynchronously.

My utf8 conversion is a hack, but we deleted
window.TextEncoder (it was a module) when we forked.
We could resurrect TextEncoder (and probably should)
but I've left that for a separate change.

I also augmented sky_server to have a special /echo_post
handler so we can test POST requests.

R=esprehn@chromium.org
BUG=

Review URL: https://codereview.chromium.org/810523002
2014-12-15 16:09:51 -08:00
James Robinson
d51de7b23a Add fake implementation of Surfaces service
BUG=
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/804693002
2014-12-15 12:16:31 -08:00
Ojan Vafai
0fcf250d03 Make reftests work for sky.
-Add a --testing flag to sky_viewer and cause it to paint into an
SkBitmap instead of a ganesh surface so we can get the pixels out.
-Add GetPixelsForTesting to layer.cc to actually grab out the pixels.
-Add a reftest and a mismatch reftest. They need a setTimeout after
the load event. Unclear why or what the right fix is. Maybe we should
give internals some way to force the paint? If we don't have the
setTimeout, we paint a white page (so we do a paint, but with no
content).
-Add a DisplayDelegate to Layer so that Viewer can decide whether
to use the real ganesh backend or the SkBitmap one without littering
the whole code-base with is_testing bools and logic.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/797063002
2014-12-12 16:45:49 -08:00
Eric Seidel
e2271c6dfa Fix test expectations
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/800103002
2014-12-12 12:53:01 -08:00
Eric Seidel
6bd317d504 Add responseType='arraybuffer' support to XHR
Also moved existing XHR tests from tests/services
to tests/framework to better match the location
of the XHR code itself.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/805503002
2014-12-12 12:03:50 -08:00
Eric Seidel
870da02623 Fix hit-testing
It was broken during removal of RenderLayer::collectFragments:
https://codereview.chromium.org/778043005/

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

Review URL: https://codereview.chromium.org/791933004
2014-12-12 09:25:48 -08:00
Ojan Vafai
8971e980cd Prepare python code for reftests.
-s/-expected.html/-expected.sky/
-s/-expected-mismatch.html/-expected-mismatch.sky/
-In single_test_runner.py, get rid of the image hash checking
for reftests. It doesn't provide any value and just makes
getting reftests working more complicated.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/802573002
2014-12-11 15:24:02 -08:00
Colin Blundell
ac99b9896f Restructure public side of input_events service.
This CL goes from this:
  //mojo/services/public/interfaces/input_events

to this:
  //mojo/services/input_events/public/interfaces

This CL also makes the Mojo-side changes necessary to roll this change into
Chromium.

TBR=beng

Review URL: https://codereview.chromium.org/788353002
2014-12-10 22:50:57 +01:00
Rafael Weinstein
f38f80c9f8 Enable/Unprefix Animations & Transitions, add basic tests
This patch remove the Web Animations & CSS Animation runtime flags (and enables both). Removes prefixed Aninamations & Transitions and adds some basic tests & test support API.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/760183003
2014-12-10 10:38:34 -08:00
Colin Blundell
a450ba1353 Restructure public side of network service.
This CL goes from this:
  //mojo/services/public/cpp/network
  //mojo/services/public/interfaces/network

to this:
  //mojo/services/network/public/cpp
  //mojo/services/network/public/interfaces

This CL also makes the Mojo-side changes required to roll this change into
Chromium.

TBR=beng

Review URL: https://codereview.chromium.org/789243002
2014-12-10 16:28:40 +01:00
Elliott Sprehn
dfd9a3faa5 Add clear() to Element.classList.
We should support a fast way to remove all classes through the
classList instead of having to call removeAttribute() directly.

BUG=440529
R=ojan@chromium.org, rafaelw@chromium.org

Review URL: https://codereview.chromium.org/788093003
2014-12-09 17:56:41 -08:00
Rafael Weinstein
fe9aa27ab5 Fix id/class collection from stylesheets
BUG=438036
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/785313002
2014-12-09 15:05:42 -08:00
Ojan Vafai
2c71f77297 Get rid of background-clip:text and PaintBehaviorForceBlackText.
http://blog.ericzhang.com/punch-through-text-masks-with-css-and-html5/
shows that you can achieve the similar effects using canvas. This
doesn't need to be built into the core engine. It's OK for this
to require more than a line of CSS to achieve.

Unfortunately, the test included this this patch doesn't actually
show that I didn't break anything because background-image
is broken. I got the test from
47e0d126e8%5E%21/#F4

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/756183004
2014-12-04 12:15:39 -08:00
Ojan Vafai
96648748fb Remove PaintLayerPaintingChildClippingMaskPhase.
It's never set. It was added in
7176977ba5%5E%21/#F21

The test cases from that patch seem to pass.
Included one in this patch.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/772193004
2014-12-02 20:12:23 -08:00
Elliott Sprehn
f1a6cd9799 Use a JS markup serializer.
This makes MarkupAccumulator and all related code into dead code.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/771093002
2014-12-02 10:09:35 -08:00
Elliott Sprehn
697e47cf3b Add tests for changing classList.
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/776493002
2014-12-02 10:05:28 -08:00
Ojan Vafai
82b607721d Make fixed-width elements not center by default.
e223e0c6d51f027196a2597b556641328a65d4b5 accidentally
sent all elements down the margin:auto codepath.
The patch incorrectly removed just the
"&& containingBlockStyle->textAlign() == WEBKIT_CENTER"
instead of the whole clause.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/760143002
2014-11-26 16:39:41 -08:00
Elliott Sprehn
253b5bed74 Only allow one shadowRoot.
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/759663003
2014-11-26 13:54:14 -05:00
Adam Barth
4816213fa9 Mocha shouldn't wait for an animation frame
When we run the tests headless, we never actually put up frames, which means we
never generate animation frames. In this mode, we might want to generate fake
animation frames (like DRT does), but for now just use a timeout to make the
tests work again.

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

Review URL: https://codereview.chromium.org/758113003
2014-11-25 11:20:47 -08:00
Adam Barth
eee03d7d8a Fix race condition in test
The |done| function comes from |it| not |describe|. Previously, we were just
ending the test right away.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/754463003
2014-11-21 16:08:31 -08:00
Rafael Weinstein
acf6d9f29d setChildrenInline wasn't doing anything and childrenInlien always deferred to isRenderParagraph.
Also, add a test from the original webkit patch that called setChildrenInline in layoutBlock

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/748943002
2014-11-21 15:16:58 -08:00
Ojan Vafai
fe66ba3f36 Fix text-overflow:ellipsis.
This regressed in 3db9471ae80bd492f2a346113d2323ba8eee0c09.

Accidentally sent some code down the override by sending the
top LayoutUnit instead of the left/right LayoutUnit. The
root problem was bad overloading, which is also fixed in
this patch. Inlined the overloaded method since one of
the calls was only called from one place.

The new test demonstrates the ellipsizing, but that doesn't
show through in the render tree dump. We don't get real
test coverage here until we either start doing pixel tests
or start exposing ellipsis in the render tree dumps.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/751483002
2014-11-21 11:26:05 -08:00
Elliott Sprehn
4e68e8f732 Enable ES6 classes.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/742183002
2014-11-20 10:55:28 -08:00
Matt Perry
7f17e0b4b9 Unrevert "Sky: When an iframe element is removed, delete its mojo View."
This reverts commit acec66c735d6a40d3da3e0e9a6ee5f278bdfe043.

Scott thinks he fixed the crash.

BUG=434555
TBR=sky@chromium.org

Review URL: https://codereview.chromium.org/740383002
2014-11-20 11:13:16 -05:00
Eric Seidel
6edf567bd9 Fix typo in TestExpectations
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/741823002
2014-11-19 13:04:33 -08:00
Matt Perry
2a60db84ea Revert "Sky: When an iframe element is removed, delete its mojo View."
This reverts commit 45991a3752e6a6298901eba36e7bf4cdec4d263c.

It was causing flaky crashes on the bots.

TBR=esprehn@chromium.org
BUG=434555

Review URL: https://codereview.chromium.org/740773002
2014-11-19 15:13:28 -05:00
Eric Seidel
450f56bafa Mark page-get-resource-tree as flaky
At least until we can get results from the bot
to understand why it's failing there.

BUG=434822
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/739293002
2014-11-19 12:12:25 -08:00
Eric Seidel
b2f116033a Revert "Attempt to fix page-agent-get-resource-tree on the bot"
Didn't actually fix the bot:
http://build.chromium.org/p/client.mojo/builders/Mojo%20Linux/builds/321/steps/mojob%20test/logs/stdio
so there is no point in keeping this change.

This reverts commit 4e50a3cdf887a77adfb0adf5f4e5ebc42a2d99f7.

TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/742783003
2014-11-19 12:01:15 -08:00
Eric Seidel
fef9b7b0fb Attempt to fix page-agent-get-resource-tree on the bot
Unclear why it's failing since we don't have
output from the bot, but this seems like a reasonable guess.

TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/742813002
2014-11-19 11:54:16 -08:00
Adam Barth
4ad4c66eba Add a trivial test
As an experiment to see if it ever fails.

TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/725853003
2014-11-18 17:11:18 -08:00
Elliott Sprehn
b9aaf7d8e2 Clean up child checks in ContainerNode.
We can simplify the checks given that there's fewer node types now. This does
make the error messages from Range a little worse, but it's weird that Range
is doing its own error checking anyway.

I also took this as an opportunity to add a bunch of DOM tests.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/732203004
2014-11-18 16:49:48 -08:00
Eric Seidel
0ca1069cd4 Add support for Page.getResourceTree
Unfortunately we don't yet have a way to walk into
imports, so this only is the first-level of the
source tree, but this is a huge step forward.

You can now click to set breakpoints, however
setting breakpoints crashes sky.

I had to fix Console.log to flush stdout
so that I could actually debug my timing-out test.

Also had to fix Chai to dump differences for deepEqual.

R=esprehn@chromium.org, abarth@chromium.org, esprhen@chromium.org

Review URL: https://codereview.chromium.org/732413004
2014-11-18 15:53:13 -08:00
Eric Seidel
593c8f8de3 Wire up more of the DebuggerAgent
The debugger can now correctly break on exceptions
and show the corresponding line in the inspector.

It correctly understands which scripts are internal
to sky and does not pause during them.

There is still a ton to make work here
(including stacktraces which I have not tested),
but basic functionality seems to work.

The current implementation is not smart enough to
unpause the inspector when the frontend disconnects.

BUG=434510,434513
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/727593004
2014-11-18 15:05:05 -08:00
Eric Seidel
a511ef074a Teach XHR how to handle relative urls.
Hixie says window.URL may not exist yet in the
sky specs, but I'm sure we'll need something like it.

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

Review URL: https://codereview.chromium.org/729913003
2014-11-18 11:15:56 -08:00
Matt Perry
14ec13d9c0 Sky: When an iframe element is removed, delete its mojo View.
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/733063007
2014-11-18 14:00:05 -05:00
Ojan Vafai
7a37fa8c09 First step at getting rid of anonymous blocks and continuations.
-Add RenderParagraph and display:paragraph. This is the only
render type that's allowed to contain inlines or text.
-If you put text nodes directly in a non-paragraph, wrap them
in an anonymous paragraph. This may not be the place we want
to end up, but it's a good stopgap to make it so we don't
crash in this case.
-Make StyleAdjuster force that non-paragraph blocks only contain
RenderBlock subclasses and that paragraphs and inlines only contain
inlines.
-Considerably simplify addChildIgnoringAnonymousColumnBlocks
now that we only create anonymous blocks for the case of
text nodes in non-paragraphs. Also get rid of the behavior
where we try to group multiple nodes into a single
anonymous block.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/729693003
2014-11-17 18:39:52 -08:00
Adam Barth
99727c2ec4 Mark flaky tests as flaky
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/734783002
2014-11-17 15:04:18 -08:00
Matt Perry
d091d0474c Sky: Change iframe positioning to use absoluteContentBox for the View's
coordinate system.

This fixes a bug where the iframe's view would be positioned incorrectly if there were elements above it.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/730253002
2014-11-17 17:38:27 -05:00
Elliott Sprehn
8409c0e386 Add a version of flights that's made of components.
Also add a test, this checks nested Shadow DOM and <content> with
and without select.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/725763003
2014-11-14 15:00:12 -08:00
Ojan Vafai
052cb893ad Add a basic img test.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/732763002
2014-11-14 13:58:19 -08:00
Benjamin Lerman
9894ef82e0 Revert "Add a version of flights that's made of components."
This reverts commit e8fdb90bca3120d1c991256a2adf83a8315bf867.

This CL breaks the linux bots:
https://chromegw.corp.google.com/i/client.mojo/builders/Mojo%20Linux/builds/216/steps/mojob%20test/logs/stdio

TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/722103002
2014-11-13 09:59:26 +01:00
Elliott Sprehn
b9a6e48dcb Add a version of flights that's made of components.
Also add a test, this checks nested Shadow DOM and <content> with
and without select.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/724613002
2014-11-12 18:42:24 -08:00