[SVG] Resources should be laid out in dependecy order.

We're currently laying out resources in tree order, while they are
(conceptually) forming a DAG - and this disconnect results in
complicated logic and an extra layout pass attempting to re-validate
nodes that might have been invalidated by the resource layout. This is
broken in (at least) two ways:

  * two passes are not guaranteed to be enough, we could need an
    arbitrary number of passes to stabilize the tree.
  * the re-layout logic hangs off RenderSVGRoot, and falls apart when
    multiple root nodes are present (html doc with multiple svg fragments).

Recently introduced asserts are testing for render tree nodes which are
still marked for layout at paint time, and are catching several invariant
violations due to the above.

To address this problem, we should lay out resources in transitive
dependency order (where node A depends on resource B if it references
it directly: <rect id="a" filter="url(#b)"/>). Turns out this is not as
complicated as it sounds, and we can avoid building an explicit resources
DAG because we already have the sparse version: each node tracks the list
of resources it is referencing.

So before laying out a node, we should ensure that its resources are laid
out first. Applying this recursively, we are effectively traversing the
dependency DAG in the correct order.

(This relies on the assumption that a resource' layout does not depend on
its in-tree parent layout - which should be the case as resources only
make sense in the context of their clients).

The CL also removes the RenderSVGRoot re-layout logic added in
http://trac.webkit.org/changeset/111601 as it is no longer needed: a
resource is now guaranteed to be laid out before any of its clients.

BUG=282925,294237,294238
R=pdr@chromium.org,schenney@chromium.org,dschulze@chromium.org,ojan@chromium.org,eseidel@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23785014

git-svn-id: svn://svn.chromium.org/blink/trunk@158480 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Cleanup and rename DocumentEventQueue::enqueueOrDispatchScrollEvent to enqueueScrollEvent

This method never actually fires an event, it always enqueues one so we can rename it.
We can also detect if the target is a Document by using isDocument instead of having
the extra enum argument. I also changed it so that we don't create a new Event only
to discard it when one is already scheduled.

BUG=299317

Review URL: https://chromiumcodereview.appspot.com/24928002

git-svn-id: svn://svn.chromium.org/blink/trunk@158481 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove custom getter for Clipboard::types().

Also fixes an old bug where we would return null instead of an empty
list and another bug that prevents RVO from being applied.

BUG=226785,226903

Review URL: https://chromiumcodereview.appspot.com/24936002

git-svn-id: svn://svn.chromium.org/blink/trunk@158482 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Use fast default constructors for containers.

LayoutUnit() is fast; LayoutUnit(int) is slow because of bounds-checks.
Since the default constructor sets the m_value of the LayoutUnit to 0,
we can replace calls to LayoutUnit(0) with the default constructor.

Doing this for just these two files yields 5% speedup on the Blink
Layout performance test layers_overlap_2d.html.  It isn't just an
artifact of our artificial performance tests; we see LayoutUnit(int)
as 6% of a CPU profile on both Android and Linux for the page
http://allegro.pl/listing/listing.php?string=nexus+4.

BUG=299661
R=eae@chromium.org

Review URL: https://chromiumcodereview.appspot.com/24997004

git-svn-id: svn://svn.chromium.org/blink/trunk@158483 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Changed runtime flag from 'test' to 'stable' for distributing extra logical height to rowspans.

Rowspan feature have completed and all the regressions have fixed. Now we
want this feature by default in the build and test this feature in normal
build. So we are changing runtime flag from status=test to status=stable
for some time and later we will remove the runtime flag permanently from it.

R=jchaffraix@chromium.org
BUG=78724

Review URL: https://chromiumcodereview.appspot.com/24971002

git-svn-id: svn://svn.chromium.org/blink/trunk@158484 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Don't call deviceOrPageScaleFactorChanged for each Frame.

I am not sure why, but we bug ChromeClient for each Frame, as we recursively descend
into the frame tree. I don't think that's right. FTFY.

Should not have any behavior change.

R=abarth, eseidel
BUG=

Review URL: https://chromiumcodereview.appspot.com/24998006

git-svn-id: svn://svn.chromium.org/blink/trunk@158485 bbb929c8-8fbe-4397-9dbb-9b2b20218538
add virtual destructors to WebCallbacks so it can be used

BUG=

Review URL: https://chromiumcodereview.appspot.com/24998009

git-svn-id: svn://svn.chromium.org/blink/trunk@158486 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Refactor LineBreaker::nextSegmentBreak and add a BreakingContext that holds all its state

LineBreaker::nextSegmentBreak was around 600 lines of code, including multiple
gotos and an enormous amount of state variables. In an effort to make it easier
to follow what's going on in this very hot and very important function, I've
attempted to refactor it into a series of inline functions representing how it
processes different types of inline content. To hold onto all the state, I've
added a BreakingContext. This let me get rid of the gotos and bring nextSegmentBreak
down to about 50 lines.

There's still a lot that can be done to make working with this code not awful.
I believe there's a lot of simplification that can continue to occur in handleText,
which is still pretty monolithic.

Review URL: https://chromiumcodereview.appspot.com/25054004

git-svn-id: svn://svn.chromium.org/blink/trunk@158487 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Added missing @viewport to the simple UA stylesheet.

@viewport UA rule also required when the simple UA styles should otherwise
suffice to style the document.

BUG=298477

Review URL: https://chromiumcodereview.appspot.com/25092003

git-svn-id: svn://svn.chromium.org/blink/trunk@158488 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Update SkiaFontWin::paintSkiaText to override typeface for HFONT

Update the SkiaFontWin::paintSkiaText method to enable the setTypeface
call regardless of the GDI_FONTS_ON_WINDOWS flag as the HFONT path is
still used by Uniscribe when GDI is disabled.

R=leviw@chromium.org
BUG=249099

Review URL: https://chromiumcodereview.appspot.com/25094004

git-svn-id: svn://svn.chromium.org/blink/trunk@158489 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Make platform/Clock non-bizarre

No need for it to be RefCounted, so I've made create() return a PassOwnPtr
(especially bizarre was that MediaController had a PassRefPtr member).

No need for any virtual methods.

Use conventional namespacing in Clock.cpp.

R=abarth

Review URL: https://chromiumcodereview.appspot.com/25109006

git-svn-id: svn://svn.chromium.org/blink/trunk@158490 bbb929c8-8fbe-4397-9dbb-9b2b20218538