This also fixes the C++ side to give the right baseline information.
Previously it was giving the baseline distance for the font, but not
for the actual laid-out text.
I considered also providing a "defaultBaseline" accessor that returns
the distance for the actual dominant baseline, but it turns out right
now we never decide the baseline is ideographic. We always use the
alphabetic baseline. We should probably fix that...
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1200233002.
This CL factors the network interactions out of DartLoader into a
DartLibraryProvider interface, paving the way for other library providers
(e.g., offline).
As part of this CL, I've renamed DartLoader to DartLibraryLoader and moved the
class into tonic, where it can't have any direct network dependencies.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1202283004.
This CL adds the ability to load Dart snapshot files created by sky_packager in
Sky. Using a snapshot lets us transmit all the code for an app in a single blob
and should improve startup time. Later CLs will make this codepath easier to
use and evaluate performance.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1197133004.
This CL makes it possible to build sky_shell on Linux. It doesn't do much, but
it doesn't crash on startup. The goal is to evetually be able to test sky_shell
on the bots and to be able to run the test_sky on Mac.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1202323002.
This file doesn't belong in the SDK because it is an implementation detail of
the Sky engine. Instead, this CL moves the code for dart:sky.internals into the
snapshot. This CL is a step towards merging dart:sky.internals with dart:sky,
which also resides in the snapshot.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1200953007.
This returns us to a more stocks1-like arrow style.
Also it uses math rather than transforms to rotate the arrow, since transforms are expensive.
It also removes the save/restore calls, which are _really_ expensive.
Also some minor style fixes.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1203443007.
The relayout subtree root concept is intended to handle the case where
a node, when it lays itself out for a second time, changes its opinion
about what dimensions it should be. In such a situation, the parent,
if it based its own opinion about what size _it_ should be on the
child's dimensions, would also need to lay itself out again. Thus,
when this scenario is possible, the child remembers the parent, and
when it would be told to relayout, we actually start the layout with
the parent.
In practice, this chains, and we end up with nodes that point to
ancestors ten or more steps up the tree such that when the inner most
child re-lays-out, the whole app ends up relaying out.
This patch tries to short-circuit this for the case where the
constraints being applied to the child are such that actually, the
child has no choice about its dimensions. In that case, the parent
can't change dimensions when the child re-lays-out.
This makes a huge difference on the stocks demo app. Without this, on
the third rendered frame, there are 72 relayoutSubtreeRoot links, the
deepest chain is 8 deep, and 9 of the chains are only 1 level deep.
With it, there are 63 relayoutSubtreeRoot links, the deepest chain is
only 4 deep, and 38 of the chains are only 1 level deep.
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1196553004.
Previously, the wavy underline code only knew how to draw a complete
period.
This change adds the ability to draw a partial period of the wave.
Previously, the code tried, but failed, for reasons I cannot
determine, to fit the width of the inline by extending the period to
be an integral factor of the width.
This is bad because as you type text, the underline wave of earlier
characters would jiggle.
This fixes that by not changing the period of the wave when the length changes.
It's interesting to compare this to the previous code. Here's a test
that shows this in Safari/Chrome:
http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=3543
Notice how as you type "i"s, the underline changes how far it extends
(obviously a bug) but also what the period of the wave is (which looks
especially ugly when typing).
Firefox, on the other hand, renders something that isn't actually a
wave; it's a saw-tooth pattern with straight lines between each
direction change. This works for small font sizes at low densities,
but is not great on modern screens.
This CL addresses this issue by computing the bezier curve control
points for the curve that consists of just the remaining fraction of
the period. To do this, however, it allocates an object and solves a
bezier for x (which includes a numerical integration), which is
certainly a performance concern. Apps that try to wavy-underline an
entire UI are going to maybe suffer. Since this is typically going to
be used for spelling checkers, it means people who spell better will
have better performance.
(I haven't tested this to see what the perf impact actually is. If
it's actually bad, we can probably cache the results of the
integration pretty trivially.)
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1189403005.
Update sky_server:
- update its help string to admit that it wants the package path as well.
- be quiet by default, since it makes the build chatty.
- have a -v for verbose mode, for people who like it chatty.
- have a default port of 8000, since that's what everyone used.
- have a -p option to set the port, for people who don't use the default.
- remove its mapping for gen/, since a TODO told me to.
- remove the dependency on the build configuration, since it's no longer used.
- teach it about .dart files.
- rename sky_server/README to README.md, for consistency with other READMEs.
Update shelldb to speak the new sky_server protocol.
Update tests/services/iframe-embed-vmc.sky since the sky_server change broke the hack it was using.
Update skyserver.py to speak the new sky_server protocol.
Make webkitpy use SkyServer instead of spawning sky_server itself, since a TODO told me to.
Teach webkitpy about dart files.
Teach test_perf about dart files. (untested)
Teach sky_tool about main.dart, main.sky is deprecated. (untested)
R=eseidel@chromium.org
Review URL: https://codereview.chromium.org/1200993002.