[WK2][GTK] Fix issues with WebKitFaviconDatabase in debug builds
https://bugs.webkit.org/show_bug.cgi?id=97966

Reviewed by Carlos Garcia Campos.

Fix failing ASSERTs detected when running the unit tests from
TestWebKitFaviconDatabase in debug builds.

* UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
(webkitFaviconDatabaseDispose): Close IconDatabase here, which is
the right place to do it according to GObject documentation.
(webkitFaviconDatabaseFinalize): Just destroy the private data
structure and chain up to parent class's finalize method.
(webkit_favicon_database_class_init): Override dispose method.

* UIProcess/API/gtk/tests/TestWebKitFaviconDatabase.cpp:
(webkitFaviconDatabaseFinalizedCallback): Delete files when the
WebKitFaviconDatabase is being finalized, since by that time the
IconDatabase from WebCore will be already closed.
(afterAll): Add a weak reference to WebKitFaviconDatabase and
provide a GWeakNotify callback (webkitFaviconDatabaseFinalizedCallback).

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[TextureMapper] [WebKit2] Crash in WebCore::BitmapTextureGL::updateContents
https://bugs.webkit.org/show_bug.cgi?id=97394

Patch by Martin Robinson <mrobinson@igalia.com> on 2012-09-30
Reviewed by Noam Rosenthal.

When a TextureMapper is destroyed, layers can still contain references
to textures obtained from that TextureMapper's texture pool. Trying to
access an unreffed TextureMapper in the BitmapTexture's destructor
causes a crash.

Instead of storing a raw pointer to a TextureMapper, we can simply store
a reference to the underlying GraphicsContext3D. All TextureMapper
implementations use the current GL context at this moment, so one GC3D
referencing the current context is the same as any other.

* platform/graphics/texmap/TextureMapper.h: Remove the clearTexturePool
method. It's no longer used.
(WebCore::BitmapTexture::applyFilters): Add a TextureMapper* argument.
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::BitmapTextureGL::BitmapTextureGL): Keep a reference to the
GraphicsContext3D instead of the TextureMapper.
(WebCore::BitmapTextureGL::didReset): Use the GC3D reference.
(WebCore::BitmapTextureGL::updateContents): Ditto.
(WebCore::BitmapTextureGL::applyFilters): Accept the TextureMapper as an argument.
(WebCore::BitmapTextureGL::initializeStencil): Use the GC3D reference.
(WebCore::BitmapTextureGL::clearIfNeeded): Ditto.
(WebCore::BitmapTextureGL::createFboIfNeeded): Ditto.
(WebCore::BitmapTextureGL::bind): Accept the TextureMapper as an argument.
(WebCore::BitmapTextureGL::~BitmapTextureGL): Use the GC3D reference.
(WebCore::TextureMapperGL::~TextureMapperGL): Remove the call to clearTexturePool
as it's no longer necessary.
(WebCore::TextureMapperGL::bindSurface): Ditto.
* platform/graphics/texmap/TextureMapperGL.h:
(BitmapTextureGL): Keep a GC3D reference instead of a TextureMapper pointer.
* platform/graphics/texmap/TextureMapperImageBuffer.cpp:
(WebCore::BitmapTextureImageBuffer::applyFilters): Add a TextureMapper argument.
* platform/graphics/texmap/TextureMapperImageBuffer.h:
(BitmapTextureImageBuffer):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::applyFilters): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129993 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][GTK] Add API to get the favicon for a WebKitWebView
https://bugs.webkit.org/show_bug.cgi?id=96477

Reviewed by Carlos Garcia Campos.

Provide a new simple API to synchronously try to get the favicon
associated with a WebView, if any, and to keep track of changes on
it, through a new GObject property.

* UIProcess/API/gtk/WebKitWebView.cpp:
(_WebKitWebViewPrivate):
(webkitWebViewIconReadyCallback): Callback to handle the
'icon-ready' signal coming from WebKitFaviconDatabase.
(webkitWebViewWatchForChangesInFavicon): Connects to the
'icon-ready' signal from WebKitFaviconDatabase, to keep track of
changes in favicons, that must be related to the current view.
(webkitWebViewDisconnectFaviconDatabaseSignalHandlers):
Disconnects the handler for 'icon-ready' if needed.
(webkitWebViewGetProperty): Updated for the new "favicon" property .
(webkitWebViewFinalize): Disconnect the new signal handler.
(webkit_web_view_class_init): Definition of the new property.
(webkitWebViewEmitLoadChanged): Make sure we will be watching for
changes in the favicon from WEBKIT_LOAD_STARTED on.
(webkit_web_view_get_favicon): New API funtcion, returning the
current favicon for the WebView, if any, or NULL otherwise.
* UIProcess/API/gtk/WebKitWebView.h:

Internally expose a way to try to get the favicon associated to a
page URL synchronously, through WebKitFaviconDatabase.

* UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
(webkitFaviconDatabaseGetFaviconSync): New internal function, it
will return either 0 or a valid pointer to a cairo_surface_t.
* UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h:

Add unit tests for checking this new API.

* UIProcess/API/gtk/tests/TestWebKitFaviconDatabase.cpp:
(testWebViewFavicon): New unit test.
(beforeAll): Add the test to the test suite.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129994 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove FIXME comments refering to non-existent code in JSDOMBinding.cpp
https://bugs.webkit.org/show_bug.cgi?id=97977

Reviewed by Adam Barth.

I did a quick grep through the code to determine where these FIXME
comments were suggesting that code should be merged. So far as I can
tell, 'immediatelyReportUnsafeAccessTo' only exists in these comments.

Just cleanup, no functional change.

* bindings/js/JSDOMBinding.cpp:
(WebCore::shouldAllowAccessToFrame):
(WebCore::shouldAllowAccessToDOMWindow):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
444kB below CSSParser::parseDeprecatedGradient() on Membuster3.
<http://webkit.org/b/97981>
<rdar://problem/12403058>

Reviewed by Anders Carlsson.

Slap an inline capacity of 2 on the Vector<CSSGradientColorStop> in CSSGradientValue.
This covers the majority of gradient values, and reduces memory consumption by ~250kB on Membuster3.

* css/CSSGradientValue.h:
(WebCore::CSSGradientValue::stopCount):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseLinearGradient):
(WebCore::CSSParser::parseGradientColorStops):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clean up HasTrivialConstructor/Destructor
https://bugs.webkit.org/show_bug.cgi?id=97754

Reviewed by Sam Weinig.

Mixed up the HasTrivialDestructor/Constructor case for VS2010 and later in the previous patch.

* wtf/TypeTraits.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Split EventTargetData out of NodeRareData to reduce memory use.
<http://webkit.org/b/97987>
<rdar://problem/12403258>

Reviewed by Anders Carlsson.

Move EventTargetData to its own Node-flag/hashmap instead of piggybacking on NodeRareData.
This reduces memory consumption by 1.06MB on Membuster3. Note that NodeRareData shrinks by
one pointer as well.

* dom/Node.cpp:
(WebCore::Node::~Node):
(WebCore::eventTargetDataMap):
(WebCore::Node::eventTargetData):
(WebCore::Node::ensureEventTargetData):
(WebCore::Node::clearEventTargetData):
(WebCore::Node::handleLocalEvents):
* dom/Node.h:
(WebCore::Node::hasEventTargetData):
(WebCore::Node::setHasEventTargetData):
* dom/NodeRareData.h:
(NodeRareData):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130000 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Add a test to verify that a plugin does not receive touch-events unless it explicitly requests for them
https://bugs.webkit.org/show_bug.cgi?id=97975

Patch by Sadrul Habib Chowdhury <sadrul@chromium.org> on 2012-09-30
Reviewed by Adam Barth.

Tools:

TestWebPlugin can now be configured to accept touch events or not. Use this
configurability to verify that a plugin does not receive touch events unless
it explicitly requests for them.

* DumpRenderTree/chromium/TestWebPlugin.cpp:
(TestWebPlugin::TestWebPlugin):
(TestWebPlugin::initialize):
(TestWebPlugin::parseBoolean):
* DumpRenderTree/chromium/TestWebPlugin.h:
(TestWebPlugin):

LayoutTests:

* platform/chromium/plugins/touch-events-expected.txt: Added.
* platform/chromium/plugins/touch-events.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Adding myself as a committer.

* Scripts/webkitpy/common/config/committers.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130002 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Trivial test fix after r127534.
https://bugs.webkit.org/show_bug.cgi?id=95813

Patch by Sergey Glazunov <serg.glazunov@gmail.com> on 2012-09-30
Reviewed by Kentaro Hara.

* fast/innerHTML/innerHTML-iframe-expected.txt:
* fast/innerHTML/innerHTML-iframe.html:
* platform/chromium/TestExpectations:
* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Modifications in a shadow tree don't update the Elements panel.
https://bugs.webkit.org/show_bug.cgi?id=97056

Reviewed by Pavel Feldman.

Source/WebCore:

Send characterDataModified event for shadow dom nodes too so they update the elements panel.

Test: inspector/elements/shadow-dom-modify-chardata.html

* dom/CharacterData.cpp:
(WebCore::CharacterData::dispatchModifiedEvent):

LayoutTests:

* inspector/elements/shadow-dom-modify-chardata-expected.txt: Added.
* inspector/elements/shadow-dom-modify-chardata.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130004 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make multiple fields date/time input UI related files to available all ports
https://bugs.webkit.org/show_bug.cgi?id=97989

Reviewed by Kent Tamura.

This patch adds multiple fields date/time input UI related files for
ports not using WebCore.gyp and simplifies include directive in
MonthInputType.h and TimeInputType.h.

Added files are:
  - html/BaseMultipleFieldsDateAndTimeInputType.{cpp,h}
  - html/shadow/DateTimeEditElement.{cpp,h}
  - html/shadow/DateTimeFieldElement.{cpp,h}
  - html/shadow/DateTimeFieldElements.{cpp,h}
  - html/shadow/DateTimeNumericFieldElement.{cpp,h}
  - html/shadow/DateTimeSymbolicFieldElement.{cpp,h}

No new tests. This patch doesn't change behavior.

* CMakeLists.txt: Changed to add multiple fields date/time input UI related files.
* GNUmakefile.list.am: ditto
* Target.pri: ditto
* WebCore.vcproj/WebCore.vcproj: ditto
* WebCore.xcodeproj/project.pbxproj: ditto
* html/MonthInputType.h: Changed to simplify include directive for base class.
* html/TimeInputType.h: ditto

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=97988
Crash on FrameTree::scopedChildCount()

Reviewed by Kent Tamura.

The series of crash reports says that there are some null pointer
access in scopedChildCount(). This change added a null guard
against Frame::document(), that can return null.

No new tests. This is tied to some specific timing and is hard to reproduce.

* page/FrameTree.cpp:
(WebCore::FrameTree::scopedChildCount):
(WebCore::FrameTree::scopedChild):
(WebCore):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130006 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sign in front of keyframe selector causes stylesheet parsing to abort
https://bugs.webkit.org/show_bug.cgi?id=96844

Patch by Glenn Adams <glenn@skynav.com> on 2012-09-30
Reviewed by Simon Fraser.

Source/WebCore:

Allow optional unary operator (+|-) on PERCENTAGE in keyframe selector.

Test: animations/keyframe-selector-negative-percentage.html

* css/CSSGrammar.y:
Add maybe_unary_operator to PERCENTAGE on keyframe selector. Negative keyframe
selector value is already ignored in StyleKeyframe::parseKeyString.

LayoutTests:

Add test case for correct handling of negative percentage in keyframe selector.

* animations/keyframe-selector-negative-percentage-expected.txt: Added.
* animations/keyframe-selector-negative-percentage.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130007 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r127727): Calendar picker is ignoring step
https://bugs.webkit.org/show_bug.cgi?id=97893

Reviewed by Kent Tamura.

Source/WebCore:

There were two mistakes:
- An if-statement to check step attribute validity was wrong, and
- DateTiemChooserParameters.step was milleseconds when it should be number of days.
This will be changing the DateTimeChooserParameters.step to milliseconds so we can handle steps for other input types in the future.

Test: fast/forms/date/calendar-picker-appearance-with-step.html

* Resources/pagepopups/calendarPicker.js:
(CalendarPicker):
* html/shadow/CalendarPickerElement.cpp:
(WebCore::CalendarPickerElement::openPopup): If statement was wrong.

LayoutTests:

* fast/forms/date/calendar-picker-appearance-with-step-expected.txt: Added.
* fast/forms/date/calendar-picker-appearance-with-step.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130008 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r130004.
http://trac.webkit.org/changeset/130004
https://bugs.webkit.org/show_bug.cgi?id=97996

Test shadow-dom-modify-chardata.html is failing (Requested by
keishi on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-10-01

Source/WebCore:

* dom/CharacterData.cpp:
(WebCore::CharacterData::dispatchModifiedEvent):

LayoutTests:

* inspector/elements/shadow-dom-modify-chardata-expected.txt: Removed.
* inspector/elements/shadow-dom-modify-chardata.html: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130009 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add appearance tests for multiple fields month input UI
https://bugs.webkit.org/show_bug.cgi?id=97888

Reviewed by Kent Tamura.

This patch adds tests for multiple fields month input UI and disables
these tests on ports which don't enable both ENABLE_INPUT_TYPE_MONTH
and ENABLE_INPUT_MULTIPLE_FIELDS_UI.

Note: We need to do rebaseline tests to update images for Chromium-Mac
and Chromium-Win.

Note: This patch affects ports which enable both ENABLE_INPUT_TYPE_MONTH
and ENABLE_INPUT_MULTIPLE_FIELDS_UI.

* fast/forms/month-multiple-fields/month-multiple-fields-appearance-basic-expected.txt: Added.
* fast/forms/month-multiple-fields/month-multiple-fields-appearance-basic.html:  Added for checking basic appearance.
* fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-classes-expected.txt: Added.
* fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-classes.html: Added for checking appearance of applying CSS pseudo classes, e.g. :enabled, :invalid, and so on.
* fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.txt: Added.
* fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements.html: Added for checking appearance of applying CSS pseudo elements, e.g. :after, :before, and so on.
* fast/forms/month-multiple-fields/month-multiple-fields-appearance-style-expected.txt: Added.
* fast/forms/month-multiple-fields/month-multiple-fields-appearance-style.html: Added for checking appearance of applying CSS styles
* platform/chromium-android/TestExpectations: Changed to disable tests for multiple fields month input UI.
* platform/chromium-linux/fast/forms/month-multiple-fields/month-multiple-fields-appearance-basic-expected.png: Added.
* platform/chromium-linux/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-classes-expected.png: Added.
* platform/chromium-linux/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Added.
* platform/chromium-linux/fast/forms/month-multiple-fields/month-multiple-fields-appearance-style-expected.png: Added.
* platform/chromium/TestExpectations: Changed to disable tests for multiple fields month input UI of Mac and Win for rebaseline.
* platform/efl/TestExpectations: Changed to disable tests for multiple fields month input UI.
* platform/gtk/TestExpectations: ditto
* platform/mac/TestExpectations: ditto
* platform/qt/TestExpectations: ditto
* platform/win/TestExpectations: ditto

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove overzealous assert in SVGElement::localAttributeToPropertyMap
https://bugs.webkit.org/show_bug.cgi?id=97291

Reviewed by Nikolas Zimmermann.

This patch removes an assert where we did not expect
SVGElement::localAttributeToPropertyMap where we did not to be called. This
function turns out to be useful and this patch removes that assert.

If we encounter a non-SVG tag during SVG parsing (e.g. <svg><price></svg>) we return a
vanilla SVGElement instance from SVGElementFactory::createSVGElement. Previously,
trying to animate this would ASSERT because it was not possible to determine the
animated type. After this patch, an empty localAttributeToPropertyMap is used so
that the animated type returned from SVGAnimateElement::determineAnimatedPropertyType
is AnimatedUnknown.

This patch simply removes an ASSERT so no test is provided.

* svg/SVGElement.cpp:
(WebCore::SVGElement::localAttributeToPropertyMap):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130011 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Unskip fast/innerHTML/innerHTML-iframe.html after r130003.

* platform/efl/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130012 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Fix GTK+ build after r129908.

* GNUmakefile.list.am: Add new files to compilation.

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