753 Commits

Author SHA1 Message Date
Ojan Vafai
fc1dff4288 Expose minContentWidth/maxContentWidth and a callback for computing them.
This exposes the last hooks needed to implement flexbox layout. For now,
I didn't worry too much about the exact API we're exposing since this will
all change with the upcoming redesign (e.g. https://codereview.chromium.org/1093633002).

minContentWidth == the width if the element were to wrap at every wrapping point (not including border/padding)

maxContentWidth == the width if the element were to only wrap at hard wrapping points (e.g. \n inside a whitespace: pre).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1101793003
2015-04-24 13:14:41 -07:00
Eric Seidel
31f36426b2 Fix display of 404s in SkyShell to show error text.
In MojoShell we never hit this path since the NetworkFetcher
aborts earlier on, not knowing what content_handler to use.

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

Review URL: https://codereview.chromium.org/1080993005
2015-04-21 15:38:12 -07:00
Viet-Trung Luu
ab3c30d97e Roll skia to 409fd66a5afcef5f165f7ccec7c3473add231752.
R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/1100833002
2015-04-21 13:15:25 -07:00
Ryan Macnak
a6ffc52bea Ensure isolates have a root library so createMirrorSystem() and spawnUri() are happy.
https://github.com/domokit/mojo/issues/98

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1088263004
2015-04-16 15:49:11 -07:00
Ojan Vafai
c8d918efa9 Make changing your layout manager work.
If your layout manager changes, then you need to setNeedsLayout,
otherwise the next frame doesn't even get scheduled. We already
correctly handle going from not having layout to having one or
vice versa by doing the more drastic reattaching since that
requires changing your actual render class.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1060013005
2015-04-15 11:08:32 -07:00
Ojan Vafai
a1d93b2847 Fix getChildElements.
It was returing all element descendants instead of all element
immediate children.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1048333006
2015-04-14 16:40:58 -07:00
Ojan Vafai
7c974ed8cd Fix crash when removing layout managers.
We weren't correctly marking an element as needing style
recalc if it was *losing* it's layout manager. We were
only doing so when it was gaining a layout manager for
the first time.

Review URL: https://codereview.chromium.org/1082273004
2015-04-14 13:57:07 -07:00
Eric Seidel
9fa6ca170a Teach window.location.href setter to handle relative urls.
Also fixed display of text in touch-demo.sky

R=ianh@google.com

Review URL: https://codereview.chromium.org/1059743004
2015-04-14 12:16:51 -07:00
Eric Seidel
03b16f05b5 Remove needless comments in CSSValueKeywords.in
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/1056433004
2015-04-13 13:10:18 -07:00
Eric Seidel
cc43ccec9a Remove LineFragmentationData it's unused
TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/1063633006
2015-04-10 13:34:37 -07:00
Eric Seidel
3f96f9344e Remove -webkit-user-drag
Also cleaned up some uneeded comments in CSSValueKeywords.in

TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/1076353003
2015-04-10 13:01:18 -07:00
Eric Seidel
5f7fdbc33a Remove completely-unused CSSValueKeywords
I wrote a little script to try removing each
non-comment line of this file and re-compiling.

This was the result of said script.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1076313003
2015-04-10 11:54:29 -07:00
Ojan Vafai
9a7eb76c46 Remove dead code around anonymous renderers.
There's no way to create anonymous renderers anymore.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1070233002
2015-04-10 11:34:46 -07:00
Hixie
64a36de094 remove 'page' and 'size' since those are for printing, and that's obsolete in our world now
Also it seems we're not parsing @page rules anyway, so this was presumably dead code.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1078883003
2015-04-09 15:07:21 -07:00
Eric Seidel
51e1b37ba2 Remove empty-cells
The world may never know what to do with empty cells?

Besides.  This was mislabled as layout, it was clearly a paint
property. :p

R=ianh@google.com

Review URL: https://codereview.chromium.org/1074953004
2015-04-09 14:54:17 -07:00
Eric Seidel
8b5c8d86df Remove CSS table-layout property.
It's dead Jim.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1075023002
2015-04-09 14:45:06 -07:00
Eric Seidel
bfbf14317f Remove page-break properties and captions
We want some sort of per-screen breaking, but this
CSS is not the way to do it.  All of this was already
dead code.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1070313003
2015-04-09 14:39:17 -07:00
Hixie
9d8066aa56 remove 'widows' property because paged media support is gone so this does nothing now
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1078943002
2015-04-09 14:35:27 -07:00
Eric Seidel
9cdf9ad09f remove CSS quotes property
The support was gone, this is just dead code.

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

Review URL: https://codereview.chromium.org/1070263002
2015-04-09 14:22:29 -07:00
Eric Seidel
9d740cb769 Remove CSSPropertySpeak
This does not belong in CSS in Sky.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1068383005
2015-04-09 13:25:41 -07:00
Ojan Vafai
a8eda9b380 Remove dead createAnonymous functions.
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1077453002
2015-04-09 11:40:53 -07:00
Ojan Vafai
b9f182a6bd Stop rendering text inside flex boxes.
Text can only only inside paragraphs and inlines. This patch makes it
so we stop putting such text nodes in the render tree at all if their
parent is not a paragraph or an inline.

This is the final step in making it so that we don't create anonymous
renderers, which fixes a crash in the new custom layout code.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1077473002
2015-04-09 11:40:03 -07:00
Hixie
ac53fad655 drop 'orphan' property, since it's for paged media and we don't support paged media any more
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1068073002
2015-04-09 09:24:49 -07:00
Viet-Trung Luu
4a90c329d1 Fix Android build.
RenderStyle apparently got smaller.

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

Review URL: https://codereview.chromium.org/1067293003
2015-04-08 16:37:40 -07:00
Eric Seidel
a118cc707c Remove CSS list-style
We don't have lists.  So they can't be styled.

Dead code be dead.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1069403003
2015-04-08 15:03:38 -07:00
Eric Seidel
afaac6ec79 Remove our impressive amount of CSS Cursor code.
With this gone, cursors will no longer change
on hover when running Sky on a desktop.

Then again the iGeneration doesn't
probably even know what a mouse is, let alone
have a burning desire to set a CSS3 custom-cursor.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1076623002
2015-04-08 14:23:13 -07:00
Eric Seidel
64e97bbea8 remove CSS 'all' property.
The human mind is simply not capable of beholding the
sheer power of the CSS 'all' property.  We shall remove it
now and leave its echo for generations to contemplate.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1068393002
2015-04-08 13:39:47 -07:00
Eric Seidel
1381402a70 Remove obsolete CSSProperties.in -webkit- aliases.
Just writing a C++ patch for a change to feel productive. :)

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1072613002
2015-04-08 13:31:27 -07:00
Ojan Vafai
3029d211d7 Fix ink splashes in stocks app.
https://codereview.chromium.org/1061163002 lost the default
value of stretch for align-items on flex boxes. We used to
have complicated rules where only flex boxes would default to
stretch. Now that we only have flex boxes, we can just make
it the default in RenderStyle.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1076543002
2015-04-08 12:27:49 -07:00
Ojan Vafai
b9df2edb7d Delete RenderBlockFlow.
We only ever create RenderParagraphs now. The only non-trivial change here
is making RenderView a RenderFlexibleBox. This required changing custom.sky.
That test was written in a fragile way that behaved differently if we
did multiple layouts. Instead, having it be less racy and only change
values during the test itself.

This also throws a wrench in moving all the layout code to dart
because we can't set the layout manager on the RenderView. Maybe
we need to explicitly let you do so.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1068683002
2015-04-07 16:59:36 -07:00
John McCutchan
ee061ddf28 - Rename "nodefer" to "immediate" (gets rid of double negative in "nodefer: false").
- Immediate close means that anything pending will be discarded.
- Plumb immediate all the way down to the handle watcher close call.
- When an EventStream is closed because no one is listening for events, close immediately.
- Don't call Dart_NewSendPort with ILLEGAL_PORT in sky embedder.
- Bump DEPS to include fixes for Dart_NewSendPort and profiler signal handler executing after shared object is unloaded.
- Fixes https://github.com/domokit/mojo/issues/79

R=zra@google.com

Review URL: https://codereview.chromium.org/1060193002
2015-04-07 12:59:58 -07:00
Ojan Vafai
970f42b8d7 Remove parsing for display:block/inline-block.
The default is now column flexboxes, which are almost the
same as blocks.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1060223002
2015-04-06 19:19:36 -07:00
Ojan Vafai
88f38ce0e6 Remove all uses of display:block and display:inline-block.
-Make display:flex, flex-direction: column, flex-shrink: 1 the default.
-Simplify StyleAdjuster::adjustStyleForAlignment to remove special cases we
won't need as we make flex the default and remove absolute positioning.
-Fix a bug this exposed in column flexboxes where we'd apply the wrong edge
of border/padding/margin.
-For now leave the default of align-items:stretch. The main change here is
that iframe/img will do width:auto the same as blocks (i.e. the width of
the parent). I think this is a good change, but we'll have to see how it feels
in practice.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1061163002
2015-04-06 16:44:12 -07:00
Ojan Vafai
6bfa21b190 Make custom layout actually work.
-Temporarily add setting override width as well so that we correctly bypass in RenderBox::computeLogicalWidth.
-Add setNeedsLayout so that the author code can force layouts (e.g. when the container's width changes).
-Have setLayoutManager force a reattach of the element if it's renderer wasn't a custom layout one before.
-Remove the laying out of children from RenderCustomLayout::layout. This is the job of the author code.
-Add a test case.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1055263002
2015-04-06 12:53:35 -07:00
Ojan Vafai
4fb43c315a Remove the x,y,width,height methods from HTMLImageElement.
They've already been removed from the idl.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1055323002
2015-04-06 11:39:48 -07:00
Ojan Vafai
ef34102c3b Revert "Revert "First iteration on custom layout.""
This reverts commit 44cf3b689cda2632fa649e2cd3fdbfcb7174f352.
https://codereview.chromium.org/1060443002 fixes the cause
of the test breakage.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1055243002
2015-04-02 15:17:10 -07:00
Ojan Vafai
7e1ca8fc6f Remove x,y,width,height from HTMLImageElement.
This conflicts with adding them to HTMLElement for custom layout.
I grepped the codebase and couldn't find any uses of these. The
big thing we lose here is a way to set width/height on an image
that automatically maintains aspect ratio, but that's something
we should move into a custom layout method anyways.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1060443002
2015-04-02 15:15:43 -07:00
Siva Annamalai
9f0601b18e gen_snapshot now generates two snapshot buffers, one for the vm isolate
and another for a regular isolate. These changes account for that change
in the mojo and sky snapshot generation scripts and the controller files.

R=zra@google.com

Review URL: https://codereview.chromium.org/1047883002
2015-04-02 11:31:29 -07:00
Benjamin Lerman
f1ee3cc379 Revert "First iteration on custom layout."
This reverts commit 4223122b79f5f7740bb2957138d14a63a2cea8d2.

This breaks sky tests.

TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/1051713007
2015-04-02 10:38:03 +02:00
Ojan Vafai
aecc73f1f5 First iteration on custom layout.
This allows setting x/y/width/height directly on an element
during a synchronous layout callback. At the moment, you can do
dangerous things (e.g. change tree structure). In a followup patch
we'll make that impossible via an IDL guard.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1023753007
2015-04-01 19:16:29 -07:00
Hixie
68ef9853ef mark obsolete CSS properties
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1036953003
2015-03-26 09:03:25 -07:00
Adam Barth
0dd797975c Remove <canvas>
Folks should use custom paint instead (see sky/engine/core/painting for a
sketch).

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1001913003
2015-03-25 16:15:05 -07:00
Adam Barth
8e37b98cfc StocksApp hits an ASSERT when bringing up search
Previously we'd hit an ASSERT that elements in the style sharing list support
style sharing. However, it can happen that an element gets added to the style
sharing list and then loses the ability to share styles because it has an
active animation. This CL works around the problem by skiping over those
elements when considering style sharing candidates. A better solution would be
to clear the style sharing list when it might contain such an element. However,
it's likely we will remove style sharing in the future so its easier to just
work aroudn the issue for now.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1036933002
2015-03-25 16:08:40 -07:00
Adam Barth
018bf2ba17 Add tracing for major GC in Sky
Ideally we'd trace VM operations from inside the VM, but we don't yet have
DartVM wired into tracing. Instead, we use these GC hooks to trace how long
major GC takes.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1031083003
2015-03-25 10:46:19 -07:00
Alhaad Gokhale
215b98c91b Chromium -> Mojo roll.
Update from https://crrev.com/321900

Changes:
(1) OpenTypeSanitizer.cpp: Removed use of ots::EnableWOFF2() which was
removed from library and implementation was empty anyways.
(2) GraphicsContext.cpp: Header location for SkMatrixImageFilter.h moved.
(3) SkiaImageFilterBuilder.cpp: Header location for SkMatrixImageFilter.h moved.
(4) FEDropShadow.cpp: Function signature changed.

R=davemoore@chromium.org, jamesr@chromium.org
BUG=453591

Review URL: https://codereview.chromium.org/1028333002
2015-03-24 10:49:34 -07:00
Adam Barth
f3df64fa3d Let Dart code running in Sky add events to the trace timeline
This will let us form a wholistic picture of work done in the framework and in
the engine.

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

Review URL: https://codereview.chromium.org/1028243003
2015-03-23 14:48:06 -07:00
Zachary Anderson
d83427c165 Dart: Removes all but native calls and the handle watcher from the snapshot.
The bindings, core, and application libraries are now referred to as, e.g.:

package:mojo/public/dart/core.dart

Since the handle watcher remains in the snapshot, it no
longer refers to types defined in core.dart. References to types defined
in core.dart are also removed from mojo_natives.cc.

In Dart packaged apps, the SDK is zipped up under mojo/public/dart.

For embedder tests, the SDK is copied into the generated source output directory.

A base_dir parameter is added to the 'dart_package' and 'mojom' GN macros so that
consumers of the Mojo SDK can all import using the same URIs regardless of where
the SDK lives in their source trees.

BUG=
R=erg@chromium.org

Review URL: https://codereview.chromium.org/1027603002
2015-03-23 11:04:03 -07:00
Adam Barth
e26810b1de Add more tracing to Sky
This CL adds trace events:

1) Between requesting a frame and begin frame.
2) In the DartLoader see network latency.
3) While executing |main| and |_init|.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1025073003
2015-03-20 16:11:39 -07:00
Adam Barth
43ebba749b Add more trace events to Sky
These will help us better understand what's happening.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1027913002
2015-03-20 15:07:24 -07:00
Adam Barth
f8b3596df6 Use StyleNode in StockMenu
StockMenu was creating a container for the sole purpose of applying style to
PopupMenu. Now we just use a StyleNode.

Also, I've reverted the change to make box-sizing default to border-box. It
turns out that CL wasn't effective because we didn't use the initialBoxSizing
function to initialize box sizing. I've made us use initialBoxSizing but switch
the default back to content-box because actually using border-box breaks a
bunch of stuff.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1024083003
2015-03-20 10:16:24 -07:00