​https://bugs.webkit.org/show_bug.cgi?id=62164
Remove "multi-threaded" logic in V8 DOMData, DOMDataStore and friends
This functionality is untested and unused:
This is an old code from Lockers-based implementation of WebWorkers in
V8 bindings, to make sure that DOM objects are released on the right thread
even though GC could have happened on any thread. It is currently unused (since
current model is one worker per process) and is being removed because new implementation
of WebWorkers will be using V8 isolates.

This fixes a real bug, since WebMediaPlayerClientImpl::putCurrentFrame
deletes a VideoFrameChromium subclass type through this interface
class, causing ~VideoFrameChromiumImpl's destructor not to run.
(VideoFrameChroimumImpl happens to not have a destructor or any
non-POD member variables, so it's more a latent bug.)

(WebKit::PDFViewController::findString):
Return kWKMoreThanMaximumMatchCount when appropriate, a la FindController::countStringMatches().
Also, skip counting all the matches if maxMatchCount is 0, to avoid (perhaps slowly) computing a
number that would be ignored.

This is _not_ to fix a real bug, just to make clang's
-Wdelete-non-virtual-dtor happy. As discussed at​http://codereview.chromium.org/7094005/, we prefer making leaf class
destructors virtual over making the leaf classes final.

This is _not_ to fix a real bug, just to make clang's
-Wdelete-non-virtual-dtor happy. As discussed at​http://codereview.chromium.org/7094005/, we prefer making leaf class
destructors virtual over making the leaf classes final.

When an inline element has a right border/margin/padding and it has more than one descendant with no siblings,
the width of the right border/margin/padding should be included in line breaking calculation only once,
and not for each descendant.

Use SOCK_STREAM instead of SOCK_DGRAM sockets. Rework the message
receiver code to support stream sockets, since it requires to
handle message boundaries. The same code works for DGRAM sockets,
so this change shouldn't break other ports using DGRAM.

rendering/svg/SVGTextRunRenderingContext.cpp:
(WebCore::SVGTextRunWalker::walk): bail early when from and to
is outside the text run boundary. this hit easily after adding
the assert when from = to = end and read in run.data(from).

We're unskipping acid2.html event though it's just a landing
page for the acid2 test. Some elements of the test are loaded by
the landing page so it is testing something, but acid2-pixel covers the same
ground.

shouldFallBack() tells the DOM if it should attempt to render
the next nested <object> if its parent fails to load.

This fix is only required for the fast/css version of the ACID2
test, which loads a non-existent ​file:// url. The HTTP version of the
test already passes because the loader will render fallback content
on a failed HTTP load without delegating the decision to the client
( see MainResourceLoader::continueAfterContentPolicy).

Some ports also check for WebKitErrorPluginWillHandleLoad when deciding
what to return. This error isn't currently set by Qt so we don't check
it. (Other ports set it when the erring document is a MediaDocument, maybe
we should do that too at some point).

Add additional ChromeClient functions to indicate the beginning and end of
the various ScrollAnimator animations. Change existing notification that a
rubber-band has completed for the main frame to be triggered for all frames.

Stub out new ChromeClient functions regarding the start and end of ScrollAnimator
animated scrolls, and update logic for rubber-band ending to check for main frame
now that it is called for all frames.

css/html.css:
(input[type="button"], input[type="submit"], input[type="reset"]): Moved -webkit-file-upload-button to its own rule.
(input[type="file"]::-webkit-file-upload-button): Added and moved all previously hard-coded properties there.

This is _not_ to fix a real bug, just to make clang's
-Wdelete-non-virtual-dtor happy. As discussed at​http://codereview.chromium.org/7094005/, we prefer making leaf class
destructors virtual over making the leaf classes final.

This is _not_ to fix a real bug, just to make clang's
-Wdelete-non-virtual-dtor happy. As discussed at​http://codereview.chromium.org/7094005/, we prefer making leaf class
destructors virtual over making the leaf classes final.

This is _not_ to fix a real bug, just to make clang's
-Wdelete-non-virtual-dtor happy. As discussed at​http://codereview.chromium.org/7094005/, we prefer making leaf class
destructors virtual over making the leaf classes final.

This is _not_ to fix a real bug, just to make clang's
-Wdelete-non-virtual-dtor happy. As discussed at​http://codereview.chromium.org/7094005/, we prefer making leaf class
destructors virtual over making the leaf classes final.

This is _not_ to fix a real bug, just to make clang's
-Wdelete-non-virtual-dtor happy. As discussed at​http://codereview.chromium.org/7094005/, we prefer making leaf class
destructors virtual over making the leaf classes final.

Clang has grown a new warning that warns on |delete ptr| if ptr's
class is non-final, has virtual methods, but no virtual destructor.
This warning finds real bugs, so we want to keep it enabled. However,
it also warns about DataTransferItem[s]. Since these are subclassed,
they can't be made final, so make their destructors virtual. (Maybe
clang's warning even points out an actual bug here.)

Alas it is necessary to provide an Identifier reference for keywords
so that we can do the right thing when they're used in object literals.
We now keep Identifiers for all reserved words in the CommonIdentifiers
structure so that we can access them without a hash lookup.

This is really just a typo.
When setting up the arguments for a call out to a C operation, we'll
fail to swap arguments where this is necessary. For example, in the
case of 2 arg calls, where the first argument is in %rdx & the second
is in %rsi we should swap (exec will be passed in %rdi), but we don't.

I don't know if this can actually happen in practice, so no new tests.

platform/network/mac/ResourceHandleMac.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveAuthenticationChallenge:]):
Cancel authentication challenge if we don't have a client. We must always respond to the
challenge to release the connection, and there is nothing else to do in this state anyway.

Switching paintMask and paintObject to use IntPoint for their paint offset instead of
a pair of ints. paintObject is still on tx/ty, but paintMask was converted to IntSize
passed by value -- bringing it in-line with the agreed-upon convention of a const IntPoint&.

Canvas text is only recognized by Skia if it is registered
by creating a new SkTypeface. Skia uses CGFont to measure
and render the glyphs, then takes care of managing the glyph
cache.

Skia on Mac Chrome is not yet enabled, so this change
does not affect existing code, and requires no new tests.

platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::RemoteFontStream::RemoteFontStream):
(WebCore::RemoteFontStream::~RemoteFontStream):
(WebCore::RemoteFontStream::rewind):
(WebCore::RemoteFontStream::read):
Turn the buffer into a stream. This is identical to
the implementation in skia/FontCustomPlatformData.cpp.
While that file could be modified instead of this one,
it was simpler to add SkTypeface streaming to this instead
of adding all CGFont support to the skia platform file.

Rather than doing multiple hash lookups as we currently
do when trying to identify keywords we now use an
automatically generated decision tree (essentially it's
a hard coded patricia trie). We still use the regular
lookup table for the last few characters of an input as
this allows us to completely skip all bounds checks.

Add smart replace support to WebCore and add hooks for it in WebKit
via DumpRenderTreeSupportGtk. When a platform supports smart replace,
WebCore will remove extra spaces that appear when pasting text. Eventually
WebKitGTK+ may want to expose this in the public API.

platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::writeSelection): Now pass whether or not to use smart replace
when calling writeSelection.
(WebCore::Pasteboard::canSmartReplace): Added an implementation that checks the clipboard
for whether or not it supports smart paste.

Entering full-screen mode is causing the page layout to change because the full-screen
element is taken out of the normal flow. To counteract this effect, insert a placeholder
block as a parent of the full-screen renderer with the same size and style as the full-screen
element pre-full-screen.

Only create a placeholder for block-level elements; the technique required for inline elements
would be vastly more complicated.

Switching paintBoxDecorations to take an IntPoint representing
the paint offset instead of a pair of ints. Also cleaning up
some duplicated code in InlineFlowBox related to constraining
the paint rect to the linetop and linebottom.

The test is to get the render tree of select menu lists with varying widths based on content.
Some select list based tests are rebaselined because minimum width of RenderMenuList changes
based on the content with this fix.

The minimum width of the select-box is calculated to be as small as possible
instead of hardcoded value (width of 7 characters) in minimumMenuListSize() function
This will avoid overapping the select lists in popular websites.

Instead of creating and destroying pixmaps, and copying them using QPixmap::copy()
or relying on the implicit sharing functionality, we keep the QPixmaps alive
and just make sure their content is synchronized.

This seems to improve responsiveness noticably, as now the UI process doesn't deal
with allocating/deallocating pixmaps, and the copies are done with the optimized
path (QPainter) vs the unoptimized ones (QPixmap::copy().)

Turns out, even if we trim the ancestor chain to 0, the event is still dispatched during AT_TARGET.
So might as well be explicit about what we are trying to do and add a flag to prevent dispatch in these cases.

Zooming an object with auto size, that references a svg with fixed size was broken. The svg size stayed the same.
Get rid of the dependency between RenderSVGRoot and SVGSVGElement::currentScale(), always ask for the effective
zoom in the RenderStyle instead of asking SVGSVGElement.

The SVGSVGElement::currentScale()/setCurrentScale() methods are now only used when called from the bindings (eg. JS).
They only take effect on the outermost <svg> element in standalone documents, otherwhise they are no-ops.

When building inside the Qt source tree, qmake always append the mkspecs
defines after ours. We have to workaround and make sure that we append
our flags after the qmake variable used inside Qt. This workaround was provided
by our qmake folks. We need to append in both case because qmake behave differently
when called with -spec or via SUBDIR+=.

When building inside the Qt source tree, qmake always append the mkspecs
defines after ours. We have to workaround and make sure that we append
our flags after the qmake variable used inside Qt. This workaround was provided
by our qmake folks. We need to append in both case because qmake behave differently
when called with -spec or via SUBDIR+=. This patch unbreak r87950 on Mac for Qt port.

Adds TRACE_EVENT macro around timer and event listener dispatches. When tracing (a chromium feature) is
enabled, this allows correlating these events with painting, compositing, and everything else in chromium that
is traced. When tracing is disabled, this macro does nothing useful. Trace points are very cheap when tracing
is disabled so this should have no performance impact for non-developers.

Since qwebpage.h is a public header, we can't change the values of
the enumerations. This patch moves the new enumeration to the end
of the list. As a bonus, adds a missing entry in
editorCommandWebActions table.

The default implementation of Element::cloneNode() creates a clone
node by Document::createElement(). So, if a customized class is used for
shadow nodes, cloneNode() doesn't create a node of the correct class.

Such custom classes need to override Element

cloneElementWithoutAttributesAndChildren().

TextFieldInputType and SearchInputType had references to shadow nodes
initialized in createShadowSubtree(). However createShadowSubtree() is
not called if the host node is cloned. The accessors for shadow nodes
should search a shadow tree.

Remove the virtual methods from PasteboardHelper, so that PasteboardHelperGtk
can be removed. Since the GtkClipboard IDs are verified to be the same between
WebKit and WebCore we no longer need to communicate from WebCore to WebKit to
get them.

No new tests. This is just a code refactor.

platform/Pasteboard.h: Remove GTK+ specific methods. They are no longer needed.

platform/gtk/ClipboardGtk.cpp: Remove the m_helper member and access the
PasteboardHelper singleton directly.

platform/gtk/ClipboardGtk.h: Ditto.

platform/gtk/PasteboardGtk.cpp: Ditto.

platform/gtk/PasteboardHelper.cpp:
(WebCore::removeMarkupPrefix): Remove an extra line.
(WebCore::PasteboardHelper::defaultPasteboardHelper): Added this static getter
for the singleton.
(WebCore::PasteboardHelper::PasteboardHelper): Moved the contents of initTargetList here.
(WebCore::PasteboardHelper::getCurrentClipboard): Instead of talking with WebKit to determine
whether or not to use the primary selection clipboard, just use our new member.
(WebCore::PasteboardHelper::fillSelectionData): Use our local enum to get the ID.
(WebCore::PasteboardHelper::targetListForDataObject): Ditto.
(WebCore::PasteboardHelper::dropAtomsForContext): Ditto.
(WebCore::getClipboardContentsCallback): Ditto.

platform/gtk/PasteboardHelper.h: PasteboardHelper now keeps track of whether or
not to use the primary selection clipboard internally.
(WebCore::PasteboardHelper::setUsePrimarySelectionClipboard): Added.
(WebCore::PasteboardHelper::usePrimarySelectionClipboard): Added.

This change modifies NRWT so that if it can tell if it is
writing to a terminal, it will overwrite any messages printed
in the 'one-line-progress' and 'updates' print options, and if
not (or if --verbose was specified) the messages will be printed
without backspaces.

If the overwriting updates are disabled, one-line-progress will
only print every 10 seconds instead of on every update. This
ensures that we still get updates once in a while while the
tests are running, even if we're not in --verbose mode. Note
that one-line-progress will now still be printed in --verbose,
since it's useful as long as you're not flooded with the
updates.

Add a WebInstallMemoryPressureHandler function which will install the memory pressure handler.
-[WebView WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:] will do this,
but we'd like to be able to install a memory pressure handler without creating a WebView or even
calling any WebView method since that will call +[WebView initialize].

Changed to throw an OperationNotAllowedException with the NOT_ALLOWED_ERR
status code on any of the read methods that occur when readyState = LOADING.
Otherwise, calling any of the read methods should work.

This test is passing now that we get proper click events on the
slider and we no longer use absolute positions on the slider. The
test was updated in r78562 while it was disabled, so the chromium
results were stale (thus I'm deleting them).

editing/EditingStyle.cpp:
(WebCore::HTMLElementEquivalent::propertyExistsInStyle): Added to check both text-decoration
and -webkit-text-decorations-in-effect.
(WebCore::HTMLTextDecorationEquivalent::HTMLTextDecorationEquivalent): Added a comment.
(WebCore::HTMLTextDecorationEquivalent::propertyExistsInStyle): Checks both text-decoration
and -webkit-text-decorations-in-effect.
(WebCore::HTMLTextDecorationEquivalent::valueIsPresentInStyle): Checks if a text decoration
is present in -webkit-text-decorations-in-effect or text-decoration preferring the former.
(WebCore::EditingStyle::conflictsWithInlineStyleOfElement): Merged loops for when conflictingProperties
is false and true. Added a support for -webkit-text-decorations-in-effect.

When building inside the Qt source tree, qmake always append the mkspecs
defines after ours. We have to workaround and make sure that we append
our flags after the qmake variable used inside Qt. This workaround was provided
by our qmake folks.

When building inside the Qt source tree, qmake always append the mkspecs
defines after ours. We have to workaround and make sure that we append
our flags after the qmake variable used inside Qt. This workaround was provided
by our qmake folks.

WebCore::LayerTextureUpdaterSkPicture::updateTextureRect was not updating a tile sub-region properly.
It did not consider dest-rect when selecting the clip and translation required to draw the content-rect into dest-rect.
Also removed clearing of framebuffer because it used to clear the whole tile not just dest-rect.
An appropriate viewport could be set to just clear the dest-rect, but it was debug only code and I did not want to mess
with the viewport set by skia.

No new tests. This case should be covered by most of the layout tests (pixel) targeting selection or hovering when chromium is run in compositing mode.
Here is a non-exhaustive list of existing tests covering this case.
Test: editing/selection/14971.html (existing)

WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::NPN_GetValue):
Handle WKNVExpectsNonretainedLayer by always returning true, and also
call NetscapePlugin::setPluginReturnsNonretainedLayer(true) to add a way
for plug-ins to opt into returning non-retained layers even if they have
the quirk specified.

The bug was caused by RenderText::positionForPoint's not considering the case where a point is
above selectionTop and below lineTop of the first root inline box. Fixed the bug by considering
any point between selectionTop and lineTop to be inside a root inline box. This condition is
consistent with the condition we use to determine the bottom of a line.

Test: editing/selection/hit-test-on-text-with-line-height.html

rendering/RenderBlock.cpp:
(WebCore::RenderBlock::positionForPointWithInlineChildren): Fixed a condition to determine whether
or not a point is above the first root line box. We need to check both selectionTop and logicalTop
for the same reason explained above.

Move common code into a new class to be used by both WebKit1 and
WebKit2.

GNUmakefile.list.am: Add new files to compilation.

platform/gtk/GtkPopupMenu.cpp: Copied from Source/WebCore/platform/gtk/PopupMenuGtk.cpp.
(WebCore::GtkPopupMenu::GtkPopupMenu):
(WebCore::GtkPopupMenu::~GtkPopupMenu):
(WebCore::GtkPopupMenu::clear): Remove all menu items.
(WebCore::GtkPopupMenu::appendSeparator): Add a new separator
item to the menu.
(WebCore::GtkPopupMenu::appendItem): Add a new item to the menu for
the given action.
(WebCore::GtkPopupMenu::popUp): Show the menu.
(WebCore::GtkPopupMenu::popDown): Hide the menu.
(WebCore::GtkPopupMenu::menuRemoveItem):
(WebCore::GtkPopupMenu::menuPositionFunction):
(WebCore::GtkPopupMenu::resetTypeAheadFindState):
(WebCore::GtkPopupMenu::typeAheadFind):
(WebCore::GtkPopupMenu::selectItemCallback):
(WebCore::GtkPopupMenu::keyPressEventCallback):

platform/chromium/PopupMenuChromium.cpp:
(WebCore::PopupContainer::showPopup): Set m_focusedNode from m_frameView.
(WebCore::PopupListBox::handleMouseReleaseEvent): Call dispatchMouseEvent to forward the event only if select popup.
(WebCore::PopupListBox::acceptIndex): Change to return accepted or not.

DocumentLoader::m_resourcesClientKnowsAbout is a set of all the URLs that have passed through
FrameLoader::dispatchWillSendRequest() and is used by FrameLoader::loadedResourceFromMemoryCached to decide
whether to inform the FrameLoader's m_client about this load. Unfortunately, this set holds a reference to the
URL string for every resource loaded, so on pages that use data URLs to "load" large amounts of data this leaks
lots of memory.

This set only has an effect on the Mac port, as the only two ports that implement
FrameLoaderClient::dispatchDidLoadResourceFromMemoryCache() are Chromium and Mac and the Chromium implementation
can correctly handle receiving multiple callbacks. This patch limits the set to only PLATFORM(MAC) so other
ports do not have to pay this memory cost. It's possible that a better fix exists specifically for the Mac port
implementation, but that would have to determined by someone who works on that port specifically.

Duplicate entries of the url were getting added into drag data
which is removed. The duplicate entries were causing the same image
url to be copied twice. The code changes now match other webkit ports.

There is no change in behavior except that capitalization of a few error messages
has been changed. No new tests are added.

websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::processBuffer):
Pass m_handshake.failureReason() to fail() if the handshake has failed.

websockets/WebSocketHandshake.cpp:
Replace occurrences of m_handle->addMessage() with assignments to m_failureReason.
Change capitalization of a few messages so that all messages start with a capital letter.
(WebCore::WebSocketHandshake::readServerHandshake):
(WebCore::WebSocketHandshake::failureReason):
(WebCore::WebSocketHandshake::readStatusLine):
(WebCore::WebSocketHandshake::readHTTPHeaders):
(WebCore::WebSocketHandshake::checkResponseHeaders):

This is not testable in run-webkit-tests because unless the test is the first to run in an instance
of DumpRenderTree, it is not guaranteed that the full default style sheet has not been initialized.

css/CSSStyleSelector.cpp:

(WebCore::loadFullDefaultStyle): Replace the simple default print style, which is now equal to the
simple default style, with a new RuleSet before adding the style rules from the full default sheet.
(WebCore::loadSimpleDefaultStyle): Set defaultPrintStyle to point to the default style. They are
equal in the simple case.

Remove outer-spin-button, and render steppers as inner-spin-button.
Outer-spin-button have never worked well with padding and border of
<input>, and the layout code is very tricky and very hard to maintain it.

platform/chromium/ThemeChromiumMac.mm:
(WebCore::paintStepper):
Center the stepper drawing area because the specified area can be
larger than the NSStepper sizes.
(WebCore::ThemeChromiumMac::controlSize):
(WebCore::ThemeChromiumMac::minimumControlSize):
(WebCore::ThemeChromiumMac::inflateControlPaintRect):
(WebCore::ThemeChromiumMac::paint):

platform/mac/ThemeMac.mm:
(WebCore::paintStepper):
Center the stepper drawing area because the specified area can be
larger than the NSStepper sizes.
(WebCore::ThemeMac::controlSize):
(WebCore::ThemeMac::minimumControlSize):
(WebCore::ThemeMac::inflateControlPaintRect):
(WebCore::ThemeMac::paint):