Several layout tests depended on the fact that dropping a file would
never trigger navigation. This never happened to occur in the past,
since it just so happened that the filenames used in the tests never
resolved to files that exist. Since DragData::asURL() no longer tries
to verify file existence, the layout tests were updated to either
suppress navigation or log any navigation that should occur as part of
the test.

There's no point to trying to make sure the file is valid in
DragData::asURL(). It's better to ask for forgiveness than to ask for
permission, since asking for permission is prone to race conditions
and results in unnecessary I/O. Consumers of this function either:

Change [NSPasteboard _web_bestURL] to still return a file URL for paths
that don't exist. Callers who care about the existence of the file or
whether or not it is a directory should check themselves when they
want to use the file. The directory check has been left in for now,
since the Mac implementation of ResourceHandle, which uses this function
indirectly via DragController::performDrag) handles directories somewhat
non-intuitively: it opens the parent directory in the Finder, rather
than opening the directory itself.

This file will be easier to work with if we're actually compiling it.
Hopefully we'll get this wired into the PreloadScanner soon. Once we
start actually calling the code, we'll add it to the build system on
other platforms.

Currently host functions reuse JSFunction's ScopeChain as storage for their
NativeFunction (the C function pointer to the host function implementation).
Instead, move this onto NativeExecutable. This will allow host functions to
have a scopechain (which will be implemented as a separate patch).

Add support for layoutTestController.setIconDatabaseEnabled and layoutTestController.disableImageLoading().
The XFrameOptions tests were failing because of an extra resource load callback for favicon.ico requests.
These extra callbacks are removed by supporting both of the above layoutTestContoller commands.

Fix JSC's generation of 'Optional' arguments. When a single 'Optional' extended attribute precedes multiple method arguments, all of these arguments are optional as a group (either all or non must be specified). This fix, which makes JSC compliant with V8 and with the Web IDL specs, is pretty harmless, since Optional is currently not being used anywhere in JSC, but it blocks further work on overloads.​https://bugs.webkit.org/show_bug.cgi?id=39227

Bring CanvasRenderingContext2D's createImageData() in line with HTML5 spec
Added createImageData(ImageData) which returns a new ImageData with the same size as the one passed.
Changed createImageData(width, height) to use the absolute values of width and height.

the Poster Circle demo from webkit.org/blog, but with instructions for
putting the computer to sleep and waking it up again.

platform/graphics/win/WKCACFLayerRenderer.cpp:

(WebCore::WKCACFLayerRenderer::WKCACFLayerRenderer): Initialize new
member that tells us whether we need to try to reset the device before
rendering.
(WebCore::WKCACFLayerRenderer::resize): Changed to tell resetDevice
the reason why the device needs to be reset (which is because the
window's size has changed).
(WebCore::WKCACFLayerRenderer::render): Before we do anything else,
check if we need to reset the device before rendering. If we do, try
to reset it. If that fails, bail out and set a timer to try again
later. If we discover that the device is lost when calling
IDirect3DDevice9::Present and resetting the device fails, bail out and
set a timer to try again later.
(WebCore::WKCACFLayerRenderer::resetDevice): Changed to return a
boolean indicating whether resetting succeeded or not. Added a
ResetReason parameter so callers can specify whey the device needs to
be reset. Before trying to do anything, we call
IDirect3DDevice9::TestCooperativeLevel to find out whether the device
can be reset currently. If it can't, we set a flag to tell ourselves
that the device must be reset before we next render, and indicate to
the caller that the reset failed. If we thought the device was lost
but it turns out not to be, we don't have to do anything and can tell
the caller that the reset succeeded. Otherwise we go ahead and reset
the device as before, and indicate to the caller that the reset
succeeded.

platform/graphics/win/WKCACFLayerRenderer.h: Changed resetDevice to

return a boolean and take a ResetReason parameter. Added a comment
about when and why this function should be called. And added
m_mustResetLostDeviceBeforeRendering.

MSDN says that all resoures allocated with D3DPOOL_DEFAULT must be
destroyed before calling IDirect3DDevice9::Reset. The only way to
guarantee this with Core Animation is to call CARenderOGLPurge.

Unfortunately this isn't testable at the moment, as we don't use any
features of Core Animation (e.g., mask layers) that actually make this
required. But it seems like a good idea to fix the code now so that
if/when we do start using those features we won't run into problems.

Fixes <​http://webkit.org/b/39159> WKCACFLayerRenderer::resetDevice
might fail due to failing to destroy all D3DPOOL_DEFAULT resources

Reviewed by John Sullivan.

platform/graphics/win/WKCACFLayerRenderer.cpp:

(WebCore::WKCACFLayerRenderer::render): Moved the call to
CARenderOGLPurge from here...
(WebCore::WKCACFLayerRenderer::resetDevice): ...to here, so that it
will be called whenever we reset the device (e.g., when resizing the
window).

Implement the indexed database event interfaces as proposed by Mozilla.
Refactor the run time type detection code that was in IDBRequest into its own
class named IDBAny. Use this new class within the new event classes and
IDBResults.

Removed FIXME comment above function parseSvnPropertyValue, since
it is being used by parseSvnProperty.

Modified function parseSvnPropertyValue to break out of "while (<$fileHandle>)"
loop when it encounters the start of the next property so that it can be
processed by its caller, parseSvnPropertyValue. We reference this bullet below
by (*).

Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl: Added.

Added unit tests.

Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl:

Changed the name of the unit test "simple multi-line '-' change" to
"single-line '-' change followed by empty line" since the former was an
incorrect description of this test.

Added unit test "single-line '-' change followed by the next property", and
"multi-line '-' change followed by the next property" to test (*) above.

(WebCore::RenderBlock::computeHorizontalPositionsForLine): Added a GlyphOverflowAndFallbackFontsMap
parameter. Write fallback fonts and glyph overflow into the map.
(WebCore::RenderBlock::computeVerticalPositionsForLine): Added a GlyphOverflowAndFallbackFontsMap
parameter. Pass it down to verticallyAlignBoxes().
(WebCore::RenderBlock::layoutInlineChildren): Create a GlyphOverflowAndFallbackFontsMap on the
stack and pass it down to computeHorizontalPositionsForLine(), computeVerticalPositionsForLine(),
and verticallyAlignBoxes().

rendering/RootInlineBox.cpp:

(WebCore::RootInlineBox::verticallyAlignBoxes): Added a GlyphOverflowAndFallbackFontsMap parameter.
Pass it down to computeLogicalBoxHeights() and computeVerticalOverflow().

Properly handle invalid arguments to CanvasRenderingContext2D's getImageData() and putImageData().
Both should throw NOT_SUPPORTED_ERR when called with nonfinite arguments.
getImageData() should throw INDEX_SIZE_ERR if either width or height is 0.

Move qt_* functions in FrameLoaderClientQt, EditorClientQt, and NotificationPresenterClientQt
to DumpRenderTreeSupportQt. Create new functions to replace them in DumpRenderTreeSupportQt.
Support for the old function names is retained until confirmed that no one uses them outsideQtWebKit.

Broke Cr Win, but we didn't notice immediately due to​https://bugs.webkit.org/show_bug.cgi?id=38926. It's possible
that this didn't actually break Cr Win, but rather that bug
38926 necessitates a clean compile after this and sucessive
checkins only produced a partial recompile and thus failed to
build.

Broke Cr Win, but we didn't notice immediately due to​https://bugs.webkit.org/show_bug.cgi?id=38926. It's possible
that this didn't actually break Cr Win, but rather that bug
38926 necessitates a clean compile after this and sucessive
checkins only produced a partial recompile and thus failed to
build.

DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::canvas): Remove m_paintRect initialization in canvas().
This line updated m_paintRect unexpectedly during paintRect().
We don't need to initialize m_paintRect because show() does it.

Google Maps goes into mobile mode if JavaScript is disabled for some reason, and sends XHTML
content with XHTML Mobile DOCTYPE. We want to handle it whether XHTMLMP is enabled or not.

Test: fast/doctypes/xhtml-with-xhtmlmp-doctype.xhtml

dom/XMLTokenizerLibxml2.cpp: (WebCore::externalSubsetHandler): Restore pre-55802 behavior
for builds that don't have XHTMLMP enabled. Given that r55802 negated the condition without
breaking XHTMLMP, this line is actually always needed.

This patch adds support for HTMLMeterElement, including default rendering
of the meter element. That is because some platforms do not have a native gauge.
The feature is turned on only for the Qt platform.

fast/workers/storage/change-version-handle-reuse-worker.html: Added.
This file gets included from worker database tests; it does all the boilerplate that's needed on the DOM side.

fast/workers/storage/resources/database-worker-controller.js: Added.
This file is the boilerplate for the worker side of the database tests. It will import and run the actual test on command, and will report back completion and exceptions.

bindings/v8/custom/V8WorkerContextCustom.cpp: Add openDatabase stub; Chromium will need work both in V8 and in the browser process before we can turn this on there.
(WebCore::V8WorkerContext::openDatabaseCallback):

Note this uses the official Mac Python installer from python.org.
This installs a copy of Python in /Library/Frameworks/Python.framework.
It also makes symlinks from /usr/local/bin to the Python.framework/bin.

I have tested this script on Leopard and it worked fine. I have not
tested it on Tiger as I do not have access to a Tiger machine. In
either case this should provide a great starting point for someone
wishing to upgrade their copy of Python on Tiger.

Future patches can make our scripts depend on a success return from this
script and then they can either skip tests/sections for which python is
insufficient, or they can fail themselves.

The implementation of the custom binding for this function was a bit
different than its declaration in the IDL file. I've updated the IDL
to match the implementation, but we probably should check whether our
behavior is correct with respect to the specification.

In debug mode the RenderAreaDebugHeader was 12 bytes which
caused an alignment failure for RenderObjects because they
would start on a 4 byte boundary. Align the RenderArenaDebugHeader
using the ARENA_ALIGN macro.

In NDEBUG mode the RenderArena objects come from a pool which
has 4 byte alignment. Allow the alignment to be based on the
AllocAlignmentInteger. This define will be activated for ARMv5TE.

dom/Position.cpp: (WebCore::Position::getInlineBoxAndOffset): Now that this function correctly goes in and out of editable areas by calling

downstreamIgnoringEditingBoundaries and upstreamIgnoringEditingBoundaries for blocks (added in r58665), we no longer need a special case to
jump out to the parent when we hit an inline (which was added in r53085 when this issue was introduced).

Hopefully a last fix for the build. Call -mkdir instead of mkdir, so we don't bail if the mkdir call fails. Additionally,
use the %Env% syntax instead of $(Env), which is what we need if we are referring to Windows environment variables instead
of nmake variables.

(1) Create RenderLayers when column properties are specified. This allows descendant layers to easily
know they are inside a multicolumn layout when positioning.

(2) Patch updateLayerPosition to offset the layer into the first column that contains the layer. Splitting
of a layer across columns still does not work, but the layer will now at least appear in the first column in
which it occurs.

(3) Fix pagination bugs caused by the fact that visual overflow doesn't propagate up the line box tree when layers
are involved. Make sure to use lineTop and lineBottom in this case (it's not perfect, but it gets most cases
working properly). With this change elements like <video> will paginate properly and not get split across pages.

(4) Make column repainting and layer positioning work with RTL columns by fixing adjustForColumns to
account for RTL.

(5) Fix RTL pagination by making sure the column pagination rects are the content width of the whole block and not just
the width of one column.

Directly-composited images and solid fills shouldn't be cached, as that cache
is never used (see GraphicsLayerQtImpl::paint). Cache is only relevant for HTML content,
but we were missing that test.
The fix makes sure we only cache HTML content.

Fix a bug in the TestObj.idl file and update expected results. This
was originally part of a larger change reviewed by Eric, but I'm
landing it separately to help me understand the more interesting bits
of the patch clearly.

Extended functionality of do-webcore-rename script and used it to
rename the WebGLArray types to the TypedArray naming convention.
The only source files which were touched by hand, and which are
being manually reviewed, are:

These only needed to be touched to update the aliases between the
WebGLArray and TypedArray names introduced in bug 39036. (It was
not feasible to have do-webcore-rename handle this as it would
introduce circular renamings.) These aliases will be removed in
roughly a month once existing WebGL content has been updated.

No new tests; covered under existing WebGL tests. Updated
constructed-objects-prototypes and prototype-inheritance-2 tests.
Ran all layout tests in Safari and all WebGL tests in Chromium.

Extended functionality of do-webcore-rename script and used it to
rename the WebGLArray types to the TypedArray naming convention.
The only source files which were touched by hand, and which are
being manually reviewed, are:

These only needed to be touched to update the aliases between the
WebGLArray and TypedArray names introduced in bug 39036. (It was
not feasible to have do-webcore-rename handle this as it would
introduce circular renamings.) These aliases will be removed in
roughly a month once existing WebGL content has been updated.

No new tests; covered under existing WebGL tests. Updated
constructed-objects-prototypes and prototype-inheritance-2 tests.
Ran all layout tests in Safari and all WebGL tests in Chromium.

Extended functionality of do-webcore-rename script and used it to
rename the WebGLArray types to the TypedArray naming convention.
The only source files which were touched by hand, and which are
being manually reviewed, are:

These only needed to be touched to update the aliases between the
WebGLArray and TypedArray names introduced in bug 39036. (It was
not feasible to have do-webcore-rename handle this as it would
introduce circular renamings.) These aliases will be removed in
roughly a month once existing WebGL content has been updated.

No new tests; covered under existing WebGL tests. Updated
constructed-objects-prototypes and prototype-inheritance-2 tests.
Ran all layout tests in Safari and all WebGL tests in Chromium.

Extended functionality of do-webcore-rename script and used it to
rename the WebGLArray types to the TypedArray naming convention.
The only source files which were touched by hand, and which are
being manually reviewed, are:

These only needed to be touched to update the aliases between the
WebGLArray and TypedArray names introduced in bug 39036. (It was
not feasible to have do-webcore-rename handle this as it would
introduce circular renamings.) These aliases will be removed in
roughly a month once existing WebGL content has been updated.

No new tests; covered under existing WebGL tests. Updated
constructed-objects-prototypes and prototype-inheritance-2 tests.
Ran all layout tests in Safari and all WebGL tests in Chromium.

Scripts/do-webcore-rename:
Handle the case where some renames are substrings of others.
Support renaming files containing custom JS bindings. If
isDOMTypeRename is non-zero, expand the regexp which rewrites
the file's contents in order to support custom JS bindings.

Moved JavaScript frame.src checks out of bindings and into
HTMLFrameElementBase. Added main thread state stack to JavaScriptCore
so ExecState is available inside core DOM. Updated affected bindings
(except for GObject, which will need to be updated to avoid origin
failures inside native code).

dom/Document.cpp: (WebCore::Document::write): Check that the tokenizer is still around
after calling write(). It can become null (as it happens in regression test), and I don't
see any guarantee that it would never be replaced with a different one (but I can't make a
test for that).

Previously getFontDataForCharacters would call fontconfig once to
resolve a font name, then pass that name to getCachedFontPlatformData
to load the font. This would be two trips through fontconfig (including
IPCs). With this change, we completely load the font in the first pass.

This patch is actually the same code as in r58341, which was reverted
because of a performance problem; a performance improvement has now
been committed, and with that change in place this change improves
the Chromium intl2 page cycler performance by another 5%.

This was caused by someone incorrectly wrapping the code. :p
I'm going to have to start demanding unit tests for wrapping changes...

I also fixed the code to be able to reopen bugs which were never confirmed.
Before it regressed, the code would just log in that case. Now it actually
will reopen the bug, but there is a FIXME about how the logic is a bit backwards.

IndexedDB is now turned on for Chromium's test shell. I'm not sure
if this is the correct behavior or not (can someone confirm which it is?)
but we should get this test running again so we can catch real regressions.
And, before taking this out from behind a flag, we should be sure to fix it.

When an iframe ends up in a compositing layer (that is painting to its backing store), we need
to turn off blitting on scrolling. RenderView::paintBoxDecorations() already has code to do this
for transformed frames, so do the same thing when the frame is enclosed in a compositing layer.

Exposed the existing WebGL<T>Array constructor functions on the
DOMWindow under the naming convention in the TypedArray spec. The
implementations will be renamed in a subsequent bug, and the
aliases to the WebGL<T>Array type names eventually removed. Ran
all layout tests (including WebGL) in Safari, and WebGL tests in
Chromium.

Exposed the existing WebGL<T>Array constructor functions on the
DOMWindow under the naming convention in the TypedArray spec. The
implementations will be renamed in a subsequent bug, and the
aliases to the WebGL<T>Array type names eventually removed. Ran
all layout tests (including WebGL) in Safari, and WebGL tests in
Chromium.

Improve :visited style resolution to reduce its memory footprint and to make some speed adjustments and
simplifications.

(1) Tie the caching of link state on CSSStyleSelector to the element. Just clear out the element when
style resolution finishes for the unvisited case to avoid caching across external calls. The internal
calls share the cache just fine by doing this.

(2) Delete the RenderStyle if the link is unvisited. This shouldn't take long enough to make us vulnerable
to timing attacks, and it makes sure the overall footprint stays the way it used to be for unvisited links.

(3) Limit the set of properties that can be applied to :visited links to only the colors it supports. This
stops images from being loadable from :visited rules.

Exposed the existing WebGL<T>Array constructor functions on the
DOMWindow under the naming convention in the TypedArray spec. The
implementations will be renamed in a subsequent bug, and the
aliases to the WebGL<T>Array type names eventually removed. Ran
all WebGL layout tests in Safari and Chromium.

Exposed the existing WebGL<T>Array constructor functions on the
DOMWindow under the naming convention in the TypedArray spec. The
implementations will be renamed in a subsequent bug, and the
aliases to the WebGL<T>Array type names eventually removed. Ran
all WebGL layout tests in Safari and Chromium.

m_unloadEventBeingDispatched was already overloaded to include both unload and pagehide events.
In general, these are "page dismissal" events, and might also include beforeunload, so let's rename
the flag!

inspector/front-end/ResourcesPanel.js:
(WebInspector.ResourcesPanel.prototype.populateSidebar): save a reference to the size graph item to know when its selected
(WebInspector.ResourcesPanel.prototype._graphSelected): if the size graph is selected hide the dividers, otherwise show them

inspector/front-end/TimelineGrid.js:
(WebInspector.TimelineGrid.prototype.hideEventDividers): set the container to display: none
(WebInspector.TimelineGrid.prototype.showEventDividers): set the container to display: block

We were previously logging the text using printf("%S", bstr). This
converts the UTF-16 BSTR to a multibyte string using wctomb, which
uses the codepage for the current locale to perform the conversion.
The conversion was failing, causing printf to bail and truncate the
string. By converting to UTF-8 manually before logging, we avoid this
issue (and also end up with UTF-8 output, which is what the expected
results contain). We may have to do this in other places in DRT,
eventually.

I had this hack locally on the commit-queue, but it's fragile
and broke this morning. It will work much better if committed
to the repository. In either case it's temporary while we
work up a real fix for bug 38912.

Scripts/webkitpy/common/config/ports.py:

Expose an is_leopard() method.

Scripts/webkitpy/tool/steps/runtests.py:

Don't run compositing/iframes tests on the commit-queue under leopard.

runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncJoin): Remove branches from the hot code path
by moving the first pass outside the loop, and duplicating the hot loop
to extract the loop-invariant branch.

runtime/RegExp.cpp:
(JSC::RegExp::match): resize ovector to 0 instead of clearing to avoid
thrash in case of large matches.

runtime/StringPrototype.cpp:
(JSC::jsSpliceSubstringsWithSeparators): Inline.
(JSC::stringProtoFuncSubstring): Rewrite boundary condition checks to
reduce the number of floating point comparisons and branches.