Add experimental unprefixed Shadow DOM API.

This change exposes unprefixed Shadow DOM API behind the "experimental web
platform features" runtime flag. At this moment, the existing prefixed API
is kept as-is, but it is planned to sunset the prefixed API eventually.

This change also replaces every occurence of prefixed Shadow DOM APIs in
tests. For now, files under PerformanceTests/ are excluded because
the performance tests are run on the environment where the "experimental web
platform features" flag is not set.

Here's the record of commands I ran to replace the prefixed API (or the record
of my mad skillz on shellscripts):
$ git grep -e webkitCreateShadowRoot -e webkitPseudo -e webkitShadowRoot | \
> cut --delimiter=: --fields=1 | sort | uniq | \
> while read F; do \
> if (echo $F | grep -q -e '/Element\.idl' -e 'PerformanceTests/'); \
> then continue; \
> fi; \
> sed -i s/webkitCreateShadowRoot/createShadowRoot/g $F; \
> sed -i s/webkitPseudo/pseudo/g $F; \
> sed -i s/webkitShadowRoot/shadowRoot/g $F; \
> done

BUG=242153
R=morrita@chromium.org,tkent@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154889 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Code generator makes useless include line to the binding files.

There are useless include statement in the Internals.idl,
because of generating duplicated include statements from code generator.
It is better to remove it from code generator.

BUG=263278

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154890 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Expose a way to set a view's base background color.

BUG=263263

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154891 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Make StylePropertyMetadata a 16 bits object.

This is a new patch after the rollout of 153173.

Profiling the benchmark with Intel Vtune to find out the performance regression
showed that copying uint16_t, so StylePropertyMetadata, is not
a fast operation in term of assembly code and has a big penalty on Windows 
MSVC over unsigned for example. The latter produces a much faster code 
when using unsigned over uint16_t (45% difference in the benchmark).

The patch fixes the regression by avoiding the copies of StylePropertyMetada
when applicable (by using const ref).

The second part of the fix is avoiding the conversion from an int (enum) to
an uint16_t in a tight loop such as StylePropertySet::findPropertyIndex 
(which is the hotspot of the benchmark).

On my Windows 7 64 bits Core i5 machine CSSPropertySetterGetter results are :
- avg : 2714 runs/s with the patch
- avg : 2696 runs/s without the patch

Apple internal MemBuster reports ~1.8 Mb of improvements (loading the top 50 Alexa websites).

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154892 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Sort IDL definitions in Perl, so in order in JSON

There's one difference between JSON files from the Perl parser and the
Python parser, namely Promise.idl.

This CL fixes it (by adding a sort), so the JSON is exactly the same.


The difference is b/c Perl lists definitions in the order of definition,
while Python lists them in alphabetical order.
The only case where these differ is Promise.idl, which has two callback
functions in non-alphabetical order.
They're in this order upstream, and this is allowed, hence not changing
the IDL file:
https://github.com/slightlyoff/Promises/blob/master/Promise.idl

The fix is to sort the definitions (within a type: callback functions,
enumerations, interfaces). Do this for each type of definition, for
consistency, though in practice this will generally be a nop (only 1 interface
and usually no enumerations or callback functions).

(We're *not* sorting interface members, as these need to appear in order,
due to overloading.)

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154894 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Add LegacyImplementedInBaseClass check to interface_dependency_resolver.py

Christophe added a new extended attribute last week that changes the parsing
(JSON) slightly (of Window.idl and WorkerGlobalScope.idl).
Just noticed this, so adding to Python.

Reference:
Issue 19675008: Move btoa() / atob() implementation out of DOMWindow
https://chromiumcodereview.appspot.com/19675008

BUG=261226

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

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

The IDL reader (and resolver, and validator) currently has functions
with really long signatures, due to passing lots of setup
parameters around.
The better solution is to use these setup parameters *once*
to make an object.
This makes the interfaces much cleaner (shorter signatures),
and the function bodies cleaner because setup is put in a setup
function.

Compare:
Before:
interface_dependency_resolver.resolve_dependencies(
  definitions, idl_filename, interface_dependencies_filename,
  additional_idl_filenames, verbose=verbose)

After:
self.interface_dependency_resolver.resolve_dependencies(
  definitions, interface_name)

This allows us to remove a circular module dependency
(idl_reader <-> interface_dependency_resolver),
since we can pass an (instantiated) object, rather than
having circular imports for functions.

This also regularizes use of
interface_name/idl_basename/idl_filename
in dependency resolution, using the short interface_name
except when we actually need the full filename.

...and moves an error up to where we know the filename,
fixing a bug where we report Extended Attribute errors
on the main IDL file, even if they occur in a dependency.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154896 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Introduce toSVGRectElement(), use it

As a step to change static_cast with toSVGXXX, static_cast<SVGRectElement*> can
be changed with toSVGRectElement().

BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154897 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Move the policy for processing Custom Elements into DocumentInit.

This does not change any behavior. But when documents share a Custom
Element registration context, DocumentInit will be the vector that
conveys the registration context to the new document.

TL;DR Soon, trojan:wooden horse :: registration context:DocumentInit.

BUG=247219

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154898 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Do not include internal libwebp header in Blink

The internal headers are not installed when libwebp is installed with a package manager, e.g. media-libs/libwebp on Gentoo, or libwebp2/libwebp-dev on Debian/Ubuntu.

So, if they are included in Blink, it would break Blink compile when using system installed libwebp.

BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154899 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Rename ExperimentalShadowDOM runtime feature to ShadowDOM.

Now all of unprefixed Shadow DOM APIs are controlled under this feature, thus
it is a bit odd to call this feature Experimental.

This change also removes portions of InternalSettings related to the feature.
Apparently these codes are not used from anywhere.

BUG=242153
R=hayato@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154900 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Measure the usage of prefixed Shadow DOM APIs.

BUG=242153
R=hayato@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154901 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert 154891 "Expose a way to set a view's base background color."

It looks like this CL broke webkit_unit_tests on Android bots
http://build.chromium.org/p/chromium.webkit/builders/Android%20Tests%20%28dbg%29
http://build.chromium.org/p/chromium.webkit/builders/Android%20Tests%20%28dbg%29/builds/11195/steps/webkit_unit_tests/logs/stdio

> Expose a way to set a view's base background color.
> 
> BUG=263263
> 
> Review URL: https://chromiumcodereview.appspot.com/19883002

TBR=joth@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154902 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Associate Custom Element callbacks with the right context.

In preparation for sharing a Custom Element registration context
between multiple documents, associate the Custom Element callbacks
with the active script context and not the specific document that
received the call to document.register (although the generated
constructor uses that document to own elements it produces.)

BUG=247219

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154904 bbb929c8-8fbe-4397-9dbb-9b2b20218538
MakeLayout Test editing/selection/fake-drag.html stable

This patch changes LayoutTest editing/selection/fake-drag.html stable by starting test steps after document loading, invoking the first step, step0(), as load event handler, rather than middle of document loading.

BUG=263991
R=tkent@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154905 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Changed Test cases with new keyword NeedsRebaseline for revision=154604

> Height of fixed height cell is not proper when cell's row is under row spanning cell.
> 
> If cell have fixed height then it's height should not changed till there is
> other rows present to take extra rowspan cell height.
> 
> Extra rowspan cell height, First, distributes to percent height spanning rows
> which is depend on table height. If extra rowspan cell height remains after
> distributing to percent height rows then remaining extra rowspan cell height
> distributes in auto spanning rows if auto spanning rows are present otherwise
> it distributes to remaining spanning rows.
> 
> R=jchaffraix@chromium.org
> BUG=254914
> 
> Review URL : https://codereview.chromium.org/18050007

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154906 bbb929c8-8fbe-4397-9dbb-9b2b20218538
MediaStream API: Removing deprecating APIs
The corresponding Chromium patch (https://codereview.chromium.org/19627003/)
removing the usage of these APIs is currently cooking in the commit queue.

BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154907 bbb929c8-8fbe-4397-9dbb-9b2b20218538
compareDocumentPosition() should report PRECEEDING or FOLLOWING information even if nodes are disconnected

As per the latest specification, compareDocumentPosition() should report PRECEEDING or FOLLOWING
information even if nodes are disconnected:
- http://dom.spec.whatwg.org/#dom-node-comparedocumentposition

This behavior is consistent with both IE10 and Firefox 22.

Blink was not reporting PRECEEDING or FOLLOWING in all cases. This patches makes Blink behave
as expected.

BUG=263340
R=arv@chromium.org, haraken@chromium.org, tkent@chromium.org

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=154835

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154908 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Revert 154887 "New positioning model: Borders"

This CL caused compile failures on Chrome OS build bots.
http://build.chromium.org/p/chromium.chrome/builders/Google%20Chrome%20ChromeOS/builds/56352/steps/compile/logs/stdio

> New positioning model: Borders
> 
> Converting to the shape coordinate system was not properly accounting
> for borders and padding. This has been fixed and a new convienence
> method added because of the added complexity of the conversion.
> 
> This is a port from WebKit: http://trac.webkit.org/changeset/153058
> 
> BUG=260357
> 
> Review URL: https://chromiumcodereview.appspot.com/20107003

TBR=bjonesbe@adobe.com

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154909 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Rewrite the 'window.onerror' tests.

The tests are currently duplicating work all over the place, and are
difficult to update. This patch tries to bring some consistency to the
way the feature is tested in the hopes of making future improvements
simpler to effectively test.

R=ch.dumez@sisa.samsung.com

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

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