[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
[chromium] WEBP image blue and red color channels reversed on Android
https://bugs.webkit.org/show_bug.cgi?id=88613

Reviewed by Kent Tamura.

No new tests. Covered by test fast/images/webp-image-decoding.html though I'm
not sure where/how the Androids run their layout tests.

* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(outputMode): Detect little-endian Skia with a blue pixel shift (aka Android)
which seems to be the way for them per bug 75861.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119807 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Fixed a comment, pointed out by ap@.

* platform/TreeShared.h:
(WebCore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Forms] Drop StepRange::NumberWithDecimalPlacesOrMissing
https://bugs.webkit.org/show_bug.cgi?id=88621

Reviewed by Kent Tamura.

This patch changes NumberWithDecimalPlacesOrMissing to NumberWithDecimalPlaces.
We use NaN as indication of having value or not.

No new tests, because this patch doesn't change behavior.

* html/DateInputType.cpp:
(WebCore::DateInputType::createStepRange): Replace NumberWithDecimalPlacesOrMissing to NumberWithDecimalPlaces.
* html/DateTimeInputType.cpp:
(WebCore::DateTimeInputType::createStepRange): ditto.
* html/DateTimeLocalInputType.cpp:
(WebCore::DateTimeLocalInputType::createStepRange): ditto.
* html/MonthInputType.cpp:
(WebCore::MonthInputType::createStepRange): ditto.
* html/NumberInputType.cpp:
(WebCore::NumberInputType::createStepRange): ditto.
* html/RangeInputType.cpp:
(WebCore::RangeInputType::createStepRange): ditto.
* html/StepRange.cpp:
(WebCore::StepRange::StepRange): Checks value is finite or not.
(WebCore::StepRange::parseStep): Replace NumberWithDecimalPlacesOrMissing to NumberWithDecimalPlaces.
* html/StepRange.h:
(StepRange): Removed NumberWithDecimalPlacesOrMissing.
* html/TimeInputType.cpp:
(WebCore::TimeInputType::createStepRange):  NumberWithDecimalPlacesOrMissing to NumberWithDecimalPlaces.
* html/WeekInputType.cpp:
(WebCore::WeekInputType::createStepRange): ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119809 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening. Skip tests using disabled SHADOW_DOM feature on Qt.

Patch by Zoltan Arvai <zarvai@inf.u-szeged.hu> on 2012-06-08

* platform/qt/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
HTTP 204 No Content responses shouldn't trigger MIME type warnings in the web inspector
https://bugs.webkit.org/show_bug.cgi?id=88603

Reviewed by Pavel Feldman.

A 204 response doesn't have an entity body, so its MIME type is kind of
meaningless.  We shouldn't spam the console with a warning about MIME
types.

* inspector/front-end/NetworkManager.js:
(WebInspector.NetworkDispatcher.prototype._mimeTypeIsConsistentWithType):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Run optimize-baselines over canvas-toDataURL-webp.html results

Unreviewed test expectations update.

* platform/chromium-mac/fast/canvas/canvas-toDataURL-webp-expected.png: Copied from LayoutTests/platform/chromium-mac-snowleopard/fast/canvas/canvas-toDataURL-webp-expected.png.
* platform/chromium-mac/platform/chromium/virtual/gpu/fast/canvas/canvas-toDataURL-webp-expected.png: Renamed from LayoutTests/platform/chromium-mac-snowleopard/fast/canvas/canvas-toDataURL-webp-expected.png.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119812 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Re-enable SHARED_WORKERS for Android until a build fix has been resolved.
https://bugs.webkit.org/show_bug.cgi?id=88637

Unreviewed build fix.

Linking content_shell on the Chromium side fails due to an unresolved
call to WebSharedWorker::create(). Since this blocks WebKit rolls,
temporarily re-enable the feature until this has been solved.

* features.gypi:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION r119802: Remove unnecessary ASSERT(!m_deletionHasBegun) from Document.h
https://bugs.webkit.org/show_bug.cgi?id=88528

Reviewed by Ryosuke Niwa.

m_deletionHasBegun should become true just before 'delete this'.

No tests. No change in behavior.

* dom/Document.h:
(WebCore::Document::guardRef):
(WebCore::Document::guardDeref):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119814 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add FileSystem item to storage tree.
https://bugs.webkit.org/show_bug.cgi?id=72691

Patch by Taiju Tsuiki <tzik@chromium.org> on 2012-06-08
Reviewed by Vsevolod Vlasov.

Source/WebCore:

* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* inspector/compile-front-end.py:
* inspector/front-end/FileSystemModel.js: Added.
* inspector/front-end/Images/fileSystem.png: Added.
* inspector/front-end/ResourcesPanel.js:
(WebInspector.FileSystemListTreeElement):
(WebInspector.FileSystemListTreeElement.prototype.onexpand):
(WebInspector.FileSystemListTreeElement.prototype.onattach):
(WebInspector.FileSystemListTreeElement.prototype._handleContextMenuEvent):
(WebInspector.FileSystemListTreeElement.prototype._fileSystemAdded):
(WebInspector.FileSystemListTreeElement.prototype._fileSystemRemoved):
(WebInspector.FileSystemListTreeElement.prototype._fileSystemTreeElementByName):
(WebInspector.FileSystemListTreeElement.prototype._refreshFileSystem):
(WebInspector.FileSystemTreeElement):
(WebInspector.FileSystemTreeElement.prototype.get fileSystemName):
(WebInspector.FileSystemTreeElement.prototype.get itemURL):
* inspector/front-end/Settings.js:
(WebInspector.ExperimentsSettings):
* inspector/front-end/WebKit.qrc:
* inspector/front-end/inspector.html:
* inspector/front-end/resourcesPanel.css:
(.file-system-storage-tree-item .icon):
* inspector/front-end/utilities.js:

Source/WebKit/chromium:

* src/js/DevTools.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move form-related functions of Document to FormController
https://bugs.webkit.org/show_bug.cgi?id=88497

Reviewed by Hajime Morita.

A lot of files depend on Document.h. We had to build many files when we
touched form-related features in Document.h or
CheckedRadioButtons.h. This patch reduces such pain.

No new tests. Just a refactoring.

* CMakeLists.txt: Add FormController.cpp and/or FormController.h.
* GNUmakefile.list.am: ditto.
* Target.pri: ditto.
* WebCore.gypi: ditto.
* WebCore.vcproj/WebCore.vcproj: ditto.
* WebCore.xcodeproj/project.pbxproj: ditto.

* dom/Document.cpp: Removed form-releated features except the followings.
(WebCore::Document::formController): Accessor for a FormController.
(WebCore::Document::formElementsState):
Just returns FormController::formElementsState().
We don't create new FormController.
(WebCore::Document::setStateForNewFormElements):
Just returns FormController::setStateForNewFormElements().
We don't create new FormController if the specified vector is empty.
* dom/Document.h:
Moved form-related functions to FormController.

* html/FormController.cpp: Added. Moved from Document.cpp.
* html/FormController.h: Added. Moved from Document.h

* html/FormAssociatedElement.cpp: Use Document::formController().
(WebCore::FormAssociatedElement::didMoveToNewDocument):
(WebCore::FormAssociatedElement::insertedInto):
(WebCore::FormAssociatedElement::removedFrom):
(WebCore::FormAssociatedElement::formAttributeChanged):
* html/HTMLFormControlElementWithState.cpp: Use Document::formController().
(WebCore::HTMLFormControlElementWithState::HTMLFormControlElementWithState):
(WebCore::HTMLFormControlElementWithState::~HTMLFormControlElementWithState):
(WebCore::HTMLFormControlElementWithState::didMoveToNewDocument):
(WebCore::HTMLFormControlElementWithState::finishParsingChildren):
* html/HTMLFormElement.cpp: Use Document::formController().
(WebCore::HTMLFormElement::didNotifyDescendantInsertions):
(WebCore::HTMLFormElement::removedFrom):
* html/HTMLInputElement.cpp: Use Document::formController().
(WebCore::HTMLInputElement::~HTMLInputElement):
(WebCore::HTMLInputElement::didMoveToNewDocument):
(WebCore::HTMLInputElement::checkedRadioButtons):
* html/HTMLInputElement.h:
Declare CheckedRadioButtons. It was provided by Document.h.
* html/parser/HTMLConstructionSite.h:
Declare HTMLFormElement. It was provided by Document.h


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119816 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening after r119795, adding separate test expectations
for jquery/core.html - the test is crashing on debug builds and failing
with a text diff on release builds.

* platform/gtk/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Speech JavaScript API: mock WebSpeechRecognizer for DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=87976

Reviewed by Kent Tamura.

Tools:

Provide a mock implementation of WebSpeechRecognizer for
DumpRenderTree. This will allow better testing of the API via layout
tests.

* DumpRenderTree/DumpRenderTree.gypi:
* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::LayoutTestController):
(LayoutTestController::addMockSpeechRecognitionResult):
* DumpRenderTree/chromium/LayoutTestController.h:
(LayoutTestController):
* DumpRenderTree/chromium/MockWebSpeechRecognizer.cpp: Added.
(MockWebSpeechRecognizer::create):
(MockWebSpeechRecognizer::start):
(MockWebSpeechRecognizer::stop):
(MockWebSpeechRecognizer::abort):
(MockWebSpeechRecognizer::MockWebSpeechRecognizer):
(MockWebSpeechRecognizer::~MockWebSpeechRecognizer):
(MockWebSpeechRecognizer::ResultTask::runIfValid):
* DumpRenderTree/chromium/MockWebSpeechRecognizer.h: Added.
(WebKit):
(MockWebSpeechRecognizer):
(MockWebSpeechRecognizer::addMockResult):
(MockWebSpeechRecognizer::taskList):
(ClientCallTask):
(MockWebSpeechRecognizer::ClientCallTask::ClientCallTask):
(ResultTask):
(MockWebSpeechRecognizer::ResultTask::ResultTask):
(NoMatchTask):
(MockWebSpeechRecognizer::NoMatchTask::NoMatchTask):
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::speechRecognizer):
* DumpRenderTree/chromium/WebViewHost.h:
(WebViewHost):
(WebViewHost::mockSpeechRecognizer):

LayoutTests:

Add a layout test using the new mock, pushing a mock result through
and checking that events fire correctly.

* fast/speech/scripted/speechrecognition-basics-expected.txt: Added.
* fast/speech/scripted/speechrecognition-basics.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening, removing crash expectations for two plugins
tests that were fixed after LLInt was enabled for the Gtk port in r119593.

* platform/gtk/TestExpectations:


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