Speculative fix for crbug.com/339075 (print preview not loading)

This is believe to have been regressed in http://src.chromium.org/viewvc/blink?revision=164466&view=revision.
That would seem logical, as it removed a guard that likely prevented a
cancelled provisional load from calling DOMWindow::finishedLoading(), which
can trigger a print.

BUG=339075

Review URL: https://codereview.chromium.org/175343005

git-svn-id: svn://svn.chromium.org/blink/trunk@167731 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Consider text alignment and direction when computing the left offset for horizontal writing modes.

To properly layout a positioned box, we need to consider special cases where the direction of
the text for that object flows towards the opposite direction the text inside that box would be
aligned to (e.g. right aligned text for LTR boxes and left aligned text for RTL boxes).

Not doing this this ways yields to undesired effects, such as having the absolutely positioned
text inside a table cell with relative positioned being wrongly rendered outside of the cell.

BUG=157539
TEST=Try rendering absolutely positioned text inside table cells with relative positioning.
R=eae@chromium.org

Review URL: https://codereview.chromium.org/150403003

git-svn-id: svn://svn.chromium.org/blink/trunk@167732 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Check for m_page when switching page popups in and out of compositing.

The popup can be closed as it's being initialized, so check that m_page still exists before trying to do anything with it.

BUG=346131

Review URL: https://codereview.chromium.org/178713002

git-svn-id: svn://svn.chromium.org/blink/trunk@167733 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Make Document::nodeChildrenWillBeRemoved() take a reference

Make Document::nodeChildrenWillBeRemoved() take a reference instead of a
pointer as the pointer was always expected to be non-null. This makes the
code look safer and avoids having assertions.

R=adamk

Review URL: https://codereview.chromium.org/178613003

git-svn-id: svn://svn.chromium.org/blink/trunk@167734 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Request rebaseline for fast/text/chromium-linux-fontconfig-renderstyle.html

BUG=342077

Review URL: https://codereview.chromium.org/169453007

git-svn-id: svn://svn.chromium.org/blink/trunk@167735 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Remove deprecated window.showModalDialog()

Time to go.

BUG=345831

Review URL: https://codereview.chromium.org/174073007

git-svn-id: svn://svn.chromium.org/blink/trunk@167736 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Adding parser layout test for whitespace around comma in argument list

Imported webkit testcase from here:
https://bugs.webkit.org/show_bug.cgi?id=77773

Appears issues is already fixed in blink, so no code changes required.

BUG=231630

Review URL: https://codereview.chromium.org/178943002

git-svn-id: svn://svn.chromium.org/blink/trunk@167737 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add WebDocument::clearFocusedElement

WebDocument::clearFocusedNode should be clearFocusedElement.

BUG=258763

Review URL: https://codereview.chromium.org/179013002

git-svn-id: svn://svn.chromium.org/blink/trunk@167738 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Close sync databases before the corresponding DatabaseContext is deleted.

The DatabaseBackendSync destructor, which closed the database, assumed the
corresponding ExecutionContext was still live. In Oilpan, we can't assume
destruction order at all. So we need to close the database explicitly before the
ExecutionContext is destructed.

No one tracked opened sync databases. This CL adds a list of opened sync
database to DatabaseContext, and DatabaseContext::stopDatabases should close
sync databases as well as async databases. stopDatabases is called when
ActiveDOMObjects in an ExecutionContext are stopped.

We still need closeDatabase call in ~DatabaseBackendSync because
a DatabaseSync object and its JavaScript wrapper can be deleted
while the owner worker is running.

This CL also removes stopDatabaases call in the DatabaseContext destructor. It
was just redundant, and it caused an assertion failure in stopSyncDatabases
because the ExecutionContext is already cleared.

BUG=340522
TEST=none; covered by existing tests.

Review URL: https://codereview.chromium.org/173123004

git-svn-id: svn://svn.chromium.org/blink/trunk@167739 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Defer starting of animations until after compositing update

Starting of animations depends on compositing state so that a decision
as to whether to run the animation on the main or compositor threads
can be made. Previously this happened following a style recalc where
sufficient incremental updating allowed a decision. After this patch
starting of animations may be deferred until after a compositing
update. Ideally this would happen once before the frame completes, but
the lifecycle of a frame is not yet visible to Blink.

Following the starting of animations the animation clock is unfrozen
allowing getComputedStyle and other animation API calls to advance
time when outside a frame. Previously, to maintain synchronization
in these situations the clock automatically froze on access and then
unfroze after a subsequent style recalc. This was partially inaccurate
as calls via the animation API might never trigger a recalc. Deferring the
unfreezing until after the compositing update is less feasible. Instead,
this patch allows the clock to remain unfrozen outside a frame by
throttling the frequency at which the clock is permitted to advance.

BUG=339847

Review URL: https://codereview.chromium.org/135693003

git-svn-id: svn://svn.chromium.org/blink/trunk@167740 bbb929c8-8fbe-4397-9dbb-9b2b20218538
IDL compiler: remove special case for SVGTransformList

Remaining: 1 => 0 (all files identical between Perl and Python)

There's a special case (WTF::getPtr) for one complicate case.
Per Kouhei, this is no longer necessary, so removing.

This finishes the rewrite.
Once everything lands, just need to switch the build with:
IDL compiler: switch build to Python compiler
https://codereview.chromium.org/166333002

BUG=239771
TBR=haraken, kouhei

Review URL: https://codereview.chromium.org/177273002

git-svn-id: svn://svn.chromium.org/blink/trunk@167741 bbb929c8-8fbe-4397-9dbb-9b2b20218538
IDL compiler: always use raw pointer in visitDOMWrapper

Remaining: 16 => 14

Perl code always uses a raw pointer in visitDOMWrapper,
even for non-wrapper types, notably NodeFilter.
Thus we get
NodeFilter*
instead of the usual
RefPtr<NodeFilter>

Question: Is this correct? It's weird and inconsistent.

Perhaps this is a bug in Perl, and anyway it's an inconsistency,
so I've marked it as FIXME, but this CL makes the Python match the Perl.

BUG=239771
R=haraken, kouhei
NOTRY=true

Review URL: https://codereview.chromium.org/177103002

git-svn-id: svn://svn.chromium.org/blink/trunk@167742 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Oilpan: Remove GC_INFO_{DEFINE,DECLARE} macros

This CL is a cherry-pick of
[oilpan] Make GC_INFO_{DEFINE,DECLARE} macros NOOP
https://codereview.chromium.org/171843002/

BUG=None

Review URL: https://codereview.chromium.org/169293002

git-svn-id: svn://svn.chromium.org/blink/trunk@167743 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Use a class for CodeGeneratorV8

While writing up the design doc:
http://www.chromium.org/developers/design-documents/idl-compiler
...and reviewing Terry's "speed up r-b-t" CL:
https://codereview.chromium.org/169743005/

...I realized that it was clearer and faster if we also made a (simple)
object for the V8 code generator.
(The actual contents-generating functions are still functions,
so we don't have OO boilerplate everywhere:
it's just initializing.)

This encapsulates the library initialization and the interfaces_info
handling, exactly as we currently do for idl_reader.
The result is clearer code (separate initialization and call),
and allows faster r-b-t (in Terry's CL) due to avoiding multiple
initializations.


2 minor cleanups (good practice):
* Classes all inherit from |object| (Python "new-style" classes, better behaved)
* |frozenset| for header include sets
The frozenset() is to emphasize that these are constants;
we need to make copies of the header includes to make it safe
to run repeatedly (otherwise modifies the "constant").
(Thanks Terry!)

BUG=341748
R=haraken
NOTRY=true

Review URL: https://codereview.chromium.org/179423002

git-svn-id: svn://svn.chromium.org/blink/trunk@167744 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Move UA style rulesets for <datalist> and input[type=color][list] to html.css

Now all platforms suppor them by default. We don't need to use
RenderTheme::extraDefaultStyleSheet.

BUG=none
TEST=none; no behavior changes.

Review URL: https://codereview.chromium.org/174833002

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