Form of FormAssociatedElement is not updated when id target changes.
https://bugs.webkit.org/show_bug.cgi?id=91042

Reviewed by Kent Tamura.

Source/WebCore:

Test: fast/forms/update-form-attribute-element.html

This patch introduces the IdTargetObserver and IdTargetObserverRegistry class.
They can be used to be notified when the element that an id is pointing to (the id target)
changes.

* CMakeLists.txt: Added IdTargetObserverRegistry.{h,cpp} and IdTargetObserver.{h,cpp}
* GNUmakefile.list.am: Ditto.
* Target.pri: Ditto.
* WebCore.gypi: Ditto.
* WebCore.vcproj/WebCore.vcproj: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* dom/DOMAllInOne.cpp:
* dom/IdTargetObserver.cpp: Added. When you want notified of changes to an id target, you should create a new class that inherits this.
(WebCore):
(WebCore::IdTargetObserver::IdTargetObserver):
(WebCore::IdTargetObserver::~IdTargetObserver):
* dom/IdTargetObserver.h: Added.
(WebCore):
(IdTargetObserver):
* dom/IdTargetObserverRegistry.cpp: Added.
(WebCore):
(WebCore::IdTargetObserverRegistry::create):
(WebCore::IdTargetObserverRegistry::addObserver): Register an IdTargetObserver to observe an id target.
(WebCore::IdTargetObserverRegistry::removeObserver): Unregisters an IdTargetObserver from observing.
(WebCore::IdTargetObserverRegistry::notifyObserversInternal):
* dom/IdTargetObserverRegistry.h: Added.
(WebCore):
(IdTargetObserverRegistry):
(WebCore::IdTargetObserverRegistry::IdTargetObserverRegistry):
(WebCore::IdTargetObserverRegistry::notifyObservers): Calls idTargetChanged on all observers for an id. Inlining first part of function for performance.
* dom/TreeScope.cpp:
(WebCore::TreeScope::TreeScope):
(WebCore::TreeScope::addElementById): Calls IdTargetObserverRegistry::notifyObservers because the id target might have changed.
(WebCore::TreeScope::removeElementById): Ditto.
* dom/TreeScope.h:
(WebCore):
(WebCore::TreeScope::idTargetObserverRegistry):
(TreeScope):
* html/FormAssociatedElement.cpp: Observer for id targets defined by the form attribute.
(WebCore::FormAssociatedElement::didMoveToNewDocument):
(WebCore::FormAssociatedElement::insertedInto):
(WebCore::FormAssociatedElement::removedFrom):
(WebCore::FormAssociatedElement::formAttributeChanged):
(WebCore::FormAssociatedElement::resetFormAttributeTargetObserver): Creates and sets up a new FormAttributeTargetObserver.
(WebCore):
(WebCore::FormAssociatedElement::formAttributeTargetChanged):
(WebCore::FormAttributeTargetObserver::create):
(WebCore::FormAttributeTargetObserver::FormAttributeTargetObserver):
(WebCore::FormAttributeTargetObserver::idTargetChanged):
* html/FormAssociatedElement.h:
(FormAssociatedElement):
* html/FormController.cpp:
* html/FormController.h:
(FormController):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::removedFrom):
(WebCore::HTMLFormElement::formElementIndexWithFormAttribute): Modified to take a range. It
scans the range and returns the index to insert the element in m_associatedElement.
(WebCore::HTMLFormElement::formElementIndex): Modified to only scan the elements in
m_associatedElement that precede and follow the form element.
* html/HTMLFormElement.h:
(HTMLFormElement):

LayoutTests:

* fast/forms/update-form-attribute-element-expected.txt: Added.
* fast/forms/update-form-attribute-element.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122584 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening, marked chromium test as flaky.
https://bugs.webkit.org/show_bug.cgi?id=91252

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122585 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix QtWebKit build with OpenGLES after GC3D/E3D refactor
https://bugs.webkit.org/show_bug.cgi?id=91156

Patch by Lauro Neto <lauro.neto@openbossa.org> on 2012-07-13
Reviewed by Noam Rosenthal.

Adds several build fixes.

* platform/graphics/GraphicsContext3D.h:
    Use E3DOpenGLES instead of previously removed E3DQt.

* platform/graphics/OpenGLESShims.h:
    Enable defines for Qt.

* platform/graphics/opengl/Extensions3DOpenGLES.cpp:
(WebCore::Extensions3DOpenGLES::blitFramebuffer):
(WebCore):
(WebCore::Extensions3DOpenGLES::renderbufferStorageMultisample):
(WebCore::Extensions3DOpenGLES::copyTextureCHROMIUM):
    Added pure virtual stubs.

(WebCore::Extensions3DOpenGLES::supportsExtension):
    Remove PROC suffix. See bug #91130.

* platform/graphics/opengl/Extensions3DOpenGLES.h:
(Extensions3DOpenGLES):
    Added pure virtual stubs.

* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
    Readded missing function after removed in r122250.

(WebCore):
    Use PLATFORM(BLACKBERRY) guard around port-specific include.

* platform/graphics/qt/GraphicsContext3DQt.cpp:
    Added USE(OPENGL_ES_2) guard instead of always loading the OpenGL extensions.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Use fillBuffer() instead of a user-defined background image.
https://bugs.webkit.org/show_bug.cgi?id=91180
RIM PR 171458

Reviewed by Rob Buis.
Internally reviewed by Andrew Lo.

By using Platform::Graphics::fillBuffer() to fill the
overscroll area, we save graphics memory for the buffer
that the background image was occupying.

Also adapt checkerboard drawing as it is now done using
fillBuffer() which replaces checkerBuffer().

In the same go, use the opportunity of the WebSettings
API change to make it more consistent, renaming the
OverZoomColor setting to OverScrollColor.

* Api/BackingStore.cpp:
(WebKit):
(BlackBerry::WebKit::BackingStorePrivate::paintDefaultBackground):
(BlackBerry::WebKit::BackingStorePrivate::blitContents):
(BlackBerry::WebKit::BackingStorePrivate::fillWindow):
* Api/BackingStore_p.h:
(BackingStorePrivate):
* Api/WebSettings.cpp:
(WebKit):
(BlackBerry::WebKit::WebSettings::standardSettings):
(BlackBerry::WebKit::WebSettings::overScrollColor):
(BlackBerry::WebKit::WebSettings::setOverScrollColor):
(BlackBerry::WebKit::WebSettings::isEnableDefaultOverScrollBackground):
(BlackBerry::WebKit::WebSettings::setEnableDefaultOverScrollBackground):
* Api/WebSettings.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed chromium gardening, updated test expectations.
https://bugs.webkit.org/show_bug.cgi?id=91254

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] resetBitmapZoomScale called while zooming preventing pinch zoom
https://bugs.webkit.org/show_bug.cgi?id=91247

Reviewed by Antonio Gomes.
Patch by Jacky Jiang <zhajiang@rim.com>

PR: 175432
On yahoo.com, the web page stopped zooming while trying to pinch as
WebPageClient::resetBitmapZoomScale(double) was being called by
WebPagePrivate::zoomToInitialScaleOnLoad() after load finished.
And also yahoo.com was keeping updating layout, which made it really
bad that zoomToInitialScaleOnLoad() was called many times when load
finished and the load type was FrameLoadTypeStandard or FrameLoadTypeSame.
As we only care about the situation that dispatchDidFirstVisuallyNonEmptyLayout()
happens after load finished, we can move the code to that method and
set a flag for WebPage layoutFinished() and zoomToInitialScaleOnLoad()
instead. In this way, we can ensure that the flag is only enabled when
dispatchDidFirstVisuallyNonEmptyLayout() is called after load finished
and get rid of calling zoomToInitialScaleOnLoad() lots of times when
keeping updating layout in such kind of situation.

Internally reviewed by Arvid Nilsson

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::setLoadState):
(BlackBerry::WebKit::WebPagePrivate::layoutFinished):
* Api/WebPage_p.h:
(BlackBerry::WebKit::WebPagePrivate::shouldZoomToInitialScaleOnLoad):
(BlackBerry::WebKit::WebPagePrivate::setShouldZoomToInitialScaleAfterLoadFinished):
(WebPagePrivate):
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::dispatchDidFirstVisuallyNonEmptyLayout):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening, updated test expectations.
http://bugs.webkit.org/show_bug.cgi?id=91255

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Note this test as flaky.

* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Also mark its evil twin as flaky.

* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122592 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening, updated chromium test expectations.
https://bugs.webkit.org/show_bug.cgi?id=91252

* platform/chromium/TestExpectations:

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