Clearing MarkedBlock::m_newlyAllocated should be separate from MarkedBlock::clearMarks
https://bugs.webkit.org/show_bug.cgi?id=121007

Reviewed by Oliver Hunt.

We call clearMarks on every MarkedBlock in the Heap, whereas we only need to clear 
m_newlyAllocated for the m_currentBlock at the time of the last canonicalizeCellLiveness() 
for each MarkedAllocator. We also need to call it on every block in the largeAllocators 
because each one of their blocks is canonicalized as it is used.

* heap/Heap.cpp:
(JSC::Heap::markRoots):
* heap/MarkedAllocator.h:
(JSC::MarkedAllocator::getAndClearCanonicalizedBlock):
(JSC::MarkedAllocator::MarkedAllocator):
(JSC::MarkedAllocator::canonicalizeCellLivenessData):
* heap/MarkedBlock.h:
(JSC::MarkedBlock::lastChanceToFinalize):
(JSC::MarkedBlock::clearMarks):
(JSC::MarkedBlock::clearNewlyAllocated):
* heap/MarkedSpace.cpp:
(JSC::clearNewlyAllocatedInBlock):
(JSC::ClearNewlyAllocated::operator()):
(JSC::MarkedSpace::clearNewlyAllocated):
* heap/MarkedSpace.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155316 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Calculating the size of the Heap should not require walking over it
https://bugs.webkit.org/show_bug.cgi?id=120910

Reviewed by Geoffrey Garen.

Currently Heap::size() is O(sizeof(Heap)). This is too expensive to 
call during a collection. We should keep a count of visited and copied 
bytes as each collection progresses so as to avoid re-walking the Heap 
at the end of collection.

* heap/GCThreadSharedData.cpp:
(JSC::GCThreadSharedData::childBytesVisited):
(JSC::GCThreadSharedData::childBytesCopied):
* heap/GCThreadSharedData.h:
* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::markRoots):
(JSC::Heap::sizeAfterCollect):
(JSC::Heap::collect):
* heap/Heap.h:
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::SlotVisitor):
(JSC::SlotVisitor::reset):
* heap/SlotVisitor.h:
(JSC::SlotVisitor::bytesVisited):
(JSC::SlotVisitor::bytesCopied):
* heap/SlotVisitorInlines.h:
(JSC::SlotVisitor::internalAppend):
(JSC::SlotVisitor::copyLater):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
InlineBox::root() should return a reference.
<https://webkit.org/b/121014>

Reviewed by Antti Koivisto.

There is always a root inline box, so make root() return a reference.
Also make some effort to cache the result in a local at call sites.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Deprecate AdoptCF and AdoptNS (on all platforms except iOS for now)
https://bugs.webkit.org/show_bug.cgi?id=121017

Reviewed by Andreas Kling.

* wtf/RetainPtr.h: Use the preprocessor to rename AdoptCF and AdoptNS
to DeprecatedAdoptCF and DeprecatedAdoptNS on all platforms except
for iOS. Also removed an unneeded explicit conversion in the retainPtr
function. Also re-sorted the using lines at the end of the file.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make Editor::deleteButtonController a reference
https://bugs.webkit.org/show_bug.cgi?id=121019

Reviewed by Andreas Kling.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::cloneChildNodes): Updated to use . instead of ->.
* editing/DeleteButton.cpp:
(WebCore::DeleteButton::defaultEventHandler): Ditto.

* editing/DeleteButtonController.cpp:
(WebCore::DeleteButtonController::DeleteButtonController): Updated to take a Frame&
instead of a Frame*.
(WebCore::DeleteButtonController::respondToChangedSelection): Ditto.
(WebCore::DeleteButtonController::createDeletionUI): Ditto.
(WebCore::DeleteButtonController::show): Ditto.
(WebCore::DeleteButtonController::enable): Ditto.
(WebCore::DeleteButtonController::deleteTarget): Ditto.
* editing/DeleteButtonController.h: Ditto.

* editing/Editor.cpp:
(WebCore::Editor::avoidIntersectionWithDeleteButtonController): Removed bogus
null check from both versions of this function.
(WebCore::Editor::Editor): Use construction rather than assignment and pass
a reference instead of a pointer to make m_deleteButtonController.
(WebCore::Editor::clear): Ditto.

* editing/Editor.h: Made deleteButtonController return a reference.
Also reorganized the header to put all the conditional functions together,
and not mixed in with non-conditional ones.

* editing/markup.cpp:
(WebCore::createMarkup): Updated to use . instead of -> and also to use
emptyString() instead of constructing a new empty string.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155320 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wk2] REGRESSION (r154673): PDF scrolling moves very slowly
https://bugs.webkit.org/show_bug.cgi?id=120542

Reviewed by Tim Horton.

Source/WebCore:

Handle 'wheel' events in addition to 'mousewheel'.

* html/shadow/MediaControlsApple.cpp:
Listen for the standard 'wheel' event instead of the legacy 'mousewheel' one.
While not strictly needed, we should use the legacy events as little as
possible.
* plugins/PluginView.cpp:
Handle 'wheel' events in addition to 'mousewheel'.

Source/WebKit2:

Handle 'wheel' events in addition to 'mousewheel'. This fixes
PDF scrolling.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::handleEvent):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
GStreamer 0.10 build fix after r155251.

Patch by Tamas Czene <tczene@inf.u-szeged.hu> on 2013-09-08
Reviewed by Csaba Osztrogonác.

* platform/graphics/gstreamer/GStreamerVersioning.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155322 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Scrollbar width is not applied when element hidden
https://bugs.webkit.org/show_bug.cgi?id=90546

Patch by Gurpreet Kaur <k.gurpreet@samsung.com> on 2013-09-08
Reviewed by Simon Fraser.

Source/WebCore:

Webkit has css properties through which custom scroll
bars can be added. Incase the element's visible property
is hidden and custom scrollbar properties are applied
the scrollbar width is not considered when quering the
element.clientWidth. Incase of non-custom scrollbars
whether the element's visible property is hidden or not
correct scrollbar width is considered.

Tests: fast/dom/Element/scroll-width-hidden.html
       fast/dom/Element/scroll-width-visible.html

* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::updateScrollbarPart):
Incase custom scrollbar is created there is a check whether
the renderer to which scrollbar is added is visible or not.
This check is not required since for non-custom scrollbars same
check is not present. Also whether element's visible property is
hidden or not a placeholder is set for the element. Both behavoiur
i.e custom and non-custom scrollbars should be same.

LayoutTests:

* fast/dom/Element/scroll-width-hidden-expected.txt: Added.
* fast/dom/Element/scroll-width-hidden.html: Added.
* fast/dom/Element/scroll-width-visible-expected.txt: Added.
* fast/dom/Element/scroll-width-visible.html: Added.

Added new test for verifying that scroll width returns proper
values for element which is visible and hidden.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155323 268f45cc-cd09-0410-ab3c-d52691b4dbfc
defining line height affects height of text box
https://bugs.webkit.org/show_bug.cgi?id=17619

Patch by Gurpreet Kaur <k.gurpreet@samsung.com> on 2013-09-08
Reviewed by Darin Adler.

Source/WebCore:

Giving line height to input elements increase the height
of the element. To make it work similiar as Mozilla and IE
line-height :normal should be applied for input elements.

Test: fast/dom/HTMLInputElement/input-line-height.html

* css/html.css:
(input):
Made the line-height: normal as !important so that it does not
consider any other line-height specified through internal or
external styles.

LayoutTests:

* fast/dom/HTMLInputElement/input-line-height-expected.txt: Added.
* fast/dom/HTMLInputElement/input-line-height.html: Added.

Added new test for verifying that giving line-height to input element
has no affect on its height.

* fast/forms/placeholder-position-expected.txt:
* platform/mac/fast/forms/placeholder-position-expected.png:

Rebaselining existing tests as per the new behavior. The position
of input elements have been modified since line-height is not being
considered.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155324 268f45cc-cd09-0410-ab3c-d52691b4dbfc
HTMLDocument.h : Removing unnecessary forward declaration.
https://bugs.webkit.org/show_bug.cgi?id=121002

Patch by Santosh Mahto <santosh.ma@samsung.com> on 2013-09-08
Reviewed by Darin Adler.

Just code cleanup.
Removed the two forward declaration in HTMLDocument.h file.

* html/HTMLDocument.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK]  ghost cursor when mouse hovers over an image file in a tab
https://bugs.webkit.org/show_bug.cgi?id=120675

Reviewed by Carlos Garcia Campos.

No new tests, covered by existing.

* platform/gtk/CursorGtk.cpp:
(WebCore::createNamedCursor): Use new gdk_cursor_new_from_surface()
when compiling against GTK+ 3.9.12 or newer.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155329 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[AX][ATK] AccessibilityObject representing ProgressBar element should be ATK_VALUE type
https://bugs.webkit.org/show_bug.cgi?id=121023

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-09-09
Reviewed by Mario Sanchez Prada.

Source/WebCore:

Test: accessibility/progressbar.html

ProgressBar element should support ATK_VALUE interface.

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(getInterfaceMaskFromObject):

Tools:

Added mappings to ATK's ProgressBar element.

* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(roleToString):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::roleToString):

LayoutTests:

Sharing progressbar.html specific mac test with efl and gtk.

* accessibility/progressbar-expected.txt: Renamed from LayoutTests/platform/mac/accessibility/progressbar-expected.txt.
* accessibility/progressbar.html: Renamed from LayoutTests/platform/mac/accessibility/progressbar.html.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Remove FastAllocBase.h from WTF.pro.
https://bugs.webkit.org/show_bug.cgi?id=121024

Patch by Julien Brianceau <jbriance@cisco.com> on 2013-09-09
Reviewed by Jocelyn Turcotte.

* WTF.pro: Remove FastAllocBase.h as this file disappeared in r155251.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[DOM4] Have ProcessingInstruction inherit CharacterData
https://bugs.webkit.org/show_bug.cgi?id=120691

Reviewed by Darin Adler.

Source/WebCore:

Have ProcessingInstruction inherit CharacterData as per the latest DOM4
specification:
http://dom.spec.whatwg.org/#processinginstruction

Previously, ProcessingInstruction was inheriting from Node as per DOM
Level 3.

Firefox and Blink already follow DOM4 here but not IE10.
This change leads to less code duplication.

Test: fast/dom/processing-instruction-inherit-characterdata.xhtml

* bindings/objc/PublicDOMInterfaces.h:
* dom/CharacterData.cpp:
(WebCore::CharacterData::setDataAndUpdate):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::ProcessingInstruction):
(WebCore::ProcessingInstruction::cloneNode):
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::insertedInto):
(WebCore::ProcessingInstruction::removedFrom):
(WebCore::ProcessingInstruction::finishParsingChildren):
* dom/ProcessingInstruction.h:
(WebCore::toProcessingInstruction):
* dom/ProcessingInstruction.idl:

LayoutTests:

Add layout test to validate that ProcessingInstruction inherits from
CharacterData.

* fast/dom/coreDOM-element-attribute-js-null-expected.txt:
* fast/dom/coreDOM-element-attribute-js-null.xhtml:
* fast/dom/processing-instruction-inherit-characterdata-expected.txt: Added.
* fast/dom/processing-instruction-inherit-characterdata.xhtml: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Added new expected results after r153435
https://bugs.webkit.org/show_bug.cgi?id=121025

Unreviewed EFL gardening.

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-09-09

* platform/efl-wk1/TestExpectations:
* platform/efl-wk1/accessibility/lists-expected.txt: Added.
* platform/efl-wk1/accessibility/plugin-expected.txt: Added.
* platform/efl-wk1/accessibility/table-with-aria-role-expected.txt: Added.
* platform/efl-wk1/accessibility/transformed-element-expected.txt: Added.
* platform/efl-wk2/TestExpectations:
* platform/efl-wk2/accessibility/lists-expected.txt: Added.
* platform/efl-wk2/accessibility/plugin-expected.txt: Added.
* platform/efl-wk2/accessibility/table-with-aria-role-expected.txt: Added.
* platform/efl-wk2/accessibility/transformed-element-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155343 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Hide Document::renderer()
https://bugs.webkit.org/show_bug.cgi?id=121028

Reviewed by Andreas Kling.

Use less generic Document::renderView() instead.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::postNotification):
* accessibility/AccessibilityObject.cpp:
(WebCore::appendAccessibilityObject):
* accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::webAreaObject):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::dispatchInvalidationCallbacks):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::appendAuthorStyleSheets):
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::webkitGetNamedFlows):
(WebCore::Document::setVisualUpdatesAllowed):
(WebCore::Document::elementFromPoint):
(WebCore::Document::caretRangeFromPoint):
(WebCore::Document::updateLayout):
(WebCore::Document::existingAXObjectCache):
(WebCore::Document::axObjectCache):
(WebCore::Document::setVisuallyOrdered):
(WebCore::Document::implicitClose):
(WebCore::Document::prepareMouseEvent):
(WebCore::Document::styleResolverChanged):
(WebCore::Document::documentWillBecomeInactive):
(WebCore::Document::documentDidResumeFromPageCache):
* dom/Document.h:
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
* dom/Element.cpp:
(WebCore::Element::~Element):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::removedFromDocument):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::removedFrom):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::contains):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::removedFrom):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
(WebCore::HTMLStyleElement::registerWithScopingNode):
(WebCore::HTMLStyleElement::unregisterWithScopingNode):
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::HTMLResourcePreloader::preload):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::handleGestureScrollBegin):
* page/Frame.cpp:
(WebCore::Frame::setPageAndTextZoomFactors):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::doLayoutWithFrameFlattening):
* page/Page.cpp:
(WebCore::Page::setPageScaleFactor):
* page/PrintContext.cpp:
(WebCore::PrintContext::spoolAllPagesWithBoundaries):
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::paint):
* style/StyleResolveTree.cpp:
(WebCore::Style::resolveTree):
* svg/SVGDocument.cpp:
(WebCore::SVGDocument::updatePan):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155344 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][WK2] Update ContextMenu Download API
https://bugs.webkit.org/show_bug.cgi?id=120763

Patch by Brian Holt <brian.holt@samsung.com> on 2013-09-09
Reviewed by Carlos Garcia Campos.

Mark the new Download items in the Context Menu with the Since
tag, and include a unit test for Context Menu audio.

* UIProcess/API/gtk/WebKitContextMenuActions.h:
* UIProcess/API/gtk/tests/TestContextMenu.cpp:
(testContextMenuDefaultMenu):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155345 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Adding username to RTCIceServer
https://bugs.webkit.org/show_bug.cgi?id=120861

Patch by Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> on 2013-09-09
Reviewed by Eric Carlson.

No new tests needed. Existing media stream tests already cover it

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::parseConfiguration):
* platform/mediastream/RTCConfiguration.h:
(WebCore::RTCIceServer::create):
(WebCore::RTCIceServer::username):
(WebCore::RTCIceServer::RTCIceServer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Cancel the current active WebKitAuthenticationRequest on load failed
https://bugs.webkit.org/show_bug.cgi?id=120350

Patch by Anton Obzhirov <a.obzhirov@samsung.com> on 2013-09-09
Reviewed by Carlos Garcia Campos.

The default dialog does not get closed and the authentication is not cancelled
if loading fails or is stopped on a page which requires HTTP authentication.

This patch cancels the authentication request on load failed
and adds new authentication cancelled signal in WebKitAuthenticationRequest
to allow the application handling of authentication UI.

* UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
(authenticationCancelled):
(webkitAuthenticationDialogInitialize):
(webkitAuthenticationDialogDispose):
(webkitAuthenticationDialogNew):
* UIProcess/API/gtk/WebKitAuthenticationDialog.h:
* UIProcess/API/gtk/WebKitAuthenticationRequest.cpp:
(webkit_authentication_request_class_init):
(webkit_authentication_request_cancel):
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewAuthenticate):
(webkitWebViewLoadFailed):
(webkitWebViewHandleAuthenticationChallenge):
(webkitWebViewCancelAuthenticationRequest):
* UIProcess/API/gtk/tests/TestWebKitWebView.cpp:
(testWebViewAuthenticationLoadCancelled):
(beforeAll):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155347 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MouseLeave not always emitted when cursor leaves subframe
https://bugs.webkit.org/show_bug.cgi?id=121026

Reviewed by Antonio Gomes.

Source/WebCore:

Forward the PlatformMouseEvent in the recursive calls so nested documents
also get a chance to emit mouseleave when the hover moves out.

Test: fast/events/mouseenterleave-on-subframe.html

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

LayoutTests:

Test or mouseenter/mouseleave events in an inner document. Note this test also
tests bug 120862, but the initial expectations assume that part to fail.

* fast/events/mouseenterleave-on-subframe-expected.html: Added.
* fast/events/mouseenterleave-on-subframe.html: Added.

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