[Qt] Move notification icon download out of WebCore
https://bugs.webkit.org/show_bug.cgi?id=80700

Reviewed by Jian Li.

Remove http/tests/notifications after the code the tests were testing has been removed.

* http/tests/notifications: Removed.
* http/tests/notifications/icon-does-not-exist-expected.txt: Removed.
* http/tests/notifications/icon-does-not-exist.html: Removed.
* http/tests/notifications/icon-exists-cancel-expected.txt: Removed.
* http/tests/notifications/icon-exists-cancel.html: Removed.
* http/tests/notifications/icon-exists-expected.txt: Removed.
* http/tests/notifications/icon-exists-show-alert-during-load-expected.txt: Removed.
* http/tests/notifications/icon-exists-show-alert-during-load.html: Removed.
* http/tests/notifications/icon-exists.html: Removed.
* http/tests/notifications/icon-requires-auth-expected.txt: Removed.
* http/tests/notifications/icon-requires-auth.html: Removed.
* http/tests/notifications/resources: Removed.
* http/tests/notifications/resources/icon-exists.png: Removed.
* http/tests/notifications/resources/icon-requires-auth.php: Removed.
* platform/chromium/test_expectations.txt:
* platform/efl/Skipped:
* platform/gtk/test_expectations.txt:
* platform/mac/Skipped:
* platform/qt-5.0-wk2/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:
* platform/wincairo/Skipped:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed test expectations update.
https://bugs.webkit.org/show_bug.cgi?id=84813

Suppress test image mismatch due to r115123. Rebaseline is coming soon.

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115154 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Calendar Picker: Open a calendar picker by keyboard operation
https://bugs.webkit.org/show_bug.cgi?id=84680

Reviewed by Kentaro Hara.

Source/WebCore:

- Open a calendar picker by the down arrow key.
- Remove stepping down/up by keyboard and wheel operations.
  This behavior was for text fields with spin buttons. Because the date
type doesn't have spin buttons, we should remove this behavior.

No new tests for opening a calendar picker. This behavior is not
testable by DRT yet. For removal of stepping up/down,
fast/forms/date/date-stepup-stepdown-from-renderer.html is updated.

* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::handleKeydownEvent):
Check shouldHaveSpinButton() before spin button key operations.
(WebCore::BaseDateAndTimeInputType::handleWheelEvent):
Check shouldHaveSpinButton() before spin button wheel operations.
* html/BaseDateAndTimeInputType.h:
(BaseDateAndTimeInputType):
Make handleKeydownEvent() protected because a subclass overrides it.
* html/DateInputType.cpp:
(WebCore::DateInputType::handleKeydownEvent):
Open a calendar picker by the down arrow key.
* html/DateInputType.h:
(DateInputType): Add handleKeydownEvent() declaration.
* html/shadow/CalendarPickerElement.h:
(CalendarPickerElement): Make openPopup() public because DateInputType calls it.

LayoutTests:

* fast/forms/date/date-stepup-stepdown-from-renderer-expected.txt:
* fast/forms/date/date-stepup-stepdown-from-renderer.html:
Stepping up/down by kerboard was removed. Update the test to confirm it doesn't work.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
GC Activity Callback timer should be based on how much has been allocated since the last collection
https://bugs.webkit.org/show_bug.cgi?id=84763

Reviewed by Geoffrey Garen.

The desired behavior for the GC timer is to collect at some point in the future, 
regardless of how little we've allocated. A secondary goal, which is almost if not 
as important, is for the timer to collect sooner if there is the potential to 
collect a greater amount of memory. Conversely, as we allocate more memory we'd 
like to reduce the delay to the next collection. If we're allocating quickly enough, 
the timer should be preempted in favor of a normal allocation-triggered collection. 
If allocation were to slow or stop, we'd like the timer to be able to opportunistically 
run a collection without us having to allocate to the hard limit set by the Heap.

This type of policy can be described in terms of the amount of CPU we are willing 
to dedicate to reclaim a single MB of memory. For example, we might be willing to 
dedicate 1% of our CPU to reclaim 1 MB. We base our CPU usage off of the length of 
the last collection, e.g. if our last collection took 1ms, we would want to wait about 
100ms before running another collection to reclaim 1 MB. These constants should be 
tune-able, e.g. 0.1% CPU = 1 MB vs. 1% CPU = 1 MB vs. 10% CPU = 1 MB.

* API/JSBase.cpp: Use the new reportAbandonedObjectGraph.
(JSGarbageCollect):
* API/JSContextRef.cpp: Ditto.
* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::reportAbandonedObjectGraph): Similar to reportExtraMemoryCost. Clients call
this function to notify the Heap that some unknown number of JSC objects might have just 
been abandoned and are now garbage. The Heap might schedule a new collection timer based 
on this notification.
(JSC):
(JSC::Heap::collect): Renamed m_lastFullGCSize to the less confusing m_sizeAfterLastCollect.
* heap/Heap.h:
(Heap):
* heap/MarkedAllocator.h:
(JSC::MarkedAllocator::zapFreeList): Fixed a bug in zapFreeList that failed to nullify the 
current allocator's FreeList once zapping was complete.
* runtime/GCActivityCallback.cpp: Removed didAbandonObjectGraph because it was replaced by 
Heap::reportAbandonedObjectGraph.
(JSC):
* runtime/GCActivityCallback.h:
(JSC::GCActivityCallback::willCollect):
(DefaultGCActivityCallback):
* runtime/GCActivityCallbackCF.cpp: Refactored the GC timer code so that we now schedule the 
timer based on how much we have allocated since the last collection up to a certain amount. 
We use the length of the previous GC to try to keep our total cost of opportunistic timer-triggered
collections around 1% of the CPU per MB of garbage we expect to reclaim up to a maximum of 5 MB.
(DefaultGCActivityCallbackPlatformData):
(JSC):
(JSC::DefaultGCActivityCallback::~DefaultGCActivityCallback):
(JSC::DefaultGCActivityCallback::commonConstructor):
(JSC::scheduleTimer):
(JSC::cancelTimer):
(JSC::DefaultGCActivityCallback::didAllocate):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115156 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ASSERT failure in RenderLayer::computeRepaintRects
https://bugs.webkit.org/show_bug.cgi?id=84480

Patch by Yong Li <yoli@rim.com> on 2012-04-24
Reviewed by Simon Fraser.

Source/WebCore:

Update visibility status if necessary before updating
compositing state in RenderLayer::styleChanged().

No new tests because this is obviously right thing to do
and creating new test seems too much for this small change.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::styleChanged):

LayoutTests:

Add a layout test for it.

* compositing/visibility/compositing-and-visibility-turned-off-together-expected.txt: Added.
* compositing/visibility/compositing-and-visibility-turned-off-together.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115157 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unused undefined() method from ScriptValue
https://bugs.webkit.org/show_bug.cgi?id=84751

Reviewed by Kentaro Hara.

* bindings/js/ScriptValue.h:
(ScriptValue):
* bindings/v8/ScriptValue.h:
(ScriptValue):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ScrollingCoordinator::setScrollParameters should take a single struct
https://bugs.webkit.org/show_bug.cgi?id=84816

Reviewed by Andreas Kling.

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::ScrollingCoordinator::setScrollParameters):
* page/scrolling/ScrollingCoordinator.h:
(ScrollingCoordinator):
(ScrollParameters):
* page/scrolling/ScrollingCoordinatorNone.cpp:
(WebCore::ScrollingCoordinator::setScrollParameters):
* page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
(WebCore::ScrollingCoordinator::setScrollParameters):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115159 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement createTBody for table element.
https://bugs.webkit.org/show_bug.cgi?id=84465

Reviewed by Ojan Vafai.

Source/WebCore:

Implement createTBody of table element to allow creating tbodies from JS.
It's following the specification http://dev.w3.org/html5/spec/the-table-element.html#dom-table-createtbody.

Tests: fast/table/table-create-tbody-existing-tbody.html
       fast/table/table-create-tbody-multiple-tbody.html
       fast/table/table-create-tbody.html

* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::createTBody):
(WebCore):
* html/HTMLTableElement.h:
(HTMLTableElement):
* html/HTMLTableElement.idl:

LayoutTests:

Add test to cover the new createTBody method.

* fast/table/table-create-tbody-existing-tbody-expected.txt: Added.
* fast/table/table-create-tbody-existing-tbody.html: Added.
* fast/table/table-create-tbody-expected.txt: Added.
* fast/table/table-create-tbody-multiple-tbody-expected.txt: Added.
* fast/table/table-create-tbody-multiple-tbody.html: Added.
* fast/table/table-create-tbody.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unbounded draws should use clip to limit their damage to opaque tracking
https://bugs.webkit.org/show_bug.cgi?id=84494

Reviewed by Adrienne Walker.

Source/WebCore:

Unit test: PlatformContextSkiaTest.UnboundedDrawsAreClipped

* platform/graphics/skia/OpaqueRegionSkia.cpp:
(WebCore::OpaqueRegionSkia::didDrawRect):
(WebCore::OpaqueRegionSkia::didDrawPath):
(WebCore::OpaqueRegionSkia::didDrawPoints):
(WebCore::OpaqueRegionSkia::didDrawBounded):
(WebCore::OpaqueRegionSkia::didDrawUnbounded):
* platform/graphics/skia/OpaqueRegionSkia.h:
(OpaqueRegionSkia):

Source/WebKit/chromium:

* tests/PlatformContextSkiaTest.cpp:
(WebCore::TEST):
(WebCore):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Don't call calculateRenderPasses in CCLayerTreeHostImpl::scrollBegin()
https://bugs.webkit.org/show_bug.cgi?id=84807

Reviewed by James Robinson.

Instead of calculate render passes and quads and tracking damage,
simply calculate the updated render layer list, which is what is
needed for scrolling.  This prevents a willDraw/didDraw mismatch on
layers.

* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::calculateRenderSurfaceLayerList):
(WebCore):
(WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
(WebCore::CCLayerTreeHostImpl::ensureMostRecentRenderSurfaceLayerList):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(CCLayerTreeHostImpl):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115162 268f45cc-cd09-0410-ab3c-d52691b4dbfc
overflow: hidden on the main frame is broken with threaded scrolling
https://bugs.webkit.org/show_bug.cgi?id=84819
<rdar://problem/10920677>

Reviewed by Darin Adler.

Pass along the horizontal and vertical scrollbar modes to the scrolling tree and use it
to determine if wheel events should be handled or not. This matches what we do for non-threaded scrolling.

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::ScrollingCoordinator::setScrollParameters):
* page/scrolling/ScrollingCoordinator.h:
(ScrollParameters):
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::ScrollingTreeNode):
(WebCore::ScrollingTreeNode::update):
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::canHaveScrollbars):
(ScrollingTreeNode):
* page/scrolling/ScrollingTreeState.cpp:
(WebCore::ScrollingTreeState::ScrollingTreeState):
(WebCore::ScrollingTreeState::setHorizontalScrollbarMode):
(WebCore):
(WebCore::ScrollingTreeState::setVerticalScrollbarMode):
* page/scrolling/ScrollingTreeState.h:
(WebCore::ScrollingTreeState::horizontalScrollbarMode):
(ScrollingTreeState):
(WebCore::ScrollingTreeState::verticalScrollbarMode):
* page/scrolling/mac/ScrollingTreeNodeMac.mm:
(WebCore::ScrollingTreeNodeMac::handleWheelEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115163 268f45cc-cd09-0410-ab3c-d52691b4dbfc
getMatchedCSSRules() should return null when the second argument is an unrecognized pseudo-element name
https://bugs.webkit.org/show_bug.cgi?id=83298

Patch by Kulanthaivel Palanichamy <kulanthaivel@codeaurora.org> on 2012-04-24
Reviewed by Ojan Vafai.

Source/WebCore:

I couldn't find any specification or any meaningful discussion on this API, but I
assume that it shouldn't be any different from window.getComputedStyle()
as far as the parameters are concerned.

Test: fast/dom/Window/getMatchedCSSRules-with-invalid-pseudo-elements.html

* page/DOMWindow.cpp:
(WebCore::DOMWindow::getMatchedCSSRules):
* page/DOMWindow.idl:

LayoutTests:

* fast/dom/Window/getMatchedCSSRules-with-invalid-pseudo-elements-expected.txt: Added.
* fast/dom/Window/getMatchedCSSRules-with-invalid-pseudo-elements.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a logging channel and some ouput for compositing
https://bugs.webkit.org/show_bug.cgi?id=84817

Reviewed by Darin Adler.

Add a logging channel called "Compositing".

Output useful information to this channel, including
a line for each composited layer, its composited bounds,
the reason it was composited, the backing store megapixels,
and a count of total composited layers and total backing
store megapixels.

* platform/Logging.cpp:
(WebCore):
(WebCore::getChannelFromName):
* platform/Logging.h:
(WebCore):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::backingStoreArea):
* platform/graphics/GraphicsLayer.h:
(GraphicsLayer):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::backingStoreArea):
(WebCore):
* platform/graphics/ca/GraphicsLayerCA.h:
(GraphicsLayerCA):
* platform/mac/LoggingMac.mm:
(WebCore::initializeLoggingChannelsIfNecessary):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::nameForLayer):
(WebCore::RenderLayerBacking::backingStoreArea):
(WebCore):
* rendering/RenderLayerBacking.h:
(RenderLayerBacking):
* rendering/RenderLayerCompositor.cpp:
(WebCore):
(WebCore::compositingLogEnabled):
(WebCore::RenderLayerCompositor::RenderLayerCompositor):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::logCompositingInfo):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
(WebCore::RenderLayerCompositor::reasonForCompositing):
* rendering/RenderLayerCompositor.h:
(RenderLayerCompositor):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
New Notification constructor do not take into account security origin permissions
https://bugs.webkit.org/show_bug.cgi?id=84825
<rdar://problem/11315405>

Reviewed by Darin Adler.

Tests requires support for notifications on Mac (see 79492).

When the task timer fires, we should check to see that the notification has permission
to show. If not, we fire the onError event.

* notifications/Notification.cpp:
(WebCore::Notification::Notification): Since the timer may show, or call the onerror event,
we rename it from m_showTaskTimer. to m_taskTimer.
(WebCore::Notification::dispatchErrorEvent): The default constructor of ErrorEvent doesn't
create the proper event object. Create it using Event::create().
(WebCore::Notification::taskTimerFired): Check to see that we have permission first.
* notifications/Notification.h:
(Notification):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115166 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-24  Yury Semikhatsky  <yurys@chromium.org>

        Unreviewed. Revert part of the change r115063 which commented out
        real worker creation. It was commited by mistake.

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


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, GTK svg rebaseline after r115085.

* platform/gtk/svg/W3C-SVG-1.1/struct-symbol-01-b-expected.txt:
* platform/gtk/svg/carto.net/button-expected.txt:
* platform/gtk/svg/carto.net/colourpicker-expected.txt:
* platform/gtk/svg/carto.net/slider-expected.txt:
* platform/gtk/svg/carto.net/window-expected.txt:
* platform/gtk/svg/custom/embedding-external-svgs-expected.txt:
* platform/gtk/svg/custom/relative-sized-shadow-tree-content-with-symbol-expected.txt:
* platform/gtk/svg/custom/relative-sized-use-on-symbol-expected.txt:
* platform/gtk/svg/custom/use-clipped-hit-expected.txt:
* platform/gtk/svg/custom/use-modify-target-symbol-expected.txt:
* platform/gtk/svg/custom/use-on-disallowed-foreign-object-5-expected.txt:
* platform/gtk/svg/custom/use-on-g-containing-symbol-expected.txt:
* platform/gtk/svg/custom/use-on-symbol-expected.txt:
* platform/gtk/svg/custom/use-recalcStyle-crash-expected.txt:
* platform/gtk/svg/custom/use-referencing-nonexisting-symbol-expected.txt:
* platform/gtk/svg/custom/use-setAttribute-crash-expected.txt:
* platform/gtk/svg/custom/use-symbol-overflow-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Skip inspector/profiler/heap-snapshot-comparison-dom-groups-change.html
on Win and Win Cairo in addition to Mac and Qt(JSC doesn't support heap profiling and
the test doesn't make sense there).

* platform/win/Skipped:
* platform/wincairo/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115169 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed morning gardening after r115085.

* platform/qt/Skipped: Unskip a non-existing test.
* platform/qt/svg/custom/embedding-external-svgs-expected.txt:
* platform/qt/svg/custom/relative-sized-use-on-symbol-expected.txt:
* platform/qt/svg/custom/relative-sized-use-without-attributes-on-symbol-expected.txt:
* platform/qt/svg/custom/use-clipped-hit-expected.txt:
* platform/qt/svg/custom/use-modify-target-symbol-expected.txt:
* platform/qt/svg/custom/use-on-disallowed-foreign-object-5-expected.txt:
* platform/qt/svg/custom/use-setAttribute-crash-expected.txt:
* platform/qt/svg/custom/use-symbol-overflow-expected.txt:
* platform/wk2/Skipped: Unskip a non-existing test.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115170 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed morning gardening after r115091.

* platform/qt/tables/mozilla_expected_failures/collapsing_borders/bug41262-5-expected.png:
* platform/qt/tables/mozilla_expected_failures/collapsing_borders/bug41262-5-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115171 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: Web Inspector: Incorrect highlight position of inspected element in a scrolled page
https://bugs.webkit.org/show_bug.cgi?id=84755

Reviewed by Pavel Feldman.

Test: inspector/elements/highlight-node-scroll.html

* inspector/DOMNodeHighlighter.cpp: Ensures the highlight position is in page coordinates.

LayoutTests: Web Inspector: REGRESSION: Incorrect highlight position of inspected element in scrolled page
https://bugs.webkit.org/show_bug.cgi?id=84755

Reviewed by Pavel Feldman.

* http/tests/inspector/elements-test.js: Extracted common function dumpInspectorHighlightRects() into here with a small bug fixed (x and y inversed).
* inspector/elements/highlight-node-scaled-expected.txt: Corrected the wrong inversed x and y.
* inspector/elements/highlight-node-scaled.html: Extracted out dumpInspectorHighlightRects().
* inspector/elements/highlight-node-scroll-expected.txt: Added. Expectation of the new test case.
* inspector/elements/highlight-node-scroll.html: Added. The new test case.
* inspector/elements/highlight-node.html: Extracted out dumpInspectorHighlightRects(). Expectation not changed because the x and y happened to be the same in the original expectation.
* inspector/elements/highlight-svg-root.html: Ditto.


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