[chromium] Allow LayoutTests under new git workflow
https://bugs.webkit.org/show_bug.cgi?id=88575

On Windows, chromium indirects through git.bat. Adds the same hack that
is currently used for discovering svn.bat to support the new git
workflow.

Patch by Tony Payne <tpayne@chromium.org> on 2012-06-07
Reviewed by Dirk Pranke.

* Scripts/webkitpy/common/checkout/scm/git.py:
(Git): Replaces all hard-coded references to 'git' with the class
variable executable_name.
(Git._check_git_architecture):
(Git.in_working_directory):
(Git.find_checkout_root):
(Git.read_git_config):
(Git.discard_local_commits):
(Git.local_commits):
(Git.working_directory_is_clean):
(Git.clean_working_directory):
(Git.status_command):
(Git.add_list):
(Git.delete_list):
(Git.exists):
(Git._current_branch):
(Git.changed_files):
(Git._changes_files_for_commit):
(Git.revisions_changing_file):
(Git.conflicted_files):
(Git.svn_revision):
(Git.create_patch):
(Git._run_git_svn_find_rev):
(Git.contents_at_revision):
(Git.diff_for_file):
(Git.show_head):
(Git.committer_email_for_revision):
(Git.apply_reverse_diff):
(Git.revert_files):
(Git.commit_with_message):
(Git._commit_on_branch):
(Git.svn_commit_log):
(Git.last_svn_commit_log):
(Git.svn_blame):
(Git._branch_ref_exists):
(Git.delete_branch):
(Git.remote_merge_base):
(Git.commit_locally_with_message):
(Git.push_local_commits_to_server):
(Git.commit_ids_from_commitish_arguments):
(Git.commit_message_for_local_commit):
(Git.files_changed_summary_for_commit):
* Scripts/webkitpy/common/host.py:
(Host._engage_awesome_windows_hacks): Adds an awesome 'git.bat' hack
that duplicates the logic in the existing 'svn.bat' hack.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium/mac] Improve deviceDPI, rect, and availableRect computation
https://bugs.webkit.org/show_bug.cgi?id=88596

Reviewed by Adam Barth.

Set deviceDPI to 160 for normal displays and 320 for HiDPI displays.
(Why 160? That's what chromium's render_view.cc assumes as default
single-resolution resolution at the moment. The only other place
where this number gets used is fixed layout mode, which is currently
not enabled.)

Also fix rect and availableRect computations: They get returned in
user space already.

Needed for http://crbug.com/31960.

* src/mac/WebScreenInfoFactory.mm:
(WebKit::toUserSpace):
(WebKit::deviceScaleFactor):
(WebKit):
(WebKit::WebScreenInfoFactory::screenInfo):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Use WEBPImportPictureRGBX|BGRX to import picture data
https://bugs.webkit.org/show_bug.cgi?id=88218

Reviewed by Kent Tamura.

Source/WebCore:

Stop using the RGBA and RGBA variants of the picture import routines (since
these will import alpha channel data in a future libwebp). Use the RGBX and
BGRX variants to import picture data for encoding to make it clear that the
alpha channel is (and must be) ignored.

Test: fast/canvas/canvas-toDataURL-webp.html

* platform/image-encoders/skia/WEBPImageEncoder.cpp:
(WebCore::rgbPictureImport):
(WebCore::importPictureBGRX): Use WEBPImportPictureBGRX for picture imports
that must ignore the alpha channel. Change the template parameter to be the
premultiplied alpha state of the input image data.
(WebCore::importPictureRGBX): Use WEBPImportPictureRGBX, ditto.
(WebCore::encodePixels): Invert the sense of the template parameter to make
it now indicate the premultiplied alpha state of the input image data.

LayoutTests:

The test image (html5.png) has an alpha 255 background. The background should
be rendered black when a <canvas>.toDataURL('image/webp') is used as an <img>
element src attribute for example, since WEBP does not support alpha.

* fast/canvas/canvas-toDataURL-webp-expected.txt:
* fast/canvas/canvas-toDataURL-webp.html: Change the test to encode the added
html5.png test image as an image/webp data url.
* fast/canvas/resources/html5.png: Added.
* platform/chromium-mac-snowleopard/fast/canvas/canvas-toDataURL-webp-expected.png: Added.
* platform/chromium/TestExpectations: Requires WIN, LINUX rebaselines.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][DRT] Normalize file:///tmp/LayoutTests in LayoutTestController::pathToLocalResource()
https://bugs.webkit.org/show_bug.cgi?id=67255

Patch by Joshua Lock <joshua.lock@intel.com> on 2012-06-07
Reviewed by Dirk Pranke.

Tools:

Implement pathToLocalResource to redirect file:///tmp URL's to
DUMPRENDERTREE_TEMP and file:///tmp/LayoutTests to point to the
LayoutTests sub-directory of the WebKit source tree.

* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
(LayoutTestController::pathToLocalResource):

LayoutTests:

* platform/efl/TestExpectations: unskip
fast/dom/frame-loading-via-document-write.html now that
LayoutTestController::pathToLocalResource() is implemented for EFL.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Show correct fullscreen button image (media controls)
https://bugs.webkit.org/show_bug.cgi?id=88563

Patch by Max Feil <mfeil@rim.com> on 2012-06-07
Reviewed by Antonio Gomes.

PR159306: Show "exit" fullscreen button image instead of "enter"
fullscreen button image when in fullscreen mode (HTML5 media
controls).

I am not providing a test due to the simplicity of this patch
and the relative difficulty and maintainability issues associated
with testing how an image is rendered.

* platform/blackberry/RenderThemeBlackBerry.cpp:
(WebCore::RenderThemeBlackBerry::paintMediaFullscreenButton):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
A style in an older shadow subtree causes assert when composing with <shadow>
https://bugs.webkit.org/show_bug.cgi?id=88299

Reviewed by Dimitri Glazkov.

Source/WebCore:

InsertionPoint::attach() assumes its distributed content not being attach()-ed.
But this assumption can break. This change added a guard for that.
This can happen for shadow boundaries in general. But ShadowRoot already handles that case.

Test: fast/dom/shadow/insertion-point-shadow-crash.html

* html/shadow/InsertionPoint.cpp:
(WebCore::InsertionPoint::attach):

LayoutTests:

* fast/dom/shadow/insertion-point-shadow-crash-expected.txt: Added.
* fast/dom/shadow/insertion-point-shadow-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FileAPI: Blob should support ArrayBufferView instead of ArrayBuffer for Constructor Parameters
https://bugs.webkit.org/show_bug.cgi?id=88294

Patch by Li Yin <li.yin@intel.com> on 2012-06-07
Reviewed by Jian Li.

Source/WebCore:

From Spec: http://dev.w3.org/2006/webapi/FileAPI/#dfn-Blob
Currently we add the support for ArrayBufferView, while still keeping ArrayBuffer for
backward compatibility. We will remove it in the near future.

Test: fast/files/blob-constructor.html

* bindings/js/JSBlobCustom.cpp:
(WebCore::JSBlobConstructor::constructJSBlob):
* bindings/v8/custom/V8BlobCustom.cpp:
(WebCore::V8Blob::constructorCallback):
* fileapi/WebKitBlobBuilder.cpp:
(WebCore::WebKitBlobBuilder::append):
(WebCore):
* fileapi/WebKitBlobBuilder.h:
(WebCore):
(WebKitBlobBuilder):
* fileapi/WebKitBlobBuilder.idl: Add support for ArrayBufferView in append method

LayoutTests:

Support ArrayBufferView in Blob constructing function.

* fast/files/blob-constructor-expected.txt:
* fast/files/file-reader-fffd-expected.txt:
* fast/files/file-reader-fffd.html:
* fast/files/script-tests/blob-constructor.js:
* http/tests/websocket/tests/hybi/bufferedAmount-after-close-in-busy.html:
* http/tests/websocket/tests/hybi/bufferedAmount-after-close.html:
* http/tests/websocket/tests/hybi/send-blob.html:
* http/tests/websocket/tests/hybi/workers/resources/send-blob.js:
(createBlobContainingAllDistinctBytes):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
addTextTrack should set track mode to HIDDEN
https://bugs.webkit.org/show_bug.cgi?id=88317

Patch by Victor Carbune <victor@rosedu.org> on 2012-06-07
Reviewed by Eric Carlson.

Source/WebCore:

Updated existing test.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::addTextTrack): Set the default parameters
for the newly created TextTrack.
* html/track/TextTrack.cpp:
(WebCore::TextTrack::TextTrack):

LayoutTests:

* media/track/track-texttracks-expected.txt: Updated.
* media/track/track-texttracks.html: Updated.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix unmatched parenthesis in fast/dom/HTMLAnchorElement/anchor-download-unset.html
https://bugs.webkit.org/show_bug.cgi?id=88526

Reviewed by Alexey Proskuryakov.

This test is skipped on other platforms than chromium.

* fast/dom/HTMLAnchorElement/anchor-download-unset.html:
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
check-webkit-style needs to be taught about <public/Foo.h>
https://bugs.webkit.org/show_bug.cgi?id=88524

Reviewed by David Levin.

* Scripts/webkitpy/style/checkers/cpp.py:
(_classify_include):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(OrderOfIncludesTest.test_public_primary_header):
(OrderOfIncludesTest.test_classify_include):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119794 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG should inline prototype chain accesses, and do the right things if the
specific function optimization is available
https://bugs.webkit.org/show_bug.cgi?id=88594

Patch by Filip Pizlo <fpizlo@apple.com> on 2012-06-07
Reviewed by Gavin Barraclough.
        
Looks like a 3% win on V8.

* bytecode/CodeBlock.h:
(JSC::Structure::prototypeForLookup):
(JSC):
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFromLLInt):
(JSC):
(JSC::GetByIdStatus::computeForChain):
(JSC::GetByIdStatus::computeFor):
* bytecode/GetByIdStatus.h:
(JSC::GetByIdStatus::GetByIdStatus):
(JSC::GetByIdStatus::isSimple):
(JSC::GetByIdStatus::chain):
(JSC::GetByIdStatus::specificValue):
(GetByIdStatus):
* bytecode/StructureSet.h:
(StructureSet):
(JSC::StructureSet::singletonStructure):
* bytecode/StructureStubInfo.h:
(JSC::StructureStubInfo::initGetByIdProto):
(JSC::StructureStubInfo::initGetByIdChain):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleGetById):
* dfg/DFGRepatch.cpp:
(JSC::DFG::tryCacheGetByID):
* jit/JITStubs.cpp:
(JSC::JITThunks::tryCacheGetByID):
* runtime/JSGlobalObject.h:
(JSC::Structure::prototypeForLookup):
(JSC):
* runtime/Structure.h:
(Structure):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119795 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebKit2] Only include Cocoa.h on platforms that use AppKit
https://bugs.webkit.org/show_bug.cgi?id=88517

Reviewed by Sam Weinig.

* WebKit2Prefix.h: Include Platform.h to get USE() macros. GTK needs to
include autotoolsconfig.h before including Platform.h, so do that first
if building on GTK. Then, if compiling an Objective-C file, it's safe
to include Foundation.h, but not necessarily Cocoa.h; only include the
latter if USE(APPKIT) is true.
* config.h: There's no need to import Cocoa.h since this is already
imported in the prefix header.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ShadowRoot needs resetStyleInheritance
https://bugs.webkit.org/show_bug.cgi?id=84048

Source/WebCore:

Added resetStyleInheritance API to ShadowRoot. The spec URL is
http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-root-attributes
To implement the API, modified StyleResolver to use empty style
instead of parent style if resetStyleInheritance is true,
and a node and its parent node are placed in different shadow trees.

Patch by Takashi Sakamoto <tasak@google.com> on 2012-06-07
Reviewed by Hajime Morita.

Test: fast/dom/shadow/shadow-root-resetStyleInheritance.html
      fast/dom/shadow/shadow-root-resetStyleInheritance-expected.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::initForStyleResolve):
Set m_parentStyle to NULL when resetStyleInheritance.
(WebCore::StyleResolver::documentSettings):
Added a new method to obtain current document's settings.
(WebCore::StyleResolver::initializeFontStyle):
Initialize m_style by using document settings. Its code was move
from the code initializing font style in applyProperty.
(WebCore::StyleResolver::styleForElement):
Initialize font style if m_parentStyle is NULL. The old code just
used style() and don't touch font style. The new code uses the above
initializeFontStyle.
(WebCore::StyleResolver::applyProperty):
Moved a code for initializing font style as "initial" to
a new method: initializeFontStyle and modified to use the method.
Modified to use documentSettings().
(WebCore::StyleResolver::checkForGenericFamilyChange):
Modified to use documentSettings().
* css/StyleResolver.h:
(WebCore::StyleResolver::documentSettings):
(WebCore::StyleResolver::initializeFontStyle):
Added two new methods to class StyleResolver.
* dom/NodeRenderingContext.cpp:
(WebCore::NodeRenderingContext::NodeRenderingContext):
Modified to calculate m_resetStyleInheritance in its constructor.
* dom/NodeRenderingContext.h:
(WebCore::NodeRenderingContext::resetStyleInheritance):
Implemented a new method, just returning m_resetStyleInheritance.
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::setResetStyleInheritance):
Modified to force to recalculate children's styles if
resetStyleInheritance is changed.
* dom/ShadowRoot.h:
(ShadowRoot):
Added resetStyleInheritance getter and setter.
* dom/ShadowRoot.idl:
Added an attribute, resetStyleInheritance.
* dom/TreeScope.cpp:
(WebCore::TreeScope::resetStyleInheritance):
* dom/TreeScope.h:
(TreeScope):
Added resetStyleInheritance's default getter.
The getter will be overrided by class ShadowRoot's getter.

LayoutTests:

Added layout tests for checking whether resetStyleInheritance works correctly or not.

Patch by Takashi Sakamoto <tasak@google.com> on 2012-06-07
Reviewed by Hajime Morita.

* fast/dom/shadow/shadow-root-resetStyleInheritance.html: Added.
* fast/dom/shadow/shadow-root-resetStyleInheritance-expected.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119799 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebKit2] Explicitly include CoreFoundation.h in config.h
https://bugs.webkit.org/show_bug.cgi?id=88619

Reviewed by Dan Bernstein.

WebKit2 relies (probably unintentionally) on CoreFoundation.h being
included by CoreGraphics.h (via CGSession.h), but some versions of
CoreGraphics headers don't include CoreFoundation.h. WebKit2 should
include it explicitly in config.h.

* config.h: Import CoreFoundation.h.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Update canvas-toDataURL-webp.html results after r119787

Unreviewed test expectations update.

* platform/chromium/TestExpectations:
* platform/chromium-win/fast/canvas/canvas-toDataURL-webp-expected.png: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119801 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reduce Node object size from 72 byte to 64 byte
https://bugs.webkit.org/show_bug.cgi?id=88528

Reviewed by Ryosuke Niwa.

.:

Added a symbol for callRemovedLastRef().

* Source/autotools/symbols.filter:

Source/WebCore:

This patch removes all virtual methods from TreeShared.h,
by which we can remove a virtual method table pointer (8 byte
in a 64bit architechture) from each Node object. Consequently,
this patch reduces the Node object size from 72 byte to 64 byte.

e.g. The HTML spec (http://www.whatwg.org/specs/web-apps/current-work/)
contains 325640 Node objects. Thus this patch saves 325640 * 8 byte = 2.6 MB.

e.g. sizeof(Element) is reduced from 104 byte to 96 byte.

- In multiple inheritance, a virtual method table pointer is allocated
for each base class that has virtual methods. For example, for
'class A : public B, C {};' where B and C have virtual methods,
two virtual method table pointers are allocated for each A object.
In this patch, A = Node, B = EventTarget, and C = TreeShared.
By removing the virtual methods from TreeShared, we can save the virtual
method table pointer for TreeShared. 8 byte saving.

- Node and SVGElementInstance are the only classes that inherit TreeShared.

- This patch removes virtual TreeShared::removeLastRef() and implements
virtual Node::removeLastRef() and virtual SVGElementInstance::removeLastRef().
Node::removeLastRef() calls 'delete this' for 'this' of type Node*,
and SVGElementInstance::removeLastRef() calls 'delete this' for 'this' of type
SVGElementInstance*.

- This patch removes the virtual destructor of TreeShared. This removal is safe
because (1) no one calls 'delete this' for 'this' of type TreeShared*,
and (2) both Node and SVGElementInstance have virtual destructor.

No change in behavior. Confirm no regression in existing tests.

* dom/ContainerNode.cpp:
(WebCore::callRemovedLastRef):
(WebCore):
* dom/Node.h:
(WebCore::Node::removedLastRef):
* platform/TreeShared.h:
(WebCore):
(TreeShared):
(WebCore::TreeShared::deref):
* svg/SVGElementInstance.cpp:
(WebCore::callRemovedLastRef):
(WebCore):
* svg/SVGElementInstance.h:
(WebCore::SVGElementInstance::removedLastRef):

* WebCore.order: Added a symbol for callRemovedLastRef().
* WebCore.exp.in: Ditto.

Source/WebKit/mac:

Added a symbol for callRemovedLastRef().

* WebKit.order:

Source/WebKit2:

Added a symbol for callRemovedLastRef().

* mac/WebKit2.order:
* win/WebKit2.def:
* win/WebKit2CFLite.def:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119802 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove the assertion that has been moved to TreeScope after r119802.

* dom/Document.cpp:
(WebCore::Document::removedLastRef):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119803 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] New virtual GPU canvas-toDataURL-webp.html results after r119787

Unreviewed test expectations update.

* platform/chromium-win/platform/chromium/virtual/gpu/fast/canvas/canvas-toDataURL-webp-expected.png: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119804 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixed fast/files/read-blob-async.html failing after r119791.

* fast/files/resources/read-blob-test-cases.js:
(testReadingSingleArrayBufferBlob):
(testReadingSlicedArrayBufferBlob):
(testReadingMultipleArrayBufferBlob):
(testReadingHybridBlob):
(testReadingSlicedHybridBlob):
(testReadingTripleSlicedHybridBlob):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119805 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebKit2] Move Mac-specific bits from config.h to WebKit2Prefix.h
https://bugs.webkit.org/show_bug.cgi?id=88625

Reviewed by Dan Bernstein.

Since the Mac supports prefix headers, there is no point in having
Mac-specific code in WebKit2's config.h. Move it to WebKit2Prefix.h.

* WebKit2Prefix.h:
* config.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119806 268f45cc-cd09-0410-ab3c-d52691b4dbfc