[CSS Exclusions] Clean up shape-inside tests' subpixel snapping code
https://bugs.webkit.org/show_bug.cgi?id=100704

Patch by Bear Travis <betravis@adobe.com> on 2012-11-02
Reviewed by Dirk Schulze.

Factor out the pixel snapping behavior from polygon tests to be shared with
the rounded rectangle tests. In sub-pixel layout, the rounding behavior may be
slightly different. This adds a new file, subpixel-utils.js, which tests for the
feature availability and provides functions for rounding at line left & line right.
I've also taken the opportunity to factor the window.internal.settings code into
rounded-rectangle.js and simple-polygon.js.

* fast/exclusions/resources/rounded-rectangle.js:
(simulateShape): Use the new subpixel rounding code.
* fast/exclusions/resources/simple-polygon.js:
(polygonXIntercepts): Ditto.
* fast/exclusions/resources/subpixel-utils.js: Added.
(SubPixelLayout): Adding the SubPixelLayout object which has helper methods
for determining how line edges should round, and whether subpixel layout is enabled.
* fast/exclusions/shape-inside/shape-inside-rounded-rectangle-002-expected.html:
* fast/exclusions/shape-inside/shape-inside-rounded-rectangle-002.html:
* fast/exclusions/shape-inside/shape-inside-rounded-rectangle-003-expected.html:
* fast/exclusions/shape-inside/shape-inside-rounded-rectangle-003.html:
* fast/exclusions/shape-inside/shape-inside-rounded-rectangle-004-expected.html:
* fast/exclusions/shape-inside/shape-inside-rounded-rectangle-004.html:
* fast/exclusions/shape-inside/shape-inside-simple-polygon-001-expected.html:
* fast/exclusions/shape-inside/shape-inside-simple-polygon-001.html:
* fast/exclusions/shape-inside/shape-inside-simple-polygon-002-expected.html:
* fast/exclusions/shape-inside/shape-inside-simple-polygon-002.html:
* fast/exclusions/shape-inside/shape-inside-simple-polygon-003-expected.html:
* fast/exclusions/shape-inside/shape-inside-simple-polygon-003.html:
* fast/exclusions/shape-inside/shape-inside-simple-polygon-004-expected.html:
* fast/exclusions/shape-inside/shape-inside-simple-polygon-004.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cut overgrown ElementAttributeData bitfield.
<http://webkit.org/b/101129>

Reviewed by Anders Carlsson.

Make sure the ElementAttributeData bitfield fits into 32 bits. Added a compile-time assertion
to guard against future bloatage.

* dom/ElementAttributeData.cpp:
(SameSizeAsElementAttributeData):
* dom/ElementAttributeData.h:
(ElementAttributeData):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r133375.
http://trac.webkit.org/changeset/133375
https://bugs.webkit.org/show_bug.cgi?id=101138

Caused 3 tests to fail on Mac (Requested by aboxhall-laptop on
#webkit).

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

Source/WebCore:

* platform/text/LineBreakIteratorPoolICU.h:
(WebCore::LineBreakIteratorPool::take):
(WebCore::LineBreakIteratorPool::put):
(LineBreakIteratorPool):
* platform/text/TextBreakIterator.h:
(WebCore):
(WebCore::LazyLineBreakIterator::LazyLineBreakIterator):
(WebCore::LazyLineBreakIterator::get):
(WebCore::LazyLineBreakIterator::reset):
(LazyLineBreakIterator):
* platform/text/TextBreakIteratorICU.cpp:
(WebCore::acquireLineBreakIterator):
(WebCore::releaseLineBreakIterator):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::LineBreaker::nextLineBreak):
* rendering/RenderText.cpp:
(WebCore::RenderText::computePreferredLogicalWidths):
* rendering/RenderText.h:
(WebCore):
* rendering/break_lines.cpp:
(WebCore):
(WebCore::isBreakableSpace):
(WebCore::needsLineBreakIterator):
(WebCore::nextBreakablePosition):
(WebCore::nextBreakablePositionIgnoringNBSP):
* rendering/break_lines.h:
(WebCore):
(WebCore::isBreakable):

LayoutTests:

* css3/line-break/line-break-auto-centered-expected.html: Removed.
* css3/line-break/line-break-auto-centered.html: Removed.
* css3/line-break/line-break-auto-half-kana-expected.html: Removed.
* css3/line-break/line-break-auto-half-kana.html: Removed.
* css3/line-break/line-break-auto-hyphens-expected.html: Removed.
* css3/line-break/line-break-auto-hyphens.html: Removed.
* css3/line-break/line-break-auto-inseparables-expected.html: Removed.
* css3/line-break/line-break-auto-inseparables.html: Removed.
* css3/line-break/line-break-auto-iteration-marks-expected.html: Removed.
* css3/line-break/line-break-auto-iteration-marks.html: Removed.
* css3/line-break/line-break-auto-postfixes-expected.html: Removed.
* css3/line-break/line-break-auto-postfixes.html: Removed.
* css3/line-break/line-break-auto-prefixes-expected.html: Removed.
* css3/line-break/line-break-auto-prefixes.html: Removed.
* css3/line-break/line-break-auto-sound-marks-expected.html: Removed.
* css3/line-break/line-break-auto-sound-marks.html: Removed.
* css3/line-break/line-break-loose-centered-expected.html: Removed.
* css3/line-break/line-break-loose-centered.html: Removed.
* css3/line-break/line-break-loose-half-kana-expected.html: Removed.
* css3/line-break/line-break-loose-half-kana.html: Removed.
* css3/line-break/line-break-loose-hyphens-expected.html: Removed.
* css3/line-break/line-break-loose-hyphens.html: Removed.
* css3/line-break/line-break-loose-inseparables-expected.html: Removed.
* css3/line-break/line-break-loose-inseparables.html: Removed.
* css3/line-break/line-break-loose-iteration-marks-expected.html: Removed.
* css3/line-break/line-break-loose-iteration-marks.html: Removed.
* css3/line-break/line-break-loose-postfixes-expected.html: Removed.
* css3/line-break/line-break-loose-postfixes.html: Removed.
* css3/line-break/line-break-loose-prefixes-expected.html: Removed.
* css3/line-break/line-break-loose-prefixes.html: Removed.
* css3/line-break/line-break-loose-sound-marks-expected.html: Removed.
* css3/line-break/line-break-loose-sound-marks.html: Removed.
* css3/line-break/line-break-normal-centered-expected.html: Removed.
* css3/line-break/line-break-normal-centered.html: Removed.
* css3/line-break/line-break-normal-half-kana-expected.html: Removed.
* css3/line-break/line-break-normal-half-kana.html: Removed.
* css3/line-break/line-break-normal-hyphens-expected.html: Removed.
* css3/line-break/line-break-normal-hyphens.html: Removed.
* css3/line-break/line-break-normal-inseparables-expected.html: Removed.
* css3/line-break/line-break-normal-inseparables.html: Removed.
* css3/line-break/line-break-normal-iteration-marks-expected.html: Removed.
* css3/line-break/line-break-normal-iteration-marks.html: Removed.
* css3/line-break/line-break-normal-postfixes-expected.html: Removed.
* css3/line-break/line-break-normal-postfixes.html: Removed.
* css3/line-break/line-break-normal-prefixes-expected.html: Removed.
* css3/line-break/line-break-normal-prefixes.html: Removed.
* css3/line-break/line-break-normal-sound-marks-expected.html: Removed.
* css3/line-break/line-break-normal-sound-marks.html: Removed.
* css3/line-break/line-break-strict-centered-expected.html: Removed.
* css3/line-break/line-break-strict-centered.html: Removed.
* css3/line-break/line-break-strict-half-kana-expected.html: Removed.
* css3/line-break/line-break-strict-half-kana.html: Removed.
* css3/line-break/line-break-strict-hyphens-expected.html: Removed.
* css3/line-break/line-break-strict-hyphens.html: Removed.
* css3/line-break/line-break-strict-inseparables-expected.html: Removed.
* css3/line-break/line-break-strict-inseparables.html: Removed.
* css3/line-break/line-break-strict-iteration-marks-expected.html: Removed.
* css3/line-break/line-break-strict-iteration-marks.html: Removed.
* css3/line-break/line-break-strict-postfixes-expected.html: Removed.
* css3/line-break/line-break-strict-postfixes.html: Removed.
* css3/line-break/line-break-strict-prefixes-expected.html: Removed.
* css3/line-break/line-break-strict-prefixes.html: Removed.
* css3/line-break/line-break-strict-sound-marks-expected.html: Removed.
* css3/line-break/line-break-strict-sound-marks.html: Removed.
* platform/chromium-linux/css3/line-break/line-break-auto-half-kana-expected.html: Removed.
* platform/chromium-linux/css3/line-break/line-break-auto-sound-marks-expected.html: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Improve CSSParser::setupParser() since the prefix/suffix are literals
https://bugs.webkit.org/show_bug.cgi?id=101107

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-11-02
Reviewed by Andreas Kling.

* css/CSSParser.cpp:
(WebCore::CSSParser::setupParser):
* css/CSSParser.h:
(CSSParser):
(WebCore::CSSParser::setupParser):
CSSParser::setupParser() is only used with literals prefix and suffix. We do not have
to compute the length at runtime, we can direclty encode it in the binary.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Move soup authentication from GtkAuthenticationDialog to WebCore
https://bugs.webkit.org/show_bug.cgi?id=99914

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Move the actual soup authentication code from the GtkAuthenticationDialog to ResourceHandleSoup.
This allows a more generic implementation of authentication, for example, one where a WebKit2
client can completely handle authentication.

No new tests. This does not change behavior.

* platform/gtk/GtkAuthenticationDialog.cpp: Remove references to the SoupPasswordManager, which
is going away in the next release of Gnome. Instead we always assume that the authentication backend has
support for remembering passwords and pass that information along with the answer to the authentication
request.

The rest of the changes to this class can be summarized as:
1. Getting the information from the AuthenticationChallenge instead of directly from the libsoup
   objects.
2. Using the AuthenticationClient to accomplish the authentication instead of talking to libsoup
   directly.
* platform/gtk/GtkAuthenticationDialog.h:
(GtkAuthenticationDialog): Remove members which are no longer used.
* platform/network/ResourceHandle.h:
(ResourceHandle): ResourceHandleSoup now implements the entire AuthenticationClient interface.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::WebCoreSynchronousLoader::didReceiveAuthenticationChallenge): Don't handle authentication
for synchronous handles.
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Now set the current challenge on
the internal data structure.
(WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential): Added.
(WebCore::ResourceHandle::receivedCredential): Added.
(WebCore::ResourceHandle::receivedCancellation): Added.
(WebCore::authenicateCallback): Pass the handle as the authentication client.

Source/WebKit/gtk:

The calls which actually authenticate a soup message are gone from the GtkAuthenticationDialog. Since the
GtkAuthenticationDialog exposed by the WebKitSoupAuthentication class in the GTK+ API work without a
ResourceHandle (they are more general), we add a WebKitSoupAuthDialogAuthenticationClient added to avoid
breaking API. This is unused by either Epiphany or internally in WebKitGTK+.

* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::dispatchDidReceiveAuthenticationChallenge): The authentication dialog
now just takes the AuthenticationChallenge instead of the libsoup objects.
* webkit/webkitsoupauthdialog.cpp:
(WebKitSoupAuthDialogAuthenticationClient): Added this helper.
(sessionAuthenticate): Use the new WebKitSoupAuthDialogAuthenticationClient.

Source/WebKit2:

Instead of passing the libsoup objects to the GtkAuthenticationDialog, pass the
AuthenticationChallenge itself.

* WebProcess/WebCoreSupport/gtk/WebFrameLoaderClientGtk.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix build warning in PluginView.cpp on release build
https://bugs.webkit.org/show_bug.cgi?id=101049

Patch by KyungTae Kim <ktf.kim@samsung.com> on 2012-11-02
Reviewed by Kentaro Hara.

The protocol, host, port parameters are not used when LOG_DISABLED
Use UNUSED_PARAM macro for removing -Wunused-parameter warning

* plugins/PluginView.cpp:
(WebCore::PluginView::getAuthenticationInfo):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
sCurrentPaintTimeStamp is not initialized when FrameView::paintContents returns in the middle
https://bugs.webkit.org/show_bug.cgi?id=99990

Patch by KyungTae Kim <ktf.kim@samsung.com> on 2012-11-02
Reviewed by Darin Adler.

Move initialization code for sCurrentPaintTimeStamp to the below of early returns,
because it was not reset after early return.

* page/FrameView.cpp:
(WebCore::FrameView::paintContents):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Shadow] ShadowRoot should be able to know the existence of <content>
https://bugs.webkit.org/show_bug.cgi?id=100921

Reviewed by Dimitri Glazkov.

Source/WebCore:

When <content> is inserted into or removed from a shadow subtree, ShadowRoot counts the number of <content>.
It provides O(1) method to check the existence of <content>.

This is necessary when we implement a fast checking path for distribution invalidation when an element attribute
is changed. Larger context is explained in Bug 100451.

Test: fast/dom/shadow/has-content-elements.html

* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::ShadowRoot):
(WebCore::ShadowRoot::hasInsertionPoint): Since we track both <content> and <shadow>, we don't need to traverse
all the descendants of ShadowRoot anymore.
* dom/ShadowRoot.h:
(WebCore::ShadowRoot::registerContentElement):
(WebCore::ShadowRoot::unregisterContentElement):
(WebCore::ShadowRoot::hasContentElement):
(ShadowRoot):
* html/shadow/HTMLContentElement.cpp:
(WebCore::HTMLContentElement::HTMLContentElement):
(WebCore::HTMLContentElement::insertedInto): When <content> is inserted into ShadowDOM subtree,
we notify it to the ShadowRoot. Note that only active <content> element is counted.
(WebCore):
(WebCore::HTMLContentElement::removedFrom):
* html/shadow/HTMLContentElement.h:
(HTMLContentElement):
* testing/Internals.cpp:
(WebCore::Internals::hasContentElement):
(WebCore):
* testing/Internals.h:
(Internals):
* testing/Internals.idl:

LayoutTests:

* fast/dom/shadow/has-content-elements-expected.txt: Added.
* fast/dom/shadow/has-content-elements.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133392 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r132014-r132047): Webkit Inspector Window docking broken
https://bugs.webkit.org/show_bug.cgi?id=101125

Reviewed by Vsevolod Vlasov.

Source/WebCore:

Added "bottom" as default docked state.

* inspector/front-end/DockController.js:
(WebInspector.DockController):

Source/WebKit2:

Migrated from ?docked= to ?dockSide= format.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::createInspectorPage):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Decouple Attr logic from ElementAttributeData.
<http://webkit.org/b/101126>

Reviewed by Antti Koivisto.

Move all logic dealing with Attr DOM nodes from ElementAttributeData to Element.
This makes more sense since an Attr is tied to a single Element, but an ElementAttributeData
can be shared by any number of Elements at a given time.

Also updated naming convention from just "Attr" to "Attr node" in the code I was touching.
"Attr" is way too generic, and has been historically confused with WebCore::Attribute a lot.

* dom/Element.h:
* dom/ElementAttributeData.h:
* dom/Element.cpp:
(WebCore::attrNodeListMap):
(WebCore::attrNodeListForElement):
(WebCore::ensureAttrNodeListForElement):
(WebCore::removeAttrNodeListForElement):
(WebCore::findAttrNodeInList):
(WebCore::Element::~Element):
(WebCore::Element::detachAttribute):
(WebCore::Element::setAttributeNode):
(WebCore::Element::removeAttributeInternal):
(WebCore::Element::getAttributeNode):
(WebCore::Element::getAttributeNodeNS):
(WebCore::Element::normalizeAttributes):
(WebCore::Element::attrIfExists):
(WebCore::Element::ensureAttr):
(WebCore::Element::detachAttrNodeFromElementWithValue):
(WebCore::Element::detachAllAttrNodesFromElement):
(WebCore::Element::cloneAttributesFromElement):

    Move everything Attr-related into Element.cpp while simplifying some loops and remove
    conditions that are no longer needed as they used to depend on having an attributeData().

* dom/Node.h:
(WebCore::Node::hasSyntheticAttrChildNodes):
(WebCore::Node::setHasSyntheticAttrChildNodes):

    Renamed the hasAttrList() node flag to hasSyntheticAttrChildNodes().

* dom/Attr.cpp:
(WebCore::Attr::detachFromElementWithValue):

    Remove awkward indirection and let the call site deal with removing the Attr node from
    the Element's list of Attr nodes.

* dom/ElementAttributeData.cpp:
(WebCore::ElementAttributeData::clearAttributes):

    Remove now-unused Element* argument.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: %d, %i, and %f log formatters have same result
https://bugs.webkit.org/show_bug.cgi?id=101148

Reviewed by Alexander Pavlov.

Source/WebCore:

Added separate formatters for %f, %i, %d and %s.

Test: inspector/console/console-message-format.html

* inspector/front-end/ConsoleMessage.js:
(WebInspector.ConsoleMessageImpl.prototype.stringFormatter):
(WebInspector.ConsoleMessageImpl.prototype.floatFormatter):
(WebInspector.ConsoleMessageImpl.prototype.integerFormatter):

LayoutTests:

* inspector/console/console-format-expected.txt:
* inspector/console/console-format.html:
* inspector/console/console-message-format-expected.txt: Added.
* inspector/console/console-message-format.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement HTMLFormElement#requestAutocomplete and associated events
https://bugs.webkit.org/show_bug.cgi?id=100557

Patch by Dan Beam <dbeam@chromium.org> on 2012-11-03
Reviewed by Adam Barth.

Source/WebCore:

Implements an initial version of the proposal for interactive autocomplete outlined in this email:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-October/037711.html

The goal of this patch is to allow web authors to call formElement.requestAutocomplete(); after subscribing for
autocomplete/autocompleteerror events on formElement. If the form's [autocomplete] attribute is "off" an
error will be dispatched. Otherwise, a request will be issued to the FrameLoaderClient.  At the moment, the
implementation in Chrome (https://codereview.chromium.org/11270018/) will simply dispatch an error until the
UI on Chrome's side is built. Both autocomplete and autocompleteerror events will be dispatched asynchronously
after a small delay to behave consistently in all situations and implementations.

Currently this is behind the feature flag REQUEST_AUTOCOMPLETE, which is disabled.

Test: fast/forms/form-request-autocomplete.html

* dom/EventNames.h:
(WebCore):

Added autocomplete and autocompleteerror events. The autocomplete event is dispatched after a user adds more
information to a form using the future UI. This is not currently dispatched in any implementation (including Chrome)
but will be in the future. The autocompleteerror event is dispatched when the form has [autocomplete="off"] on the
node being asked for an interactive autocomplete. The user agent may also dispatch this event if it doesn't implement
this API but has turned on the feature flag, can't currently show an autocomplete UI (e.g. running headlessly or in
an HTML notification, security concerns, or any other reason it desires).

* html/HTMLAttributeNames.in:

Added onautocomplete and onautocompleteerror attributes so they can be parsed when creating form elements and used
as event listeners. For example:

  <form onautocomplete="/* when autocomplete succeeds */" autocompleteerror="/* when autocomplete fails */">

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::HTMLFormElement):
(WebCore):

Added m_requestAutocompleteTimer (a timer that's used to dispatch events asynchronously) to the initializer list that
triggers requestAutocompleteTimerFired when it times out.

(WebCore::HTMLFormElement::requestAutocomplete):

Called when HTMLFormElement#requestAutocomplete is called from JS (also see HTMLFormElement.idl) and decides whether
to dispatch an error and exit early (in the case where autocomplete="off") or pass the request on to the
FrameLoaderClient.

(WebCore::HTMLFormElement::finishRequestAutocomplete):

Called when the request for an interactive autocomplete is finished with either a success or error result. This
causes an event to queue and fired after a 0 second delay. Events are owned by HTMLFormElement and reference the
target element (this) until fired.

(WebCore::HTMLFormElement::requestAutocompleteTimerFired):

Called when the event timer runs out to pump the queue of current events. Events are released on dispatch.

(WebCore::HTMLFormElement::parseAttribute):

Encountering onautocomplete or onautocompleteerror attributes while parsing HTMLFormElements now adds event listeners
for autocomplete an autocompleteerror events (respectively) to dispatch the value of the attribute as a script.

* html/HTMLFormElement.h:
(HTMLFormElement):

Added various methods and data members as required by the implementation.

* html/HTMLFormElement.idl:

Added the method requestAutocomplete and associated DOM event handler attributes (onautocomplete/onautocompleteerror)
to HTMLFormElement's public DOM API (unprefixed, as per Ian Hickson's advice). All are require the Conditional
REQUEST_AUTOCOMPLETE to be enabled to be activated.

* loader/EmptyClients.cpp:
(WebCore):
(WebCore::EmptyFrameLoaderClient::didRequestAutocomplete):

Added noop implementation for FrameLoader::didRequestAutocomplete.

* loader/EmptyClients.h:
(EmptyFrameLoaderClient):

Added FrameLoader::didRequestAutocomplete to EmptyFrameLoaderClient interface.

* loader/FrameLoaderClient.h:
(FrameLoaderClient):

Added noop implementation to FrameLoaderClient interface (which is implemented chromium's FrameLoaderLoaderImpl.cpp).

Source/WebKit/chromium:

Implements an initial version of the proposal for interactive autocomplete outlined in this email:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-October/037711.html

The goal of this patch is to allow web authors to call formElement.requestAutocomplete(); after subscribing for
autocomplete/autocompleteerror events on formElement. If the form's [autocomplete] attribute is "off" an
error will be dispatched. Otherwise, a request will be issued to the FrameLoaderClient.  At the moment, the
implementation in Chrome (https://codereview.chromium.org/11270018/) will simply dispatch an error until the
UI on Chrome's side is built. Both autocomplete and autocompleteerror events will be dispatched asynchronously
after a small delay to behave consistently in all situations and implementations.

Currently this is behind the feature flag REQUEST_AUTOCOMPLETE, which is disabled.

Test: fast/forms/form-request-autocomplete.html

* public/WebAutofillClient.h:
(WebKit):
(WebAutofillClient):
(WebKit::WebAutofillClient::didRequestAutocomplete):

Added WebAutofillClient::didRequestAutocomplete to chrome's public WebKit interface.

* public/WebFormElement.h:

Added an enum that matches HTMLFormElement::AutocompleteResult (and added compile time assert) and a public method
(WebFormElement::finishRequestAutocomplete) to WebFormElement's public interface.

* src/AssertMatchingEnums.cpp:

Added a compile time assert to guarantee the HTMLFormElement::AutocompleteResult enum matches the
WebFormElement::AutocompleteResult enum.

* src/FrameLoaderClientImpl.cpp:
(WebKit):
(WebKit::FrameLoaderClientImpl::didRequestAutocomplete):

Implemented the added FrameLoaderClient::didRequestAutocomplete, which simply passes through to the
WebAutofillClient.

* src/FrameLoaderClientImpl.h:
(FrameLoaderClientImpl):

Implementing FrameLoaderClient::didRequestAutocomplete.

* src/WebFormElement.cpp:
(WebKit::WebFormElement::finishRequestAutocomplete):
(WebKit):

Added WebFormElement::finishRequestAutocomplete to allow chromium's renderer a public API to call to finish the
autocomplete request on a WebFormElement.

LayoutTests:

Adds tests for an initial implementation of the proposal for interactive autocomplete outlined in this email:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-October/037711.html

The goal of this patch is to allow web authors to call formElement.requestAutocomplete(); after subscribing
for autocomplete/autocompleteerror events on formElement. If the form's [autocomplete] attribute is "off" an
error will be dispatched. Otherwise, a request will be issued to the FrameLoaderClient. At the moment, the
implementation in Chrome (https://codereview.chromium.org/11270018/) will simply dispatch an error until the
UI on Chrome's side is built. Both autocomplete and autocompleteerror events will be dispatched asynchronously
after a small delay to behave consistently in all situations and implementations.

Currently the implementation is behind the feature flag REQUEST_AUTOCOMPLETE, which is disabled, so the test
is expected to fail. This test verifies that currently no client implements this method on HTMLFormElement
(HTMLFormElement#requestAutocomplete) and returns. When the chrome-side lands I'll add a success case in
LayoutTests/platform/chromium/fast/forms/ with the expected successful results.

* fast/forms/form-request-autocomplete-expected.txt: Added.
* fast/forms/form-request-autocomplete.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] setPlatformStrategies always asserts after r132744
https://bugs.webkit.org/show_bug.cgi?id=100838

Reviewed by Simon Hausmann.

Source/WebCore:

The problem here is that we use QWebSettings::clearMemoryCaches, a WebKit1 API
from the injected bundle, which calls initializeWebCoreQt and it sets the platform
strategies to the one for WebKit1. We should stop using WebKit1 API's from WebKit2
code. In order to keep the behavior, this patch adds exported helpers to WebCore
that can be used from DumpRenderTree and WebKitTestRunner. This is the same idea
as WebCoreTestSupport but these helpers are specific to Qt. Technically we could
add it to the WebKit1 API for the time being, but my goal was to move in the direction
of removing the WebKit1 dependency from WebKitTestRunner. We only build the file
in non production mode.

Basically covered by all tests.

* Target.pri:
* WebCore.pri: We need to link against fontconfig (only in non-production mode) since
initializeTestFonts uses it.
* platform/qt/QtTestSupport.cpp: Added. I choose GPL license because code from qwebsettings.cpp
is also under that.
(WebKit):
(WebKit::QtTestSupport::clearMemoryCaches): This is basically a copy of QWebSettings::clearMemoryCaches
without calling initializeWebCoreQt.
(WebKit::QtTestSupport::initializeTestFonts): I moved this code here as well now that we have to expose
symbols from WebCore anyway. The advantage is that now we don't have to build it twice and we don't need
additional files to forward it from the directory of DumpRenderTree for WebKitTestRunner.
I added a call to FontCace::invalidate in the case when the font set has been changed so that it will do
the job even if we would stop clearing all caches between tests. Also moved the call to
QFontDatabase::removeAllApplicationFonts from callers to here.
* platform/qt/QtTestSupport.h:
(WebKit):
(QtTestSupport):

Tools:

Turned test runners to use the new QtTestSupport.

* DumpRenderTree/qt/DumpRenderTree.pro:
* DumpRenderTree/qt/DumpRenderTreeMain.cpp:
(main):
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::DumpRenderTree::open):
* QtTestBrowser/QtTestBrowser.pro:
* QtTestBrowser/qttestbrowser.cpp:
(LauncherApplication::handleUserOptions):
* WebKitTestRunner/InjectedBundle/Target.pri:
* WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp:
(WTR::activateFonts):
* WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp: Removed.
* WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h: Removed.
* WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp:
* WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp:
(WTR::TestRunner::platformInitialize): Removed the comment from here
because it was just lying, apparently two times. First, it is not incorrect
to reinitialize our font set and clear font caches, it is what the tests
expect. Second, the use of QRawFont has nothing to do with the font cache.
* WebKitTestRunner/Target.pri:
* WebKitTestRunner/qt/main.cpp:
(main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133397 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r132858): Crash below -[DOMElement setClassName:] when called with a nil string

Reviewed by Anders Carlsson.

The changes in r132858 introduced an overload of AtomicString::add for CFStrings. However, the overload
that was introduced is not null safe.

* platform/text/cf/AtomicStringCF.cpp:
(WTF::AtomicString::add): Handle a null string by returning a null StringImpl.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133398 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Speculative fix to eliminate flakiness in
css3/filters/blur-filter-page-scroll-self.html
https://bugs.webkit.org/show_bug.cgi?id=91620.
Suspicion is that a prior test is setting
window.internals.settings.setEnableCompositingForFixedPosition(true),
causing this test to be intermittely run on the GPU, giving different
pixel results depending on test order.

Reviewed by Jochen Eisinger.

Covered by css3/filters/blur-filter-page-scroll-self.html

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
* testing/InternalSettings.h:
(Backup):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r133397.
http://trac.webkit.org/changeset/133397
https://bugs.webkit.org/show_bug.cgi?id=101155

"Broke Qt. No way to force the damn bots to do a clean build.
I'm giving up." (Requested by kbalazs on #webkit).

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

Source/WebCore:

* Target.pri:
* WebCore.pri:
* platform/qt/QtTestSupport.h: Removed.

Tools:

* DumpRenderTree/qt/DumpRenderTree.pro:
* DumpRenderTree/qt/DumpRenderTreeMain.cpp:
(main):
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::DumpRenderTree::open):
* DumpRenderTree/qt/QtInitializeTestFonts.cpp: Renamed from Source/WebCore/platform/qt/QtTestSupport.cpp.
(WebKit):
(WebKit::initializeTestFonts):
* DumpRenderTree/qt/QtInitializeTestFonts.h: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp.
(WebKit):
* QtTestBrowser/QtTestBrowser.pro:
* QtTestBrowser/qttestbrowser.cpp:
(LauncherApplication::handleUserOptions):
* WebKitTestRunner/InjectedBundle/Target.pri:
* WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp:
(WTR::activateFonts):
* WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp.
* WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp.
* WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp:
(WTR::TestRunner::platformInitialize):
* WebKitTestRunner/Target.pri:
* WebKitTestRunner/qt/main.cpp:
(main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133400 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed gardening.

* platform/chromium-win/compositing/geometry/fixed-position-transform-composited-page-scale-down-expected.png:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] New baselines for no-longer-flaky tests.  Unreviewed.

* platform/chromium-linux/compositing/geometry/fixed-position-transform-composited-page-scale-expected.png:
* platform/chromium-mac-lion/compositing/geometry/fixed-position-iframe-composited-page-scale-down-expected.png:
* platform/chromium-mac-lion/compositing/geometry/fixed-position-transform-composited-page-scale-down-expected.png:
* platform/chromium-mac-lion/compositing/geometry/fixed-position-transform-composited-page-scale-expected.png:
* platform/chromium-mac-snowleopard/compositing/geometry/fixed-position-iframe-composited-page-scale-down-expected.png:
* platform/chromium-mac/compositing/geometry/fixed-position-iframe-composited-page-scale-down-expected.png:
* platform/chromium-mac/compositing/geometry/fixed-position-transform-composited-page-scale-down-expected.png:
* platform/chromium-mac/compositing/geometry/fixed-position-transform-composited-page-scale-expected.png:
* platform/chromium-win/compositing/geometry/fixed-position-transform-composited-page-scale-expected.png:
* platform/chromium/TestExpectations:
* platform/efl-wk1/compositing/geometry/fixed-position-iframe-composited-page-scale-down-expected.png: Renamed from LayoutTests/platform/efl/compositing/geometry/fixed-position-iframe-composited-page-scale-down-expected.png.
* platform/efl-wk1/compositing/geometry/fixed-position-transform-composited-page-scale-expected.png: Renamed from LayoutTests/platform/efl/compositing/geometry/fixed-position-transform-composited-page-scale-expected.png.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133402 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] setPlatformStrategies always asserts after r132744
https://bugs.webkit.org/show_bug.cgi?id=100838

Reviewed by Simon Hausmann.

Reland with build fix.

Source/WebCore:

The problem here is that we use QWebSettings::clearMemoryCaches, a WebKit1 API
from the injected bundle, which calls initializeWebCoreQt and it sets the platform
strategies to the one for WebKit1. We should stop using WebKit1 API's from WebKit2
code. In order to keep the behavior, this patch adds exported helpers to WebCore
that can be used from DumpRenderTree and WebKitTestRunner. This is the same idea
as WebCoreTestSupport but these helpers are specific to Qt. Technically we could
add it to the WebKit1 API for the time being, but my goal was to move in the direction
of removing the WebKit1 dependency from WebKitTestRunner. We only build the file
in non production mode.

Basically covered by all tests.

* Target.pri:
* WebCore.pri: We need to link against fontconfig (only in non-production mode) since
initializeTestFonts uses it.
* platform/qt/QtTestSupport.cpp: Added. I choose GPL license because code from qwebsettings.cpp
is also under that.
(WebKit):
(WebKit::QtTestSupport::clearMemoryCaches): This is basically a copy of QWebSettings::clearMemoryCaches
without calling initializeWebCoreQt.
(WebKit::QtTestSupport::initializeTestFonts): I moved this code here as well now that we have to expose
symbols from WebCore anyway. The advantage is that now we don't have to build it twice and we don't need
additional files to forward it from the directory of DumpRenderTree for WebKitTestRunner.
I added a call to FontCace::invalidate in the case when the font set has been changed so that it will do
the job even if we would stop clearing all caches between tests. Also moved the call to
QFontDatabase::removeAllApplicationFonts from callers to here.
* platform/qt/QtTestSupport.h:
(WebKit):
(QtTestSupport):

Tools:

Turned test runners to use the new QtTestSupport.

* DumpRenderTree/qt/DumpRenderTree.pro:
* DumpRenderTree/qt/DumpRenderTreeMain.cpp:
(main):
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::DumpRenderTree::open):
* DumpRenderTree/qt/QtInitializeTestFonts.h: Removed.
* MiniBrowser/qt/MiniBrowser.pro:
* QtTestBrowser/QtTestBrowser.pro:
* QtTestBrowser/qttestbrowser.cpp:
(LauncherApplication::handleUserOptions):
* WebKitTestRunner/InjectedBundle/Target.pri:
* WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp:
(WTR::activateFonts):
* WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp: Removed.
* WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h: Removed.
* WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp:
(WTR::TestRunner::platformInitialize):  Removed the comment from here
because it was just lying, apparently two times. First, it is not incorrect
to reinitialize our font set and clear font caches, it is what the tests
expect. Second, the use of QRawFont has nothing to do with the font cache.
* WebKitTestRunner/Target.pri:
* WebKitTestRunner/qt/main.cpp:
(main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133403 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] setPlatformStrategies always asserts after r132744
https://bugs.webkit.org/show_bug.cgi?id=100838

Unreviewed buildfix.

* WebKitTestRunner/Target.pri:

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