[GTK] Allow sharing the WebCore include list with the Chromium build
https://bugs.webkit.org/show_bug.cgi?id=110241

Patch by Martin Robinson <mrobinson@igalia.com> on 2013-03-01
Reviewed by Dirk Pranke.

* WebCore.gyp/WebCoreGTK.gyp: Added. A skeleton gyp file for WebCoreGTK+.
* WebCore.gypi: Added shared include directories.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144502 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed AppleWin build fix.

* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144503 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: Upstream iOS Accessibility layout tests
https://bugs.webkit.org/show_bug.cgi?id=111187

Reviewed by David Kilzer.

Upstream the latest iOS Accessibility layout tests.

* platform/iphone-simulator: Added.
* platform/iphone-simulator/accessibility: Added.
* platform/iphone-simulator/accessibility/accessibility-aria-table-children-expected.txt: Added.
* platform/iphone-simulator/accessibility/accessibility-aria-table-children.html: Added.
* platform/iphone-simulator/accessibility/accessibility-crash-in-axcontainer-expected.txt: Added.
* platform/iphone-simulator/accessibility/accessibility-crash-in-axcontainer.html: Added.
* platform/iphone-simulator/accessibility/accessibility-hint-expected.txt: Added.
* platform/iphone-simulator/accessibility/accessibility-hint.html: Added.
* platform/iphone-simulator/accessibility/aria-pressed-state-expected.txt: Added.
* platform/iphone-simulator/accessibility/aria-pressed-state.html: Added.
* platform/iphone-simulator/accessibility/centerpoint-expected.txt: Added.
* platform/iphone-simulator/accessibility/centerpoint.html: Added.
* platform/iphone-simulator/accessibility/dom-focus-fires-on-correct-element-expected.txt: Added.
* platform/iphone-simulator/accessibility/dom-focus-fires-on-correct-element.html: Added.
* platform/iphone-simulator/accessibility/focus-change-notifications-expected.txt: Added.
* platform/iphone-simulator/accessibility/focus-change-notifications.html: Added.
* platform/iphone-simulator/accessibility/header-elements-expected.txt: Added.
* platform/iphone-simulator/accessibility/header-elements.html: Added.
* platform/iphone-simulator/accessibility/identifier-expected.txt: Added.
* platform/iphone-simulator/accessibility/identifier.html: Added.
* platform/iphone-simulator/accessibility/internal-link-expected.txt: Added.
* platform/iphone-simulator/accessibility/internal-link.html: Added.
* platform/iphone-simulator/accessibility/link-with-images-text-expected.txt: Added.
* platform/iphone-simulator/accessibility/link-with-images-text.html: Added.
* platform/iphone-simulator/accessibility/link-with-only-image-expected.txt: Added.
* platform/iphone-simulator/accessibility/link-with-only-image.html: Added.
* platform/iphone-simulator/accessibility/math-expected.txt: Added.
* platform/iphone-simulator/accessibility/math.html: Added.
* platform/iphone-simulator/accessibility/mixed-checkboxes-expected.txt: Added.
* platform/iphone-simulator/accessibility/mixed-checkboxes.html: Added.
* platform/iphone-simulator/accessibility/no-child-link-header-expected.txt: Added.
* platform/iphone-simulator/accessibility/no-child-link-header.html: Added.
* platform/iphone-simulator/accessibility/non-contiguous-link-expected.txt: Added.
* platform/iphone-simulator/accessibility/non-contiguous-link.html: Added.
* platform/iphone-simulator/accessibility/password-value-expected.txt: Added.
* platform/iphone-simulator/accessibility/password-value.html: Added.
* platform/iphone-simulator/accessibility/placeholder-value-expected.txt: Added.
* platform/iphone-simulator/accessibility/placeholder-value.html: Added.
* platform/iphone-simulator/accessibility/popup-button-value-label-expected.txt: Added.
* platform/iphone-simulator/accessibility/popup-button-value-label.html: Added.
* platform/iphone-simulator/accessibility/radio-button-expected.txt: Added.
* platform/iphone-simulator/accessibility/radio-button.html: Added.
* platform/iphone-simulator/accessibility/secure-text-field-expected.txt: Added.
* platform/iphone-simulator/accessibility/secure-text-field.html: Added.
* platform/iphone-simulator/accessibility/selected-buttons-expected.txt: Added.
* platform/iphone-simulator/accessibility/selected-buttons.html: Added.
* platform/iphone-simulator/accessibility/selected-text-expected.txt: Added.
* platform/iphone-simulator/accessibility/selected-text.html: Added.
* platform/iphone-simulator/accessibility/tab-role-expected.txt: Added.
* platform/iphone-simulator/accessibility/tab-role.html: Added.
* platform/iphone-simulator/accessibility/table-cell-for-row-col-expected.txt: Added.
* platform/iphone-simulator/accessibility/table-cell-for-row-col.html: Added.
* platform/iphone-simulator/accessibility/table-cell-ranges-expected.txt: Added.
* platform/iphone-simulator/accessibility/table-cell-ranges.html: Added.
* platform/iphone-simulator/accessibility/tables-lists-expected.txt: Added.
* platform/iphone-simulator/accessibility/tables-lists.html: Added.
* platform/iphone-simulator/accessibility/text-line-no-ignored-elements-expected.txt: Added.
* platform/iphone-simulator/accessibility/text-line-no-ignored-elements.html: Added.
* platform/iphone-simulator/accessibility/text-marker-list-item-expected.txt: Added.
* platform/iphone-simulator/accessibility/text-marker-list-item.html: Added.
* platform/iphone-simulator/accessibility/text-marker-validation-expected.txt: Added.
* platform/iphone-simulator/accessibility/text-marker-validation.html: Added.
* platform/iphone-simulator/accessibility/text-role-expected.txt: Added.
* platform/iphone-simulator/accessibility/text-role.html: Added.
* platform/iphone-simulator/accessibility/textfield-in-axvalue-expected.txt: Added.
* platform/iphone-simulator/accessibility/textfield-in-axvalue.html: Added.
* platform/iphone-simulator/accessibility/url-test-expected.txt: Added.
* platform/iphone-simulator/accessibility/url-test.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Expose more of the configuration step to the gyp build
https://bugs.webkit.org/show_bug.cgi?id=111213

Patch by Martin Robinson <mrobinson@igalia.com> on 2013-03-01
Reviewed by Dirk Pranke.

Expose more of the configuration phase to the gyp build, including WebKit features
and binary paths.

* gyp/Configuration.gypi.in: Add templatized gyp variables for the new configuration bits.
* gyp/autogen.sh: Properly link up the WebKit features script. So we can access it
relatively as if we were at the top-level of the source directory.
* gyp/configure.ac: Export the WebKit features.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144506 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r125809): CFStrings created via StringImpl::createCFString()  might reference freed memory when Objective-C garbage collection is enabled
https://bugs.webkit.org/show_bug.cgi?id=111219

Reviewed by Benjamin Poulain.

StringImpl::createCFString() uses CFStringCreateWithBytesNoCopy() in
order to create CFString without making an unnecessary copy. In order
to ensure that the the StringImpl's backing buffer isn't deallocated
while the CFString is still alive, we use a custom CFAllocator to
ref/deref the StringImpl at the appropriate times.

However, custom allocators aren't supported when Objective-C garbage
collection is enabled, so in this case we use the default CF allocator.
Since we can't guarantee the lifetime of the StringImpl in this case,
we should just fall back to copying the string, as we did prior to r125809.

* platform/text/cf/StringImplCF.cpp:
(garbageCollectionEnabled): Moved the check for whether garbage
collection is enabled from StringWrapperCFAllocator::create() to here.
(WTF::StringWrapperCFAllocator::create): Call garbageCollectionEnabled().
(WTF::StringImpl::createCFString): If garbage collection is enabled,
call the variants of CFStringCreate that copy the string.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144507 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support padding, margin and border for internal UA cue styling
https://bugs.webkit.org/show_bug.cgi?id=110703

Reviewed by Eric Carlson.

Source/WebCore:

For some particular user agent styling this allows the possibility
of making the window around the cue text bigger to match some user
styles (see CaptionUserPreferencesMac::captionsStyleSheetOverride).

These properties *cannot* be set through by using the ::cue
pseudo-element and, as specified, are used only internally.

Note: This patch is identical to the previously commited one,
as it was rolled back without related tests failing.

Test: media/track/track-cue-rendering-with-padding.html

* css/mediaControls.css:
(video::-webkit-media-text-track-display): Set the CSS box model
to include in the specified width or height the values of
padding / margin / border by using -webkit-box-sizing and avoid
overflow over 100% width because of having these properties set.
* rendering/RenderTextTrackCue.cpp:
(WebCore::RenderTextTrackCue::isOutside): To not interfere with
the regular WebVTT positioning algorithm, the check is done for
the absolute content box.
(WebCore::RenderTextTrackCue::repositionCueSnapToLinesSet): Added
an extra adjustment step to accomodate vertical padding (and not
overflow the cue container)

LayoutTests:

* media/track/track-cue-rendering-with-padding-expected.txt: Added.
* media/track/track-cue-rendering-with-padding.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144508 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Mark more flaky tests related to scrollbar ordering
https://bugs.webkit.org/show_bug.cgi?id=111199

Unreviewed gardening.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't use legacy test names when returning results from PerfTest.run
https://bugs.webkit.org/show_bug.cgi?id=111148

Reviewed by Dirk Pranke.

* Scripts/webkitpy/performance_tests/perftest.py:
(PerfTestMetric.name): Renamed from metric.
(PerfTest.test_name_without_file_extension): Extracted from legacy_chromium_bot_compatible_test_name.
(PerfTest.run): Use metric name instead of the legacy name to store iteration values.
(ChromiumStylePerfTest.parse_and_log_output): Use the metric name to store results as done in PerfTest.run.

* Scripts/webkitpy/performance_tests/perftest_unittest.py:
(TestPerfTestMetric.test_init_set_time_metric):
(TestPerfTestMetric.legacy_chromium_bot_compatible_test_name): Removed. The integration tests test this.
(TestReplayPerfTest.test_run_with_driver_accumulates_results):
(TestReplayPerfTest.test_run_with_driver_accumulates_memory_results):

* Scripts/webkitpy/performance_tests/perftestsrunner.py:
(PerfTestsRunner.__init__):
(PerfTestsRunner._generate_results_dict): Updated to iterate over (test, metrics) pair. Use view_source_url
to obtain the trac URL instead of hard coding it.
(PerfTestsRunner._run_tests_set):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144510 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Mark some software compositing tests as failing before landing anti-aliasing changes
https://bugs.webkit.org/show_bug.cgi?id=111224

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144512 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening of AppleWin port.

* platform/win/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144513 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening of AppleWin port.

* platform/win/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Upstream smart selection
https://bugs.webkit.org/show_bug.cgi?id=111226

Patch by Iris Wu <shuwu@rim.com> on 2013-03-01
Reviewed by Rob Buis.

1.  Extend the touch hold text selection to next paragraph.
2.  Draw and expand overlay over text as touch hold selection expands.
    Select paragraph when it's entirely covered by overlay.
3.  Start scrolling at a constant rate when the end of
    next pargraph is not in the viewport.

Reviewed Internally By Genevieve Mak and Mike Fenton.
PR 217897 238485 258279 279042 299779

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPage::selectAtDocumentPoint):
(BlackBerry::WebKit::WebPage::expandSelection):
(WebKit):
(BlackBerry::WebKit::WebPage::setOverlayExpansionPixelHeight):
(BlackBerry::WebKit::WebPagePrivate::setOverlayExpansionPixelHeight):
(BlackBerry::WebKit::WebPage::setParagraphExpansionPixelScrollMargin):
* Api/WebPage.h:
* Api/WebPageClient.h:
* Api/WebPage_p.h:
(WebPagePrivate):
* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::SelectionHandler::cancelSelection):
(BlackBerry::WebKit::SelectionHandler::selectAtPoint):
(BlackBerry::WebKit::isInvalidLine):
(WebKit):
(BlackBerry::WebKit::isInvalidParagraph):
(BlackBerry::WebKit::SelectionHandler::selectNextParagraph):
(BlackBerry::WebKit::SelectionHandler::drawOverlay):
(BlackBerry::WebKit::SelectionHandler::findNextOverlayRegion):
(BlackBerry::WebKit::SelectionHandler::expandSelection):
(BlackBerry::WebKit::SelectionHandler::ensureSelectedTextVisible):
(BlackBerry::WebKit::SelectionHandler::setParagraphExpansionScrollMargin):
(BlackBerry::WebKit::SelectionHandler::expandSelectionToGranularity):
* WebKitSupport/SelectionHandler.h:
(SelectionHandler):
(BlackBerry::WebKit::SelectionHandler::setOverlayExpansionHeight):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening of AppleWin port.

* platform/win/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Avoid ScriptValue copies in IDBAny
https://bugs.webkit.org/show_bug.cgi?id=111002

Reviewed by Adam Barth.

This avoids some v8 handle thrashing in the long term,
and protects us against some crashes in the short term.

The crashes will be fixed in
https://bugs.webkit.org/show_bug.cgi?id=110206.

* Modules/indexeddb/IDBAny.cpp:
(WebCore::IDBAny::createNull):
(WebCore::IDBAny::createString):
(WebCore::IDBAny::IDBAny):
(WebCore::IDBAny::scriptValue):
* Modules/indexeddb/IDBAny.h:
(WebCore::IDBAny::create):
(IDBAny):
(WebCore::IDBAny::keyPath):
* bindings/v8/custom/V8IDBAnyCustom.cpp:
(WebCore::toV8):
(WebCore):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Revert r143827 to restore WebHelperPluginImpl's call to frameDetached()
https://bugs.webkit.org/show_bug.cgi?id=111232

Patch by David Dorwin <ddorwin@chromium.org> on 2013-03-01
Reviewed by Adam Barth.

This patch reverts r143827, which causes a crash in failure conditions:
http://crbug.com/178848

* src/WebHelperPluginImpl.cpp:
(WebKit::WebHelperPluginImpl::destoryPage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
EventHandler::handleGestureScrollUpdate() should invoke the user-generated scroll routines
so its behavior matches other user-initiated scrolls
https://bugs.webkit.org/show_bug.cgi?id=109769

Reviewed by James Robinson.

Source/WebCore:

To ensure that the scrolling behavior of GestureScrollUpdate events are consistent with
the scrolling behavior of mousewheel events, use the existing user-generated scroll logic
instead of calling into RenderLayer::scrollByRecursively(). This patch fixes the bug
reported in https://bugs.webkit.org/show_bug.cgi?id=109316, where the example page can
be scrolled using touch but cannot be scrolled using mousewheels.

Note that this patch does not use any of the mousewheel event-handling code.

Tests: fast/events/touch/gesture/touch-gesture-noscroll-body-propagated.html
       fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden.html
       fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden.html
       fast/events/touch/gesture/touch-gesture-noscroll-body.html

* page/EventHandler.cpp:
(WebCore::EventHandler::clear):
(WebCore::EventHandler::handleGestureEvent):
(WebCore::EventHandler::handleGestureScrollBegin):
(WebCore::EventHandler::handleGestureScrollUpdate):
(WebCore::EventHandler::sendScrollEventToView):
    By calling this function at the start of handleGestureScrollUpdate() in the case
    where |m_scrollGestureHandlingNode| is null, we ensure that the scroll updates
    can still scroll the page itself, if possible.
(WebCore):
(WebCore::EventHandler::clearGestureScrollNodes):
* page/EventHandler.h:
(EventHandler):
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::setHasPreciseScrollingDeltas):

Source/WebKit/chromium:

Clear the nodes corresponding to a fling scroll event when the event ends.

* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::updateAnimations):

LayoutTests:

Four new layout tests have been added and touch-gesture-scroll-page.html has been
modified to demonstrate that this patch fixes two existing bugs. See the inline
comments below for details.

Because I am now using the existing user-generated scroll logic, the delta for a single
GestureScrollUpdate event will not be propagated to the parent of the targeted node
unless the targeted node has no remaining scrollable area. So the changes to the
existing layout tests have been made to ensure that the targeted node has been fully
scrolled before subsequent GestureScrollUpdate events will scroll the parent(s) of
the targeted node.

I have also removed the function recordScroll() from the existing layout tests
because this function already exists in the included file resources/gesture-helpers.js.

* fast/events/touch/gesture/touch-gesture-noscroll-body-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-noscroll-body-propagated-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-noscroll-body-propagated.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
* fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
* fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
* fast/events/touch/gesture/touch-gesture-noscroll-body.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
* fast/events/touch/gesture/touch-gesture-scroll-div-not-propagated.html:
* fast/events/touch/gesture/touch-gesture-scroll-div-propagated.html:
* fast/events/touch/gesture/touch-gesture-scroll-div-twice-propagated.html:
* fast/events/touch/gesture/touch-gesture-scroll-iframe-not-propagated.html:
* fast/events/touch/gesture/touch-gesture-scroll-iframe-propagated.html:
* fast/events/touch/gesture/touch-gesture-scroll-page-not-propagated.html:
* fast/events/touch/gesture/touch-gesture-scroll-page-propagated.html:
* fast/events/touch/gesture/touch-gesture-scroll-page.html:
      I modified this layout test in order to add test coverage for another bug
      which is fixed by this patch: if the hit test performed on a GestureScrollBegin
      does not target a specific node, the subsequent GestureScrollUpdate events should
      still attempt to scroll the page itself. This is consistent with how mousewheel
      events behave.
* platform/chromium/fast/events/touch/gesture/touch-gesture-noscroll-body-expected.txt: Added.
* platform/chromium/fast/events/touch/gesture/touch-gesture-noscroll-body-propagated-expected.txt: Added.
* platform/chromium/fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden-expected.txt: Added.
* platform/chromium/fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden-expected.txt: Added.
      These four new layout tests verify that a non-scrollable body will not scroll,
      as reported in https://bugs.webkit.org/show_bug.cgi?id=109316.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144519 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[css exclusions] Move ExclusionShapeInsideInfo into RenderBlockRareData
https://bugs.webkit.org/show_bug.cgi?id=110995

Reviewed by Julien Chaffraix.

This patch moves ExclusionShapeInsideInfo into the RenderBlockRareData struct,
which enables us to move away from the global ExclusionShapeInsideInfo map.
Some additional refactoring was done to remove ExclusionShapeInsideInfo's
dependency on InlineIterator, which depended on RenderBlock. This work required
adding a new LineSegmentIterator struct.

Refactoring, no new tests.

* rendering/ExclusionShapeInsideInfo.cpp:
(WebCore):
(WebCore::LineSegmentRange::LineSegmentRange): Moving the InlineIterator
constructor to the .cpp file, as InlineIterator is now forward declared in
the .h file.
(WebCore::ExclusionShapeInsideInfo::isEnabledFor): Moving isEnabledFor to
the .cpp file, as RenderBlock is now forward declared in the .h file.
* rendering/ExclusionShapeInsideInfo.h:
(WebCore):
(LineSegmentIterator): A simple struct for containing segment positions for
layout.
(WebCore::LineSegmentIterator::LineSegmentIterator): Constructor.
(LineSegmentRange): Transitioning to store LineSegmentIterator.
(WebCore::LineSegmentRange::LineSegmentRange): Ditto.
(ExclusionShapeInsideInfo):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::willBeDestroyed): Destroying a block will now destroy
its ExclusionShapeInsideInfo, so there is no need to remove it from the map.
(WebCore):
(WebCore::RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange): Use
the RenderBlockRareData struct rather than the global map.
* rendering/RenderBlock.h:
(WebCore):
(WebCore::RenderBlock::ensureExclusionShapeInsideInfo): Ensure an info struct
is present if the shape-inside style is set.
(WebCore::RenderBlock::exclusionShapeInsideInfo): Look up the info struct for
the current block.
(WebCore::RenderBlock::setExclusionShapeInsideInfo): Update the info struct
for the current block.
(RenderBlockRareData): Add the ExclusionShapeInsideInfo member.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::constructBidiRunsForLine): Construct the appropriate offsets during
layout based on the stored LineSegmentIterators.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144520 268f45cc-cd09-0410-ab3c-d52691b4dbfc
BUILD FIX: testapi should link to Foundation, not CoreFoundation

* JavaScriptCore.xcodeproj/project.pbxproj: Change testapi to
link to Foundation.framework instead of CoreFoundation.framework
since it uses NS types.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't leak Documents when using MutationObserver from extensions
https://bugs.webkit.org/show_bug.cgi?id=111234

Patch by Elliott Sprehn <esprehn@gmail.com> on 2013-03-01
Reviewed by Adam Barth.

.:

* ManualTests/leak-observer-nonmain-world.html: Added.

Source/WebCore:

MutationObserverCallback holds a WorldContextHandle which secretly isn't
a handle to anything when it's for the main world. When it's for a non-main
world though, like those used in extensions, it becomes a strong reference
to the v8::Context which results in leaks by creating cycles:

MutationObserver -> Callback -> World -> Document -> Node -> MutationObserver.

Instead we should keep a RefPtr to a DOMWrapperWorld in the callback and then
get the v8::Context from that inside handleEvent.

Tests: ManualTests/leak-observer-nonmain-world.html

* bindings/v8/V8Binding.cpp:
(WebCore::toV8Context): Added overload that takes a DOMWrapperWorld.
* bindings/v8/V8Binding.h:
* bindings/v8/V8MutationCallback.cpp:
(WebCore::V8MutationCallback::V8MutationCallback):
(WebCore::V8MutationCallback::handleEvent):
* bindings/v8/V8MutationCallback.h:
(V8MutationCallback):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144522 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Rolled Chromium DEPS to r185662.  Requested by
"James Robinson" <jamesr@chromium.org> via sheriffbot.

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

* DEPS:

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