Refactoring: Clarifying DOMWindow ownership by removing Frame::setDOMWindow()

This chagne replaces Frame::setDOMWindow() by Frame::clearDOMWindow() and
Frame::ensureDOMWindow() to clarify the owner of DOMWindow objects.
Now it is created and owned by Frame.

BUG=none
TEST=none
R=abarth, japhet

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154885 bbb929c8-8fbe-4397-9dbb-9b2b20218538
WebString::utf8() should return a std::string

There don't appear to be any strong reasons for prefering WebCString over
std::string in the API. To improve integration with Chromium, we're going to
move the API over to using std::string over time.

This first callsite is useful to migrate because it makes it possible to
optimize the conversion of WebURL into GURL.

R=darin
BUG=261412

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154886 bbb929c8-8fbe-4397-9dbb-9b2b20218538
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

git-svn-id: svn://svn.chromium.org/blink/trunk@154887 bbb929c8-8fbe-4397-9dbb-9b2b20218538
StyleSheetCollection should be aware of scoped styles.

This also fixes an issue: styles are not correctly applied if order of scoping nodes is different from order of scoped styles.


BUG=244314

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

git-svn-id: svn://svn.chromium.org/blink/trunk@154888 bbb929c8-8fbe-4397-9dbb-9b2b20218538
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