I rushed the first version of this test because I wanted to get the
framework in the tree for other folks to work on the other tests. The
expected.txt file matches KURL but the PASS/FAIL indiciations match
GURL.

Only the mac needs java support files, so I pushed _build_java
down into the Mac port using a new hook "_check_port_build".
In the process I noticed a bunch of code which could be shared
between all ports and thus got rid of _tests_for_disabled_features
and version() copy/paste between all webkit ports.
I also made check_build only bother to check for ImageDiff if we're
using pixel tests.

WebKit should have more robust last-chance font fallback on Windows​https://bugs.webkit.org/show_bug.cgi?id=37473
<rdar://problem/7789438> Crash in FontFallbackList::determinePitch
<rdar://problem/7233762> Crash in FontFallbackList::fontDataAt

Look harder for a suitable last-resort font. Previously, we checked for
"Times New Roman" followed by DEFAULT_GUI_FONT.

Modify run_webkit_tests.py to not call sys.exit() at the end of test
run; doing so makes it more difficult to embed the routine for,
among other things, unit tests. We push the exit calling up into
new-run-webkit-tests.

This patch separates the begin/write/end cycle of decoding network
bytes and putting them into a document from the rest of the loading
machinery. The code and state required to write bytes into a document
doesn't interact very much with the rest of the loading machinery.

This patch is an intermediate step towards making the StyleChecker
class a generalized file processor that can do arbitary operations
on the files corresponding to a list of paths. This patch
also simplifies the unit-testing of patch-checking code.

Scripts/check-webkit-style:

Updated to use the new PatchChecker class.

Scripts/webkitpy/style/checker.py:

Refactored the StyleChecker.check_patch() method into the
check() method of a new PatchChecker class.

Scripts/webkitpy/style/checker_unittest.py:

Refactored the unit tests as necessary, changing the
StyleCheckerCheckPatchTest class to a PatchCheckerTest class.

new-run-webkit-tests currently has one huge function for
dealing with all options-parsing.
This patch is a first attempt at trying to split that large
function down into smaller (hopefully more readable?) chunks
dealing with the different areas of options.
For example, it would make sense to move configuration
options off into some module which deals with the vagries of
WebKit's configuration system. It would also make sense to move
Chromium options off onto the Chromium port object (where they are used).
It may make sense to move results.json options over to the results.json code.
This change is a first iteration, and we will certainly need more
refinement to this code over time. Hopefully I didn't make things
harder to read here.

We shouldn't replicate the kill_process logic in every port. Instead,
we should move the process interaction to Executive.

Dirk mentioned that he wanted this abstraction to make it easier to
mock things out for testing. It turns out this function is only used
in one place where it can't be used as a mock point for testing because
the corresponding create process actually creates a real process. In
the long term, we should indirect both these calls through a non-static
Executive as a mock point. However, we should wait on that until we
actually want to write the test.

Implement support for changing the executable bit of a file.
The executable bit is among the most changed file properties.
Future support can include other property changes.

Currently, if a patch changes the executable bit of a file
it is not respected by svn-apply or svn-unapply. Since the
commit-queue bot uses these tools as part of its workflow,
such patches cannot be committed by it. That is, such patches
need to be committed by hand. Instead, we should add support
for the executable bit so that such patches can be committed
by the commit-queue bot.

Scripts/VCSUtils.pm: Also change reference to Apple Computer, Inc.
in copyright to Apple, Inc.

The Git-based bots don't have this trouble because
Git.clean_working_directory fully removes files that were
marked as "add". SVN.clean_working_directory previously just
called "svn revert" which would leave added files in the
working directory untracked. This patch makes
SVN.clean_working_directory function more like
Git.clean_working_directory by removing added files after revert.

Moving files associated with the GPU compositor from platform/graphics/skia to platform/graphics/chromium. Class
rename was done in a previous CL, this CL does the file move and rename.​https://bugs.webkit.org/show_bug.cgi?id=37231

We need to always update the status server so we don't get stuck in a
spam loop. I tried writing a test for this change, but it kind of
got out of control. We need a better way to do failure injection.

Dirk Pranke pointed out that my last patch was wrong because I
introduced platform-specific logic into run_webkit_tests.py, limiting
the parallelism in Chromium to work around a bug in the main Mac port.

mac.py and chromium_mac.py had some copy/paste code. This code doesn't
actually have anything to do with WebKit ports. It's really just
something in the multiprocessing package. The lame bit is that package
isn't available in older versions of Python, so we need to implement a
fallback. However, we already have the fallback in common. We don't
need to reinvent it specificly for layout_tests.

Bring the WebKit2 Xcode configuration in to sync with recent changes to the WebKit Xcode configuration files.

Reviewed by Sam Weinig.

In particular, this updates the FEATURE_DEFINES to match those used in the other projects, and brings in
the changes to support building WebKit for older Mac OS X versions from the current Mac OS X version.

A dynamically loaded style sheet kicks off its own styleRecalc cycle. This was not
bracketed with a beginAnimationUpdate/endAnimationUpdate which wasn't resetting the
animation time. In some time-dependent cases this was causing a negative elapsedTime
to be sent to the keyframe animator. This is an invalid case which destroys the
animation prematurely. I not only added the brackets, but I also added an assert
and protection for when the elapsedTime comes up negative.

Common target settings are pulled out in to BaseTarget.xcconfig. The majority of setting overrides are
removed from the Xcode project itself. Info.plist files are updated to match those used in other frameworks.

(WebCore::DOMWrapperWorld::DOMWrapperWorld): Made DOMWrapperWorld wholly
responsible for managing its presence in WebCoreJSClientData's world set.
This is simpler and more encapsulated than making its clients sometimes
responsible for managing that set and sometimes not.

bindings/js/DOMWrapperWorld.h:

(WebCore::DOMWrapperWorld::create): Made isNormal default to false,
removing one of the reasons for the IsolatedWorld class to exist, so I
could remove that class.

bindings/js/JSDOMWindowBase.cpp:

(WebCore::JSDOMWindowBase::commonJSGlobalData): Used the work-around below.

bindings/js/ScriptController.cpp:

(WebCore::ScriptController::createWorld): Nixed IsolatedWorld, which is
now superfluous.

bindings/js/WebCoreJSClientData.h:

(WebCore::initNormalWorldClientData): Added a work-around for the fact
that WebCoreJSClientData must be set as globalData->clientData before
the DOMWrapperWorld constructor runs. This removed the other reason
for the IsolatedWorld class to exist, so I could remove that class.

platform/network/cf/ResourceResponseCFNet.cpp: (WebCore::ResourceResponse::platformLazyInit):
Moved code for parsing status line to HTTPHeaders, as it's used for both Mac and CF now.

platform/network/mac/ResourceResponseMac.mm: (WebCore::ResourceResponse::platformLazyInit):
Use the actual reason phrase when available, and "OK" otherwise. Synthesizing a reson when
there isn't one is misleading, so we'll stick to our old broken behavior on Tiger, rather than
introduce a new broken one.

The problem here is that SVN was violating SCM's implicit
contract of always returning paths relative to the repository root.
That can easily be fixed by telling SVN that the CWD is the repository root.

When fixing this I realized there are a large number of places in SCM.py where
we want to consider explicitly passing self.checkout_root as the CWD.
That would allow scm methods to be executed even when the CWD is not inside
the scm tree at all, and would also make sure (in the case of SVN) that paths
returned are relative to the root. Git (almost always) returns paths relative
to the repository root.

Add a ton of FIXMEs about the need to go back and decide which methods require cwd=self.checkout_root
and which do not. We'll probably add a helper function to scm (likely SCM._run) which
always passes cwd=self.checkout_root to Executive.run_command

Scripts/webkitpy/common/checkout/scm_unittest.py:

Add a test for this change.

Scripts/webkitpy/tool/commands/upload.py:

Removed the explicit os.chdir to the repository root, since scm.py methods
should be robust against the cwd not being equal to the root.

Move the ExceptionCode paramter to the last position in
IndexedDatabaseRequest::open and friends. It should definitely
go after the callbacks to keep the parameters that come directly
from javascript together. And having output parameters appear
last is done often in the code base, so it makes sense to push
it past the Frame* param as well.

Move the ExceptionCode paramter to the last position in
IndexedDatabaseRequest::open and friends. It should definitely
go after the callbacks to keep the parameters that come directly
from javascript together. And having output parameters appear
last is done often in the code base, so it makes sense to push
it past the Frame* param as well.

(WebCore::WorkerScriptController::):
Added option parameter to forbidExecution (both JCS and V8 versions) that specifies whether currently running
script should be immediately terminated or left executed until the end.

bindings/js/WorkerScriptController.h:

(WebCore::WorkerScriptController::workerContextWrapper):
This method now can return 0 instead of context if the further execution of JS is forbidden. Since any JS execution requires
fetching JS global object first, returning 0 here is a good way to prevent re-entry into JS once worker started termination.
V8 version does similar thing already in WorkerScriptController::proxy().

(WebCore::CloseWorkerContextTask::create):
(WebCore::CloseWorkerContextTask::performTask):
(WebCore::CloseWorkerContextTask::isCleanupTask):
(WebCore::WorkerContext::close):
Use new forbidExecution(LetRunningScriptFinish) to avoid termination of script until it executes and exits.
Post a task to actually terminate the worker once the currently executing JS fragment exits.

workers/WorkerThread.cpp:

(WebCore::WorkerThread::workerThread):
(WebCore::WorkerThread::stop):
Use new forbidExecution(TerminateRunningScript) to immediately terminate the JS.

LayoutTests:

fast/workers/resources/worker-close.js:

fast/workers/worker-close-expected.txt:

Updated tests to expect the script fragment that includes close() to run to completion.

fast/workers/worker-close-more-expected.txt: Added.

fast/workers/worker-close-more.html: Added.

fast/workers/worker-close.html:

Added test to check terminate() after close() and close() in the case of multiple MessagePort messages dispatching.

HTMLFormElement::validateInteractively() called from prepareSubmit()
prevents the submission if neither noValidate nor formNoValidate is
specified, and focuses on the first invalid control of which "invalid"
event is not canceled.

[ Re-landing of r57329 with the requisite memset added in -initWithFrame: so that the tests keep working. ]

Reviewed by John Sullivan.

In r56008 new instance variables were added to WebDynamicScrollBarsView, increasing its size.
This causes problems for 32-bit applications that derive from WebDynamicScrollBarsView, as the
size and layout of their subclasses is baked in at compile time. This results in instances
being allocated that are smaller than the new code expects, and may result in the new instance
variables sharing the same memory space as any instance variables that the subclass defines.

We can avoid this problem by having the class contain only a single member that acts as a pointer
to a heap-allocated structure that acts as storage for the real instance variables. This makes
us free to add instance variables in the future without risk of changing the size of the class.
To ensure that 32-bit applications that are built against this new WebDynamicScrollBarsView header
are able to run against older versions of WebKit we pad the class out to its previous size. This
results in any subclasses of WebDynamicScrollBarsView being created with a layout that is compatible
with both versions of the code.

This change could potentially break a subclass of WebDynamicScrollBarsView that directly accesses
instance variables of its superclass. However, this is a private header and no known subclasses
of WebDynamicScrollBarsView access superclass instance variables in this fashion.

In r56008 new instance variables were added to WebDynamicScrollBarsView, increasing its size.
This causes problems for 32-bit applications that derive from WebDynamicScrollBarsView, as the
size and layout of their subclasses is baked in at compile time. This results in instances
being allocated that are smaller than the new code expects, and may result in the new instance
variables sharing the same memory space as any instance variables that the subclass defines.

We can avoid this problem by having the class contain only a single member that acts as a pointer
to a heap-allocated structure that acts as storage for the real instance variables. This makes
us free to add instance variables in the future without risk of changing the size of the class.
To ensure that 32-bit applications that are built against this new WebDynamicScrollBarsView header
are able to run against older versions of WebKit we pad the class out to its previous size. This
results in any subclasses of WebDynamicScrollBarsView being created with a layout that is compatible
with both versions of the code.

This change could potentially break a subclass of WebDynamicScrollBarsView that directly accesses
instance variables of its superclass. However, this is a private header and no known subclasses
of WebDynamicScrollBarsView access superclass instance variables in this fashion.

WebCore.xcodeproj/project.pbxproj: Wire up the script. Remove the three inappropriate

files from the Copy Bundle Resources build phase.

WebKitTools:

Add a script to detect the presence of inappropriate files in the frameworks. At present
it only looks for .css, .idl and .in files in the top level of WebCore.framework/Resources,
as these are the only cases we've encountered recently. It can be extended to check the
other frameworks or for other inappropriate files in the future.

Add NDEBUG to the defines for package build in JavaScriptCore.pri,
so that it's consistently used for JavaScriptCore, WebCore, jsc and all
other tools using wtf, etc. data structures directly. Mixing NDEBUG with
non-NDEBUG builds causes crashes due to differences in data structures when
assertions/checks are enabled.

Do not use moc to preprocess user agent style sheets because it removes at-symbols
and hexadecimal colours from declarations.
Remove unneeded preprocessor usage from make-css-file-arrays.pl since the script
processes default css files using regular expressions therefore preprocessing is redundant.

WebCore.pri: remove --preprocessor usage

css/make-css-file-arrays.pl: remove gcc dependency

LayoutTests:

Update expected files after removal of moc preprocessing of default css sheets.
These test results now only differ in metrics from Mac ones.

bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::processingUserGesture):
Use UserGestureIndicator in more cases.

page/EventHandler.cpp:
(WebCore::EventHandler):
Impact from UserGestureIndicator API change.
(WebCore::FrameLoader::submitForm):
Block the load immediately if popups are not allowed and it would
open a new window.

loader/RedirectScheduler.cpp:
(WebCore::ScheduledFormSubmission::ScheduledFormSubmission):
Note the UserGestureIndicator status at the time of submission.
(WebCore::ScheduledFormSubmission::fire):
Use the stored UserGestureIndicator status in the asynchronous
callback.

on the results of iterating directories. Test order is based on
what's passed on the command line. Removed code that aimed to
eliminate duplicates since it can be useful to run the same test
more than once.

In Spatial Navigation logic, during rect acquisition in renderRectRelativeToRootDocument,
sometimes negative x() or y() values are got, and the current algorithm bails out in
any of such cases.

However, when a node is in a scrollable content (content overflow <div>) and
this scrollable container scrolled up, element gets offscreen, and gets negative values
for y(), for example. In such cases, they are still valid to be used in Spatial Navigation
logic.

Followup optimization to bug 24300, don't leak history info via CSS :visited. If a Web
site uses document colors that are the same for link and vlink in HTML and also doesn't
specify any :link or :visited rules, then don't waste time resolving visited styles.

Reviewed by Oliver Hunt.

There is a further optimization that could be done to detect when :link and :visited are
used together in the same rule to specify a color, and this is how most sites turn off
visited link colors, but this fix doesn't address that. It just restores the optimization
that existed prior to the patch in 24300 landing.

(WebCore::computedStyle):
Add a boolean to computed style declarations that - if set - causes the computed style
to still return :visited information. For normal Web pages, this will be false. It is set
to true for the Web Inspector and by the WebKit SPI used by the layout tests.

Rework the style selector to resolve two styles instead of one. The first forces the link to
be unvisited, and the second forces the link to be visited. The real state of the link is
cached on the principal (unvisited) style. The visited style hangs off the principal style
as a pseudo style (VISITED_LINK).

dom/Element.cpp:

(WebCore::Element::pseudoStyleCacheIsInvalid):
Make sure to deal with the VISITED_LINK pseudo to know when only :visited style info changed.

Change how link information is stored. The noninherited flags now have a bit set for if you're a link
or not. The inherited flags now cache whether you're inside a visited or unvisited link (or no link at
all).

Rolling out the change committed in change set 56717
since we rolled out the change committed in change set 56655,
<​http://trac.webkit.org/changeset/56655> (in change set 57287,
<​http://trac.webkit.org/changeset/57287>). The change committed
in change set 56655 caused a layout test regression of the some
of the mozilla- and mozilla expected failure- tests. See bug #9268
for more details.

Rolling out the change committed in change set 56655
because it caused a regression in some of the mozilla
and mozilla expected failure test cases, such as:
tables/mozilla/marvin/backgr_simple-table-row.html, and
tables/mozilla/marvin/backgr_simple-table-row-group.html.

Rolling out the change committed in change set 56655
because it caused a regression in some of the mozilla
and mozilla expected failure test cases, such as:
tables/mozilla/marvin/backgr_simple-table-row.html, and
tables/mozilla/marvin/backgr_simple-table-row-group.html.

Patch introduces a lock scrollbars concept to ScrollView, as in WebDynamicScrollBarsView.mm/h
on WebKit/mac. It is needed because in QtWebKit, we have Api for setting both vertical and
horizontal scrollbars on/off/auto. When it is set to off, for example, it should remain
as such, unless unset.

For the locking concept, optional 'lock' parameters were added to setScrollbarModes,
setHorizontalScrollbarMode and setVerticalScrollbarMode methods of ScrollView. As these
are all optional, any previous code calling them do not need modification.

Two optional parameters were also added to Frame's createView method, for horizontal and vertical
lock state persistence cross page loads.

The scrolling check was based on the frameview's scrolloffset, and
maximumScrollPosition, which does not acknowledge the overflow properties.

I am now basing the scrolling off the scrollbar position. The scrollbars are
affected by the overflow properties indicating when not to scroll. The scrollbar
positions also continue to work for CSS ::-webkit-scrollbar styles.