Ensure that the state of the scrollbar implementation is kept in sync
with WebCore's internal representation. Previously, we synchronized them
at paint time, causing pulsing to be skipped due to the scrollbars being
disabled.

RenderLayerBacking would set the contentsScale on GraphicsLayers
on creation, and update it when the pageScaleFactor changed. However,
RenderLayerBacking doesn't really know what contentsScale is best
for a layer, so instead, have GraphicsLayers call back through the
GraphicsLayerClient to get the two relevant scale factors, and do
their own computation of contentsScale.

No testable behavior changes.

page/Frame.cpp:
(WebCore::Frame::pageScaleFactorChanged): No need to pass the scale.

platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::notePageScaleFactorChangedIncludingDescendants):
Recurse through the GraphicsLayer tree, calling pageScaleFactorChanged() on
each layer.

platform/graphics/GraphicsLayerClient.h:
Add methods to fetch the backingScaleFactor() and pageScaleFactor().

platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::GraphicsLayerCA): m_uncommittedChanges
defaults to ContentsScaleChanged so we update contentsScale on
the first flush.

(WebCore::GraphicsLayerCA::setContentsToBackgroundColor):
This was the wrong time to call updateContentsRect() and setupContentsLayer();
those should be done at commit time, so moved to updateLayerBackgroundColor().
(WebCore::GraphicsLayerCA::recursiveCommitChanges): Note whether we
have any changes, and call didCommitChangesForLayer() on the client.
(WebCore::GraphicsLayerCA::updateLayerBackgroundColor): Code moved to here.
(WebCore::clampedContentsScaleForScale): No longer has any hysteresis
on the scale, and now just clamps.
(WebCore::GraphicsLayerCA::updateContentsScale): Fetch the scales
from the client, and multiply them, then clamp.
(WebCore::GraphicsLayerCA::requiresTiledLayer): This now takes
contentsScale into account when deciding to use tiled layer,
so that zooming in will cause layers to start tiling.
(WebCore::GraphicsLayerCA::swapFromOrToTiledLayer): Don't call
setContentsScale(), but rather updateContentsScale().
(WebCore::GraphicsLayerCA::pageScaleFactorChanged): Set the bits
for properties that depend on the scale.
(WebCore::GraphicsLayerCA::noteChangesForScaleSensitiveProperties):
Note that contentsScale needs to be updated. At some point we might also
need to dirty other properties.

platform/graphics/ca/GraphicsLayerCA.h: Moved the m_allowTiledLayer
bool for better packing. No need for a m_contentsScale member now.

Added support for --no-http, which disables both HTTP and websockets tests.
It also matches the old-run-webkit-tests behavior if --force is used.

Scripts/webkitpy/layout_tests/controllers/manager.py:

Fixed HTTP_SUBDIR and WEBSOCKET_SUBDIR as tests do not start with a leading separator.
We check if --no-http is set and add the HTTP / websockets tests to the skipped list prior to looking
at the expectation file. Fixed the _test_requires_lock function to use the same code path to determine
what is worth have an HTTP lock as --no-http to avoid badness.

Scripts/webkitpy/layout_tests/port/test.py: Added 2 new tests to our mock filesystem to validate that

(WebCore::RenderMenuList::RenderMenuList):
Update the initialization list for the renamed m_lastActiveIndex.
(WebCore::RenderMenuList::setTextFromOption):
A new selection has been made in the popup; call
didUpdateActiveOption().
(WebCore::RenderMenuList::didSetSelectedIndex):
Call didUpdateActiveOption(), passing the index of the newly-selected
<option>.
(WebCore::RenderMenuList::didUpdateActiveOption):
If accessibility is disabled, or if the active option has not changed,
return early. Check whether the option index is in the range of list
items, and assert that the item at that index is an <option> element.
Tell the AccessibilityMenuList for this element that we updated the
active option.

rendering/RenderMenuList.h:

Updated the declaration of didSetSelectedIndex() to take the selected
index. Declared didUpdateActiveOption(). Renamed m_lastSelectedIndex to
m_lastActiveIndex.

Tools:

DumpRenderTree/AccessibilityController.h:

Added m_notificationsEventHook for addNotificationListener().
m_allEventsHook will now be used for setLogAccessibilityEvents().

DumpRenderTree/win/AccessibilityControllerWin.cpp:

(AccessibilityController::AccessibilityController):
Initialize m_notificationsEventHook.
(AccessibilityController::~AccessibilityController):
Turn off logging of all accessibility events. If
m_notificationsEventHook is non-null, unhook it.
(logEventProc):
Add handling of EVENT_OBJECT_SELECTION.
(AccessibilityController::setLogAccessibilityEvents):
If the state of logging is not changing, return early. If we're turning
off logging, unhook m_allEventsHook, and zero it out. Otherwise, add a
hook for all events.
(AccessibilityController::addNotificationListener):
Use m_notificationsEventHook rather than m_allEventsHook.

No test, because eventSender sends events to the WebView, rather than
the popup menu, so the popup isn't closed.

WebCore.vcproj/WebCore.vcproj:

Add SelectElementWin.cpp to project.

dom/SelectElement.cpp:

(WebCore::SelectElement::platformHandleKeydownEvent):
Moved ARROW_KEYS_POP_MENU code here. Updated to return whether the
function has handled the key, or whether the caller needs to process it
further.
(WebCore::SelectElement::menuListDefaultEventHandler):
Allow the platform the first chance at handling the keyboard event.

dom/SelectElement.h:

Declare platformHandleKeydownEvent().

dom/SelectElementWin.cpp: Added.

(WebCore::SelectElement::platformHandleKeyboardEvent):
Allow (Shift) F4 and (Ctrl/Shift) Alt/AltGr + Up/Down
arrow to show the popup. After the popup is dismissed, call
setSelectedIndex(), and report that we handled the event.

platform/win/PopupMenuWin.cpp:

Declare HIGH_BIT_MASK_SHORT.
(WebCore::PopupMenuWin::show):
Forward WM_SYSKEYDOWN to the popup's HWND.
(WebCore::PopupMenuWin::wndProc):
Allow the same shortcuts that show the menu to hide it, matching
Firefox.

(WebCore::AccessibilityMenuListPopup::addChildren):
Remove a comment about WML, which we no longer support.
(WebCore::AccessibilityMenuListPopup::childrenChanged):
Don't just remove children that were detached - this will miss childen
that were dynamically added. Clear the children and re-add them.

I had removed this code in r76620 because I thought it wasn't used.
Turns out there was a layout test in the chromium tree that never
got migrated that used it. Re-add the code and land the layout
test (I will remove it from the chromium tree soon).

Use getGraphicsResetStatusARB already defined in Extensions3D to
determine why the context was lost, and respond to guilty context
notifications by forbidding restoration of the context.

It isn't currently possible to write an automated test for this.
We might consider extending the WEBKIT_lose_context extension to
allow a reason to be provided why the context was lost. It was
tested manually in Chromium on Windows and Linux with some test
cases that provoke actual graphics card resets.

This is to make it possible to use TransformState in some GraphicsLayer work. HitTestingTransformState
was split out and left in rendering since it's not needed in the platform code. Also added a FIXME
because HitTestingTransformState should eventually be replaced by TransformState.

(-[WKView centerSelectionInVisibleArea:]): Call WebPageProxy::centerSelectionInVisibleArea().
(-[WKView validateUserInterfaceItem:]): Enable the centerSelectionInVisibleArea: selector if there's a selection
range or if there's an insertion point in an editable area.

WebProcess/WebPage/FindController.cpp:

(WebKit::FindController::showFindIndicatorInSelection): Call updateFindIndicator() to show the find indicator.

WebProcess/WebPage/FindController.h:

WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::centerSelectionInVisibleArea): Use the selection in the focused or main frame.
After scrolling the selection into view, flash the find indicator.

This patch moves some of NonSpeculativeJIT's functionality up into the
JITCodeGenerator superclass so that it can be used from both JITs. Now,
in cases where the speculative JIT doesn't want to speculate but still
wants to emit good code, it can reliably emit the same code sequence as
the non-speculative JIT. This patch also extends the non-speculative
JIT's compare optimizations to include compare/branch fusing, and
extends the speculative JIT's compare optimizations to cover StrictEqual.

The root problem here is that we pass the wrong values into
calls, and then try to fix them up in the callee. Correct
behaviour per the spec is to pass in the value undefined,
as this unless either (1) the function call is based on an
explicit property access or (2) the base of the call comes
directly from a 'with'.

This change does away with the need for this conversion of
objects (non strict code should only box primitives), and
does away with all this conversion for strict functions.

This patch may have web compatibility ramifications, and may
require some advocacy.

(WebCore::unroundClippedCorners):
(WebCore::RenderBoxModelObject::paintBorder):
Any invisible corner may be replaced with a corner of radius zero, as
long as the stroke style is solid. Change the GraphicsContext
parameter into a PaintInfo parameter so we can get the rect to be
drawn.

The problem is that currentThread results in a pthread_once call which always takes a lock.
With this change, currentThread is 10% faster than isMainThread in release mode and only
5% slower than isMainThread in debug.

wtf/ThreadIdentifierDataPthreads.cpp:

(WTF::ThreadIdentifierData::initializeOnce): Remove the pthread once stuff
which is no longer needed because this is called from initializeThreading().
(WTF::ThreadIdentifierData::identifier): Remove the initializeKeyOnce call because
intialization of the pthread key should already be done.
(WTF::ThreadIdentifierData::initialize): Ditto.

Get LoaderRunLoop to work on Mac when USE(CFNETWORK) is enabled. Although we could use the
main run loop, it's better to have a separate thread handling the loads so that it can work
in parallel to the main thread. This is similar to what NSURLConnection does for us
internally when we use the NS APIs.

No new tests because no change in functionality and option is not enabled on Mac.

platform/network/cf/LoaderRunLoopCF.cpp:

(WebCore::runLoaderThread): Create an autorelease pool for objc code that might be called in
the run loop.
(WebCore::loaderRunLoop):

Build fixes for WebKit2. Ensure that all generated sources are
on nodist primaries, that they are on forward declared variables
so that BUILT_SOURCES is calculated properly and that zlib is
included during linking (for WOFF support).

Replace previousWordPosition/nextWordPosition with previousBoundary/nextBoundary which do
not honor editable bounary. Honor editable boundary as the last stage of leftWordPosition
and rightWordPosition.

Check previousBoundary/nextBoundary against NULL. Have a static function to encapsulate the
usage of getInlineBoxAndOffset and check the visible position is not NULL before passing to
getInlineBoxAndOffset. Check the box returned from getInlineBoxAndOffset is not NULL before
accessing.

Keeping errors and warnings on the TestExpectationLine instance allows us to decouple storing errors
from various parsing and validation mechanisms and have more flexibility in reporting and understanding the origin of the errors.

converted the code to add errors and warnings to corresponding TestExpectationLine instances, removed the code that used to store
this info on TestExpectations. In the process, had to refactor ModifierMatcher a bit to take in a TestExpdectationLine instance.

This moves us toward the world where errors are collected on the expectations, which allows us to
easily enumerate them, keep association with the point of origin, and freely pass TestExpectationLine instances around.

Also eliminate the validator idea, since validation is a context-dependent concept and has to be decoupled from initial
parsing.

RenderThemeWin needs to override extraFullScreenStyleSheet() to return
the fullscreenQuickTime stylesheet.

Test added to fullscreen/video-controls-override.html.

rendering/RenderThemeWin.cpp:

(WebCore::RenderThemeWin::extraFullScreenStyleSheet): Added.

rendering/RenderThemeWin.h: Override extraFullScreenStyleSheet().

LayoutTests:

Reviewed by Darin Adler.

Add another test to video-controls-override.html to verify that
we're using the correct fullscreen controller by checking the
height of the controller panel, which is taller than the non-fullscreen
version. Unfortunately, the fullscreen tests don't work on Windows
yet, but I verified this would have caught this issue by simulating
the bug on the Mac.

fullscreen/video-controls-override-expected.txt: Add new test to check the height of the panel.

fullscreen/video-controls-override.html: Add new test to check the height of the panel, and

log errors if window.internals or window.layoutTestController are undefined.

Rename setActualVisibleContentRect to setFixedVisibleContentRect
as that makes it more obvious that it is an override. It is also
consistent with the setFixedLayout which is often used in
conjunction with it.

Make visibleContentRect return the fixed value if set, and remove
all calls to actualVisibleContentRect.

Also updated the documentation.

This is similar to what we have on our QtWebKit/N9 branch and is
pretty well tested.

platform/ScrollView.cpp:

(WebCore::ScrollView::visibleContentRect):
If a fixed visibleContentRect is set, return that.
Remove the code returning the contents size when in
paintsEntireContents mode as that is wrong and already
ifdeffed out for EFL.
(WebCore::ScrollView::setScrollPosition):
Do not try to be smart and update the fixed visibleContentsRect
automatically, as the embedder might ignore the scroll request
for various reasons.

(QWebPage::setActualVisibleContentRect):
Change to use setFixedVisibleContentRect.

WebCoreSupport/FrameLoaderClientQt.cpp:

(WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
Only set fixedVisibleContentRect for the mainframe.

symbian/eabi/QtWebKitu.def:

Source/WebKit2:

Rename setActualVisibleContentRect to setFixedVisibleContentRect
as that makes it more obvious that it is an override. It is also
consistent with the setFixedLayout which is often used in
conjunction with it.

UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::setFixedVisibleContentRect):

UIProcess/WebPageProxy.h:

UIProcess/qt/qtouchwebpageproxy.cpp:

(QTouchWebPageProxy::setVisibleArea):

WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
Only set fixedVisibleContentRect for the mainframe.

Some plugins, specially flash, can cause X errors that when
handled by the default X error handler (or the GDK one) abort the
process. Since we don't want to crash due to buggy plugins, we
install a custom error handler to show a warning when a X error
happens without aborting.

LocalStorage: Changed the value type of ItemTable from TEXT to BLOB
to avoid string truncation.
This patch will also convert the exsisting ItemTable and perform
the DATA MIGRATION job.​https://bugs.webkit.org/show_bug.cgi?id=58762

(WebCore::SQLiteStatement::isColumnDeclearedAsBlob):
Test if the pre-defined type of column is BLOB.

platform/sql/SQLiteStatement.h:

storage/StorageAreaSync.cpp:

Change the localStorage value type from Text to BLOB to avoid the
value string truncation at \x00.
(WebCore::StorageAreaSync::openDatabase):
Change the database structure, use BLOB to replace the TEXT type of
value segment in ItemTable.
(WebCore::StorageAreaSync::migrateItemTableIfNeeded):
Migrate the ItemTable if the pre-defined type of value is TEXT.
(WebCore::StorageAreaSync::performImport):
Use getColumnBlobAsString() to import the BLOB value.
(WebCore::StorageAreaSync::sync):
Use bindBlob() to bind value string to the SQLiteStatement for the
database execution.

Make IconDatabase feature optional by removing its initialization from _ewk_init_body().
Now IconDatabase must be fully managed by an application:
if it doesn't want to use it, there's nothing to do. Otherwise, just call
ewk_settings_icon_database_path_set() with the directory path.

(WebCore::Document::resetFormElementsOwner): Removed the argument which is no longer needed.

dom/Document.h: Ditto.

html/FormAssociatedElement.cpp:

(WebCore::FormAssociatedElement::insertedIntoTree): Resets m_form whenever the element has the form attribute.
(WebCore::FormAssociatedElement::resetFormOwner): Don't set m_form when there is no form element which has the given id.
(WebCore::FormAssociatedElement::formAttributeChanged): Removed the argument of resetFormOwner().

Adds a test for checking input elements don't associate any form elements when they have the form attribute which points nonexistence form.
Fixes existing tests that contain unintended form attributes.

Changed the timing of the lazy sweep so that it occurs when we land on
a previously-unsweeped block, rather than whenever we land on an unsweeped
cell. After the per-block lazy sweep occurs, the block is turned into a
singly linked list of free cells. The allocation fast path is now just a
load-branch-store to remove a cell from the head of the list.

Additionally, this changes the way new blocks are allocated. Previously,
they would be populated with dummy cells. With this patch, they are
turned into a free list, which means that there will never be destructor
calls for allocations in fresh blocks.

These changes result in a 1.9% speed-up on V8, and a 0.6% speed-up on
SunSpider. There are no observed statistically significant slow-downs
on any individual benchmark.

(WebCore::CSSStyleSelector::useSVGZoomRules):
Make this a public member function instead of a private static function.
(WebCore::CSSStyleSelector::applyProperty):
Removed code now implemented in CSSStyleApplyProperty.
(WebCore::CSSStyleSelector::setFontSize):
Use new useSVGZoomRules function.

Fix the unit tests. Unfortunately scm does not use a filesystem
object so we can't control the result of detect_scm_system.
When detect_scm_system would fail, we would log, which would
cause all passing_run integration tests to fail.

This should fix the bug. Unfortunately this code is currently
impossible to test since it's impossible to mock detect_scm_system at the
moment. I started re-writing scm.detection.py to be mockable, but decided that
was best left for another day.

Only valid file descriptors are now sent using sendmsg() control
messages, and instead of sending a list of attachment sizes we now
send a list of AttachmentInfo structs. AttachmentInfo contains
information about the attachments including the size for
MappedMemory attachmens and whether the attachment is null or not.

Platform/CoreIPC/unix/ConnectionUnix.cpp:

(CoreIPC::AttachmentInfo::AttachmentInfo): New class containing
information about the attachments sent.
(CoreIPC::AttachmentInfo::setType): Set the attachment type.
(CoreIPC::AttachmentInfo::getType): Return the attachment type.
(CoreIPC::AttachmentInfo::setSize): Set the size for MappedMemory attachments.
(CoreIPC::AttachmentInfo::getSize): Get the size for MappedMemory attachments.
(CoreIPC::AttachmentInfo::setNull): Set attachment as null, it
contains an invalid file descriptor, so the receiver shouldn't
expect a file desriptor for this attachment.
(CoreIPC::AttachmentInfo::isNull): Return whether attachment is
null, it contains an invalid file descriptor.
(CoreIPC::Connection::processMessage):
(CoreIPC::Connection::sendOutgoingMessage):

Moved subtreeHasChanged from RenderTextControl, RenderTextControlSingleLine, and
RenderTextControlMultiLine to HTMLTextFormControlElement, HTMLInputElement, and
HTMLTextAreaElement. Also moved m_searchEventTimer and related functions from
RenderTextSingleLine to SearchInputType.

(CoreIPC::Attachment::Attachment): Add the ability to pass a
socket via Attachment.

Platform/unix/SharedMemoryUnix.cpp:

(WebKit::SharedMemory::Handle::encode): Remove assertions that
check that the Handle is not null. In
PluginProxy::geometryDidChange we pass a null Handle if we do not
need to allocate a new backing store.
(WebKit::SharedMemory::Handle::releaseToAttachment): Ditto.

PluginProcess/PluginProcess.cpp:

(WebKit::PluginProcess::createWebProcessConnection): Use
Attachment. Set up the connection with socketpair.

Silent spilling and filling of registers is done during slow-path C
function calls. The silent spill/fill logic does not affect register
allocation on paths that don't involve the C function call.

This changes the silent spilling code to spill in unboxed form. The
silent fill will refill in whatever form the register was spilled in.
For example, the silent spill code may choose not to spill the register
because it was already spilled previously, which would imply that it
was spilled in boxed form. The filling code detects this and either
unboxes, or not, depending on what is appropriate.

This change also results in a simplification of the silent spill/fill
API: silent spilling no longer needs to know about the set of registers
that cannot be trampled, since it never does boxing and hence does not
need a temporary register.

In addition to clearing the instance's children in the destructor,
clear them when the instance is detached from its <use>. This way,
we won't attempt to use them after we're detached but before the
destructor has been called.

Some functions assumed calculateKeyTimesIndex() does not return the last index of
the keyTimes, but it would be right behavior for calculateKeyTimesIndex() when it
accepts 1 as the percent argument.

To avoid the assumption, and for more efficiency, this patch allows the functions
using calculateKeyTimesIndex() to return early when it accepts 1 as the percent argument.
These functions have always returned the last element of the corresponding vector
in that situation.

WebKit can be build with WEBKITOUTPUTDIR env variable set using build-webkit script.
In this case WEBKITOUTPUDIR may be outside repository structure. This causes testmimehandling and testwebview
to fail because they use external test files in WebKit Source directory.
This bug fixes this issue introducing optional environment variable WEBKITREPODIR
Also coding style in existing functions is fixed.

tests/test_utils.c: Coding style fixes.

(testutils_relative_chdir): If WEBKITREPODIR is set, change current directory to it.

The histogramEnumeration() function isn't available from the Qt port's
PlatformBridge.h because this function is Chromium specific.
Since the ​http://trac.webkit.org/changeset/90830 change we need to
guard the usage of the histogramEnumeration() function.

Note: Tests under hybi/ directory (including the new ones) are skipped and cannot be enabled
yet, because pywebsocket does not accept requests from half-baked client implementation
(i.e. hybi handshake + hixie-76 framing). They will be unskipped when hybi framing is landed
in WebCore.

websockets/WebSocketHandshake.cpp:

Functions and members only used for hixie-76 handshake are renamed so that they are not confused
with hybi-10's ones.
(WebCore::generateHixie76SecWebSocketKey):
(WebCore::generateHixie76Key3):
(WebCore::generateHixie76ExpectedChallengeResponse):
(WebCore::generateSecWebSocketKey):
Generates a value for Sec-WebSocket-Key as stated in hybi-10.
(WebCore::getExpectedWebSocketAccept):
Calculates the expected value of Sec-WebSocket-Accept.
(WebCore::WebSocketHandshake::WebSocketHandshake):
(WebCore::WebSocketHandshake::clientHandshakeMessage):
(WebCore::WebSocketHandshake::clientHandshakeRequest):
(WebCore::WebSocketHandshake::readServerHandshake):
(WebCore::WebSocketHandshake::serverWebSocketAccept):
(WebCore::WebSocketHandshake::serverWebSocketExtensions):
(WebCore::WebSocketHandshake::checkResponseHeaders):

websockets/WebSocketHandshake.h:

LayoutTests:

Fix existing tests so they match the new handshake format, and add tests for new header fields.

There are several changes in the format of handshake response, such as:

Reason string in HTTP status line has been changed to "Switching Protocols".

The value of "Upgrade" header has been changed to "websocket" (lower-case only).

The value of Sec-WebSocket-Accept header is computed using compute_accept() function
located in mod_pywebsocket.handshake.hybi06 module. Although the module name contains
"hybi06", this function can be used to calculate the value of Sec-WebSocket-Accept header
for hybi-10 (calculation method has not been changed since hybi-06).

Note: Tests under hybi/ directory (including the new ones) are skipped and cannot be enabled
yet, because pywebsocket does not accept requests from half-baked client implementation
(i.e. hybi handshake + hixie-76 framing). They will be unskipped when hybi framing is landed
in WebCore.

http/tests/websocket/tests/handler_map.txt:

There must be only one handler that can handle requests to "/". hybi/echo-location_wsh.py
is modified to accept requests of both protocol versions.

Using Mock has caused us more pain than help.
It's possible that there was a cleaner way to use it
(maybe Mock(class) instead of inheriting from it?).
But for now, I've removed all uses of Mock from mocktool.py.

I also moved run_command into the only 3 files which call it
instead of leaving the deprecated method in executive.py.

(::-webkit-input-placeholder): Added. This contains properties
common in <input> and <textarea>. Some properties have !important
so that a stylesheet specified by a page author won't break
WebKit's assumption.
(input::-webkit-input-placeholder, isindex::-webkit-input-placeholder):

(WebCore::RenderTextControl::RenderTextControl):
Remove the 'placeholderVisible' argument.
(WebCore::RenderTextControl::layoutSpecialExcludedChild):
Excludes the placeholder renderer in order to avoid to secure a box for
the placeholder.

rendering/RenderTextControl.h:

Remove declarations of removed functions.

Update the RenderTextControl signature.

Add layoutSpecialExcludedChild().

rendering/RenderTextControlMultiLine.cpp:

(WebCore::RenderTextControlMultiLine::RenderTextControlMultiLine):
Remove the 'placeholderVisible' argument.
(WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild):
Laying out the placeholder box so that it has correct width and location.

rendering/RenderTextControlMultiLine.h:

Remove declarations of removed functions.

Update the RenderTextControlMultiLine signature.

Add layoutSpecialExcludedChild().

rendering/RenderTextControlSingleLine.cpp:

(WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
Remove the 'placeholderVisible' argument.
(WebCore::RenderTextControlSingleLine::layout):
Laying out the placeholder box so that it has correct width and location.

rendering/RenderTextControlSingleLine.h:

Remove declarations of removed functions.

Update the RenderTextControlSingleLine signature.

rendering/style/RenderStyleConstants.h: Remove INPUT_PLACEHOLDER.

LayoutTests:

Add some test cases, and update expectations because placeholders
have their renderers.

This hack was put in to prevent scripts from running in shadow SVG. This should never have
happened, but did because we didn't parse <script> tags in SVG properly. This was fixed inr88584, so the hack is no longer needed.

Adds a TiledLayerChromium class to handle the tiling logic shared by ContentLayerChromium and ImageLayerChromium
so that they can be siblings in the class hierarchy instead of children. Also adds a CCTiledLayerImpl to handle
the drawing responsibilities for tiled layers.

TiledLayerChromium maintains a tiler, tiling options, and calculates the tiling transform. Subclasses are
responsible for providing an appropriate texture updater implementation. CCTiledLayerImpl takes the tiler,
tiling transform and layer properties and draws the layer. Longer term it'd be better of the CCTiledLayerImpl
owned the tiler and the TiledLayerChromium only owned an updater, but getting there will require changing the
way tile eviction works.

Added code to both the Yarr interpreter and JIT to handle
these expressions a little differently. First off, the terms
in between the leading and trailing .*'s cannot capture and
also this enhancement is limited to single alternative expressions.
If an expression is of the right form with the aforementioned
restrictions, we process the inner terms and then look for the
beginning of the string and end of the string. There is handling
for multiline expressions to allow the beginning and end to be
right after and right before newlines.

This enhancement speeds up expressions of this type 12x on
a MacBookPro.

rendering/RenderObject.h: Removed a bit that was duplicated from RenderTableCell.

However it was not used in RenderObject and RenderTableCell already packed this bit.
We were lying in the number of used bits in RenderObject which was 33. This change
brings us back to what was advertised.

This implements unified support for prototype caching, prototype chain
caching, and polymorphic (i.e. list) prototype and prototype chain
caching. This is done by creating common code for emitting prototype
or chain access stubs, and having it factored out into
generateProtoChainAccessStub(). This function is called by
tryCacheGetByID once the latter determines that some form of prototype
access caching is necessary (i.e. the slot being accessed is not on the
base value but on some other object).

Direct prototype list, and prototype chain list, caching is implemented by
linking the slow path to operationGetByIdProtoBuildList(), which uses the
same helper function (generateProtoChainAccessStub()) as tryCacheGetByID.

This change required ensuring that the value in the scratchGPR field in
StructureStubInfo is preserved even after the stub info is in the
chain, or proto_list, states. Hence scratchGPR was moved out of the union
and into the top-level of StructureStubInfo.

We used to have growing arrays of hidden references associated
with objects. The entries in this array had no keys and were never
removed. This patch changes the interface to require a reference
name. This way it's harder to leak an unbounded number of
objects. Also it makes our wrapper objects one machine word
smaller.

(WebCore::ApplicationCacheGroup::didFinishLoading):
Replace m_loadedSize with estimatedSizeInStorage after we
add the new cached resource to the cache. The calculation
already happened so this check is fast.

(WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
When we start the Downloading phase, recalculate the quota
so that we have an up to date quota value so that we can
break early if needed.

Unify the delegate logging for reaching application cache
quotas. Truncate the space needed to the nearest 10000
for less flakey test output. This also better supports
printing NSUInteger on non-64 bit systems by casting to
an unsigned long.

The ES5 spec defines a concept of 'Direct Call to Eval' (see section 15.1.2.1.1), where
behaviour will differ from that of an indirect call (e.g. " { eval: window.eval }.eval();"
or "var a = eval; a();" are indirect calls), particularly in non-strict scopes variables
may be introduced into the caller's environment.

ES5 direct calls are any call where the callee function is provided by a reference, a base
of that Reference is an EnvironmentRecord (this corresponds to all productions
"PrimaryExpression: Identifier", see 10.2.2.1 GetIdentifierReference), and where the name
of the reference is "eval". This means any expression of the form "eval(...)", and that
calls the standard built in eval method from on the Global Object, is considered to be
direct.

In JavaScriptCore we are currently overly restrictive. We also check that the
EnvironmentRecord that is the base of the reference is the Declaractive Environment Record
at the root of the scope chain, corresponding to the Global Object - an "eval(..)" statement
that hits a var eval in a nested scope is not considered to be direct. This behaviour does
not emanate from the spec, and is incorrect.

Copy the Frame protector higher in the stack from loadWithDocumentLoader
to loadFrameRequest since any of loadPostRequest or loadURL can call
loadWithDocumentLoader, thereby dispatching the beforeload event and
blowing away the frame. This deleted frame will be later accessed in
the loadFrameRequest function causing a crash.

Forgot to modify getStringValue(), i was modifying only getStringValue(ExceptionCode&).

Test: fast/regions/content-webkit-from-flow-parsing.html (existing).

css/CSSPrimitiveValue.cpp:

(WebCore::CSSPrimitiveValue::getStringValue):

LayoutTests:

Correct the layout test for content:-webkit-from-flow parsing. Testing getComputedStyle values for content property
was not done properly, as "flow-name" was passed instead of "-webkit-from-flow:'flow-name'".

Rename updateContentsScale() to something less presumptuous; layers may choose
to do something other than update their contents scale when the page scale factor
changes. pageScaleFactorChanged() is a better name.

This patch introduces the results detail pane, which appears at the
bottom of the window and contains test results from the bots.
Currently, you can activate the pane by mousing over one of the builder
names associated with a failing test.

This is just a first iteration of the UI. There's no way to resize or
zoom in on elements of the details pane, and images likely aren't sized
correctly, but it's a place to start.

Scripts/webkitpy/tool/servers/data/gardeningserver/config.js:

Add constants for our data attributes so we don't typo them!

Scripts/webkitpy/tool/servers/data/gardeningserver/index.html:

Add DOM structure for the details pane.

Scripts/webkitpy/tool/servers/data/gardeningserver/main.css:

Scripts/webkitpy/tool/servers/data/gardeningserver/main.js:

Bind events for showing and hiding the details pane.

Scripts/webkitpy/tool/servers/data/gardeningserver/results.js:

Reduce the number of result types that we query for to avoid
overfilling the details pane. We'll probably need another
solution here in the long-term. For example, we could use tabs
to pack more results into the pane.

Make TestFailures show every time a possibly-flaky test failed, but hide it by default

It's useful to be able to see every time a flaky test failed to see whether it failed the
same way every time. But doing so takes a lot of space, so the list of failures is now
collapsed by default and can be revealed using a disclosure triangle.

Fixes <​http://webkit.org/b/64455> TestFailures page doesn't show as much information for
flaky tests as I would like, even though the page is already so long

(ViewController.prototype._displayBuilder): Pass the total number of builds analyzed to
_domForPossiblyFlakyTests.
(ViewController.prototype._domForPossiblyFlakyTests): Put a disclosure triangle to the left
of each test name, and the number of failures to the right. When the disclosure triangle is
clicked for the first time, we build up the list of failures and expand the element. After
that we just collapse or expand the element on subsequent clicks.

(Builder.prototype.getNumberOfFailingTests): Relaxed the "Exiting early" test not to require
it to be at the beginning of the line, since NRWT prints a bunch of junk earlier in the
line. Tightened up the regex that's used to parse the number of failing tests to require the
leading number to be followed by whitespace so that we won't parse the "2011" in
"2011-07-13" as a number of failures.

It causes a layout to happen and a progress signal to be emitted
since r90900, but at this point we don't have a
LayoutTestController object and we'll eventually crash. Since we
already grab focus at the beginning of runTest() this is
redundant, so get rid of it to fix the crash.

A TextRun is constructed for a portion of a string [a,b] whose original length is c (0 < a < b < c).
The TextRun charactersLength variable stores the length of the remaining text from (b..c) in order
to support ligatures in SVG Fonts. Example: <text>ffl</text>. When measuring the advance from char 0
to char 1 the whole 'ffl' text must be passed to the SVG glyph selection code, as the SVG Font may
define a single glyph for the characters 'ffl' thus leading to a single character long text
pointing to the ffl ligature, not three individual 'f' / 'f' / 'l' characters anymore.

constructTextRun(..const UChar*, int length, ..) did not correctly calculate the maximum length (b..c).
The passed in UChar buffer starts at eg. textRenderer->characters() + start(), and following condition
holds true for 'length': start() + length <= textRenderer->textLength() (which denotes the maximum length
of the textRenderer->characters() buffer). We have to keep track of the start() offset, so that we
can calculate the charactersLength for the TextRun correctly: textRenderer->textLength() - start().

There are also other cases like RenderCombinedText and/or the presence of hyphens that were incorrectly
tracked. Only InlineTextBox had to be fixed, the other callsites in eg. RenderBlockLineLayout already
computed the maximum length correctly - I assured this by valgrind runs on all SVG Font tests.

Moved indexForVisiblePosition from RenderTextControl to HTMLTextFormControlElement.

Also replaced the call to RenderTextControl::isSelectableElement by a call to enclosingTextFormControl
(moved from htmlediting to HTMLTextFormControlElement) because we are only interested in checking
whether the given position is inside the current text form control or not.

In addition, modernized the code in indexForVisiblePosition by calling parentAnchoredEquivalent on the
given position and replacing calls to deprecateNode and deprecatedEditingOffset by calls to containerNode
and offsetInContainer.

On some of my test cases, this method takes between 3 and 5% of the time spend.
The method makes 2 calls to virtual methods which could be moved to their overriden
version of containingBlock if we made it virtual.

That's what this patch does. It saves between 1 and 2% on some synthetic test cases
as well as made the current method shorter.

rendering/RenderObject.cpp:

(WebCore::RenderObject::containingBlock): Removed code for RenderView and RenderTableCell,
replaced by ASSERTs.

rendering/RenderObject.h: Made containingBlock virtual.

rendering/RenderTableCell.h:

(WebCore::RenderTableCell::containingBlock):

rendering/RenderView.h:

(WebCore::RenderView::containingBlock):
The code moved from RenderObject is inlined in those 2 methods.

This is a fixed implementation of op_construct. Constructor calls are implemented
by reusing almost all of the code for Call, with care taken to make sure that
where the are differences (like selecting different code blocks), those differences
are respected. The two fixes over the last patch are: (1) make sure the
CodeBlock::unlinkCalls respects differences between Call and Construct, and (2)
make sure that virtualFor() in DFGOperations respects the CodeSpecializationKind
(either CodeForCall or CodeForConstruct) when invoking the compiler.

Added a test for the DFG op_construct regression, where polymorphic constructor
calls will result in the code being compiled for call but then invoked as a
constructor. This test will fail if that part of the patch is omitted.

Make sure we don't trip any assertions when caching access
to an InternalFunction

fast/js/script-tests/method-check.js:

../../../../Volumes/Data/git/WebKit/OpenSource/Source/JavaScriptCore:

method_check is essentially just a value look up
optimisation, but it internally stores the value
as a JSFunction, even though it never relies on
this fact. Under GC validation however we end up
trying to enforce that assumption. The fix is
simply to store the value as a correct supertype.

Changes to ResourceHandle class to get it to compile with USE(CFNETWORK).

No new tests because no change in functionality and option is not enabled on Mac.

platform/network/ResourceHandle.h:

platform/network/ResourceHandleInternal.h:

platform/network/cf/ResourceHandleCFNet.cpp:

(WebCore::didReceiveResponse):
(WebCore::ResourceHandleInternal::~ResourceHandleInternal):
(WebCore::ResourceHandle::start):
(WebCore::WebCoreSynchronousLoaderClient::willSendRequest): Call adjustMIMETypeIfNecessary
on Mac. Also port over fix for <rdar://problem/6901522> added in r43993 which forces the
MIME type to text/html if the request is annotated with a "ForceHTMLMIMEType" property.

Adds a way to stash a GrContext* on a GraphicsContext3D. Previously, this was handled by
SharedGraphicsContext3D, but we don't need that class any more. This is used only for the shared
GraphicsContext3D stashed on the Page and shared by all accelerated canvases within the Page, for WebGL and
compositor contexts the GrContext is never set.

This patch computes a regression range for a failure by intersecting
the regression ranges seen by the various bots. We make the underlying
assumption that a test is only failing due to one revision at any given
moment. If that's not true, this code probably explodes.

The regression ranges appear asynchronously, which might be a jarring
UI. We'll have to experiment to see.

Added a flag to Heap that determines if it's safe to collect (which for now means that
JSGlobalObject has actually been initialized, but it should work for other things, too).
This allows JSGlobalObject to allocate even if the allocator wants to GC; instead of
GCing it just grows the heap, if necessary.

Then changed Heap::allocate() to not recurse ad infinitum when
COLLECT_ON_EVERY_ALLOCATION is set. This also makes the allocator generally more
resilient against bugs; this change allowed me to put in handy assertions, such as that
an allocation must succeed after either a collection or after a new block was added.

This patch enabled pixel test on the cr-linux-ews. Running a quick
test on the bots, it looks like we have five pixel failures, related to
some missing fonts. I've also made the bots skip failing tests to
avoid uploading huge zip files to bugs.webkit.org (with all the exected
IMAGE failures).

There was no need for FrameView::syncCompositingStateForThisFrame()
to call syncCompositingStateForThisLayerOnly() on the various
scrollbar-related layers, because the subsequent call to
compositor()->flushPendingLayerChanges() starts to flush at
m_overflowControlsHostLayer if one exists, and its an ancestor
of the scrollbar layers.

http/tests/appcache/resources/quota-origin-continued-download.manifest: Added.
New test which checks that there will still be a successful cache
when the per-origin quota is reached and increased at the end of downloading.

http/tests/appcache/resources/quota-origin-continued-download.manifest: Added.
New test which checks that the spaceNeeded appropriately lists enough space for
multiple manifests across multiple frames for the same origin.

New behavior of handling ApplicationCache per-origin quotas. Previously,
if the quota was reached while downloading we would fail the download
and then prompt the user for a storage increase. This required a refresh,
a redownload of resources, and the total storage was not known so the
process could be repeated multiple times before an acceptable quota
was found or the user disallowed an increase.

The new behavior is to complete the download of the entire appcache.
When the cache completes downloading and it is greater than the origin
quota, prompt the user to allow a quota increase with the known space
needed. If the quota is increased, the cache will succeed, otherwise
it will fail with the normal failure steps.

An alternative behavior is prompting while downloading immediately
when the origin quota is reached, however at that point the entire
space needed is unknown and so quota increases might not be enough
and could result in multiple prompts to the user.

loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::ApplicationCacheGroup):
Rename instance variable to be more clear on its intent.

(WebCore::ApplicationCacheGroup::didFinishLoading):
Check the quota limit while downloading so we can fail early
if the user already denied a quota increase.

(WebCore::ApplicationCacheGroup::didReachOriginQuota):
Pass the space needed information to the chrome client.

(WebCore::ApplicationCacheGroup::cacheUpdateFailedDueToOriginQuota):
Removed. Instead convert the callers to update state and console
log when the per-origin quota is reached. This allows us to follow
the normal failure steps if the quota is reached at the end of a
download, and the alternative short path when we fail during downloading.

(WebCore::ApplicationCacheGroup::recalculateAvailableSpaceInQuota):
Extract to a helper function.

(WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
Allow for a quota increase at the end of the download now that
we know the space needed. Then proceed to fail or succeed
as we normally would.

loader/appcache/ApplicationCacheStorage.h:

loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::checkOriginQuota):
(WebCore::ApplicationCacheStorage::storeNewestCache):
Extract checking the origin quota for when an ApplicationCacheGroup
will be replacing an ApplicationCacheGroup into a helper function.
The helper also provides an out parameter for the space needed
to properly fit the new cache group if it wouldn't fit.

Add layoutTestController.disallowIncreaseForApplicationCacheQuota()
to disable the default behavior of raising the default per-origin
quota to 5MB when reached. This allows us to test what happens
when the quota is reached and not increased.

DumpRenderTree/qt/LayoutTestControllerQt.h:
(LayoutTestController::disallowIncreaseForApplicationCacheQuota):
(LayoutTestController::dumpApplicationCacheDelegateCallbacks):
Expose a function to prevent automatically increasing the per-origin
quota when the quota is reached. This allows us to test what happens
when a user would "disallow" a quota increase.

doComposite was triggering two composites every time a canvas was dirtied.
By moving syncCompositingLayers call to layout, the client code can draw without triggering
a redundant frame. Also renamed WebViewImpl::updateLayers to
syncCompositingLayers, because it was confusing. CCLayerTreeHostImplProxy::updateLayers was
no longer needed, because animateAndLayout calls WebViewImpl::layout.

doComposite was triggering two composites every time a canvas was dirtied.
By moving syncCompositingLayers call to layout, the client code can draw without triggering
a redundant frame. Also renamed WebViewImpl::updateLayers to
syncCompositingLayers, because it was confusing.

Extracted HTMLTextFormControlElement.h and HTMLTextFormControlElement.cpp out of
HTMLFormControlElement.h and HTMLFormControlElement.cpp.

Also moved defaultEventHandler from HTMLFormControlElementWithState to HTMLTextFormControlElement
because it was specific to HTMLTextFormControlElement, and replaced all references to
HTMLFormControlElementWithState in HTMLInputElement and HTMLTextAreaElement by ones to
HTMLTextFormControlElement.

Adds a TiledLayerChromium class to handle the tiling logic shared by ContentLayerChromium and ImageLayerChromium
so that they can be siblings in the class hierarchy instead of children. Also adds a CCTiledLayerImpl to handle
the drawing responsibilities for tiled layers.

TiledLayerChromium maintains a tiler, tiling options, and calculates the tiling transform. Subclasses are
responsible for providing an appropriate texture updater implementation. CCTiledLayerImpl takes the tiler,
tiling transform and layer properties and draws the layer. Longer term it'd be better of the CCTiledLayerImpl
owned the tiler and the TiledLayerChromium only owned an updater, but getting there will require changing the
way tile eviction works.

This patch adds QtPinchGestureRecognizer to recognize pinch gesture out of
the events not handled by the WebProcess.

TouchViewInterface::pinchGestureRequestScale() has a basic default implementation
so the feature can be tested manually.

UIProcess/qt/QtGestureRecognizer.cpp:

QtGestureRecognizer is the private base class for both gesture recognizer
in order to be able to share some code.
(WebKit::QtGestureRecognizer::QtGestureRecognizer):
(WebKit::QtGestureRecognizer::reset):

(WebKit::TouchViewInterface::TouchViewInterface):
(WebKit::TouchViewInterface::pinchGestureStarted):
(WebKit::TouchViewInterface::pinchGestureRequestScale):
The scale factor reported by the recognizer to the TouchViewInterface is the total scale since the start
of the gesture in order to avoid numerical instabilities.
(WebKit::TouchViewInterface::pinchGestureEnded):

When the web process is unavailable, the reload and stop actions should
behave slightly differently. Stop should always be disabled, and reload
should be enabled if there's a reloadable item in the back/forward list.

Factor out the didReceiveDataArray code from ResourceHandleMac.mm into
a new method ResourceHandle::handleDataArray(). Implement the callback
in the CFNetwork loader code and call handleDataArray() to process
incoming data.

(WebCore::ceiledLayoutUnit):
Add ceiledLayoutUnit to go with the floored version.

rendering/RenderBlock.cpp:

(WebCore::RenderBlock::adjustRectForColumns):
(WebCore::RenderBlock::flipForWritingModeIncludingColumns):
(WebCore::RenderBlock::adjustStartEdgeForWritingModeIncludingColumns):
Rename rect version of flipForWritingModeIncludingColumns to
adjustStartEdgeForWritingModeIncludingColumns as it adjust the start edge
and does not flip the rect.

To fix this I implemented Port.show_results_html_file in Mac, Gtk and Qt ports with
implementations (mostly) matching those found in old-run-webkit-tests.
There are still some minor differences for Qt which Qt hackers may wish to tweak.

I had to add a WebKitPort._port_flag_for_scripts method (similar to flag() in common.config.ports.py)
for the Qt/Gtk ports which always require a flag passed to scripts.

While trying to test this, I found that FactoryTest.test_chromium_gpu_linux
was using a real filesystem (due to assert_platform) which due to
global variables in config.py was causing set-webkit-configuration to have
an affect on unit test results! So I fixed this by making FactoryTest.assert_port
pass a mock file system whenever calling factory.get.

Unfortunately TestPort was depending on always being passed a None filesystem
and asserting filesystem._tests (only true for unit_test_filesystem()).
So I just removed the FactoryTest.test_test and FactoryTest.test_dryrun tests
deciding that they were pretty much useless anyway. If others feel strongly
I'm happy to fix this in a different way.

Scripts/webkitpy/common/system/executive.py:

default arguments in python are screwy. They use a single shared
instance, so it's better to use argument=None and then argument = argument or Default()
if you have any chance of mutating (or returning) the default argument.

Scripts/webkitpy/layout_tests/port/config.py:

This code is wrong. We don't need to use a global variable here (as far as I can tell).
I'm not fixing it in this patch, but I've marked it with a FIXME and we can convert to
storing the results of the read on the Config object (which should only be created once during normal operation).
Unit tests shouldn't be hitting the disk anyway. It's possible Config should move off of Port and onto Tool/Host directly.

(Builder.prototype.getNumberOfFailingTests): If run-webkit-tests exited with a non-zero
exit status but we didn't find any failure counts, assume that there was some error that
caused run-webkit-tests to die early (like being killed by buildbot due to a timeout).

The underlying problem here is that full_results.json doesn't have
enough information to determine whether a given test result was
expected because whether an actual result is expected depends on
whether full_results.json was generated duing a test run that included
pixel tests.

The right long-term solution is to make full_results.json a complete
description of what happened durning a test run. In this patch
however, to stop the spam, this patch makes the jsonresultsparser
ignore pixel failures.

(I'm landing this patch unreviewed in order to stop the bots from
spamming. I'll happily address any review comments in a follow-up
patch.)

Added a license header, enclosed everything in a closure to avoid polluting the global
namespace, changed the test name to actually describe the passing condition, and replaced
uses of equals() with equal(). (The latter is the actual name of the function, and matches
deepEqual, etc.)

(NewBugForm): This class knows how to construct a <form> used for filing new bugs in
Bugzilla based on some parameters.
(NewBugForm.prototype.domElement): Creates and returns the <form> element. Code came from
ViewController.prototype._domForNewAndExistingBugs.

(TestFailureBugForm): This class knows how to construct a <form> element used for filing new
bugs specifically about test failures. Code came from
ViewController.prototype._domForNewAndExistingBugs.
(TestFailureBugForm.prototype.domElement): Slightly customizes the <form> element returned
by NewBugForm.
(TestFailureBugForm.prototype._computeOperatingSystem):
(TestFailureBugForm.prototype._computePlatform):
(TestFailureBugForm.prototype._createBugTitle):
(TestFailureBugForm.prototype._failingResultsHTMLURL):
(TestFailureBugForm.prototype._failingRevision):
(TestFailureBugForm.prototype._passingRevision):
(TestFailureBugForm.prototype._regressionRangeString):
Code came from ViewController.prototype._domForNewAndExistingBugs. I broke it out into
separate functions to break up the rat's nest a bit.

(WTF::StringTypeAdapter<String>::writeTo): Added a macro that can be used for testing how
many WTF::Strings get copied while evaluating an operator+ expression.

wtf/text/StringOperators.h:

(WTF::operator+): Changed the overload that takes a StringAppend to take it on the left-hand
side, since operator+ is left-associative. Having the StringAppend on the right-hand side
was causing us to make intermediate WTF::Strings when evaluating expressions that contained
multiple calls to operator+. Added some more overloads for that take a left-hand side of
const char* to resolve overload ambiguity for certain expressions. Added overloads that take
a left-hand side of const UChar* (matching the const char* overloads) so that wide string
literals don't first have to be converted to a WTF::String in operator+ expressions.

Source/WebKit2:

Export some symbols needed by TestWebKitAPI

win/WebKit2.def:

Tools:

Test that no intermediate WTF::Strings are created when concatenating with string literals

TestWebKitAPI/Tests/WTF/StringOperators.cpp: Added.

(TestWebKitAPI::TEST): Test that a bunch of different string concatenation expressions don't
create any intermediate WTF::Strings while they're being evaluated.

This is more fall-out from the Port class inappropriately encapsulating
both platform and port knowledge. We need to split out some of this
platform knowledge into a separate class which can be better shared
between ports.

The fix was to move all the _path_to_apache_config_file logic down
into the WebKitPort baseclass so that all of the ports can find the
right apache config file, regardless of what platform they may be running on.

I did not move this down into base.Port (even though I considered it).
Chromium duplicates some of this logic, but since they have separate
subclasses for each port-OS combination (e.g. ChromiumMac, ChromiumWin)
they wouldn't notice the change. Eventually we'll move this logic
out of Port entirely, and then it will be shared by all ports.

I also cleaned up the http-config logic for ORWT while I was there,
although since we're killing that code, I'm happy to revert that part
of the change if changing it is viewed as needlessly risky.

During this cleanup, I noticed that no ports use the "default" httpd.conf
which is left over from Mac OS X Tiger (and old linux distros) which used
Apache 1.3. I've removed httpd.conf (and associated support in ORWT) since
we no longer support any ports which use this httpd.conf.

Scripts/webkitperl/httpd.pm:

(getHTTPDConfigPathForTestDirectory):

Scripts/webkitpy/layout_tests/port/base.py:

Scripts/webkitpy/layout_tests/port/gtk.py:

Scripts/webkitpy/layout_tests/port/mac.py:

Scripts/webkitpy/layout_tests/port/qt.py:

Scripts/webkitpy/layout_tests/port/webkit.py:

Scripts/webkitpy/layout_tests/port/webkit_unittest.py:

Scripts/webkitpy/layout_tests/port/win.py:

Scripts/webkitpy/layout_tests/servers/apache_http_server.py:

LayoutTests:

Removed this old httpd.conf file (used by Tiger and old linux distros)
since no supported WebKit ports use it anymore.

This change implements layoutTextController.setTextDirection for WebKit2
and Windows so we can run a layout test added by r87770 on them. Each
implementation adds a wrapper function for Editor::setBaseWritingDirection()
so LayoutTestController can call it.

Source/WebKit/win:

Interfaces/IWebFramePrivate.idl: Added setTextDirection to allow

LayoutTestController to change the text direction.

WebFrame.cpp: ditto.

(WebFrame::setTextDirection):

WebFrame.h: ditto.

Source/WebKit2:

WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: Added

WKBundleFrameSetTextDirection to allow LayoutTestController to change the
text direction.
(WKBundleFrameSetTextDirection):

There are two ways to indicate the length of a frame in hixie-76 protocol, but
hybi-10 has only one method (length-prefixed frames). Skipping unwanted frames will
be covered by other tests that will be added in a later patch.

The bug was caused by positionForPointRespectingEditingBoundaries's not taking relativePositionOffset
into account when computing the point in child coordinates. Fixed the bug by adding the offset to
childLocation as needed.

Miscellaneous linting fixes. The most notable change is that
we add public attributes for user, executive, filesystem, and
options on the Port object, so we don't have to refer to the
"protected" versions all over the place".

The test expectations files either had documentation for the
Chromium port's version of the file (which was also incorrect),
or were undocumented. This adds a comment with a link to the
documentation for the file to each.

The assertion in ResourceHandle::setDefersLoading assumes asynchronous
content delivery -- To resume a page, first, its main resource loader
calls setDefersLoading to resume loading the main content; then all the
sub-resource loaders calls setDefersLoading to resume sub-contents.
However, since QNetworkReplyHandler delivers content synchronously,
some new sub-resource loaders get created as soon as the main resource
loader resumed, and all these new sub-resource loaders set their
defersLoading flag to false. Then, the assertion fails for these new
sub-resource loaders when calling setDefersLoading on them. As a fix,
this path makes QNetworkReplyHandler deliver content asynchronously.

Test: loader/load-defer-resume-crash.html

platform/network/qt/QNetworkReplyHandler.cpp:

(WebCore::QNetworkReplyHandlerCallQueue::setDeferSignals):

platform/network/qt/QNetworkReplyHandler.h:

LayoutTests:

Added a test for the crash occurs when load deferring is turned off.

Reviewed by Benjamin Poulain.

loader/load-defer-resume-crash-expected.txt: Added.

loader/load-defer-resume-crash.html: Added.

loader/resources/images.html: Added.

platform/chromium/test_expectations.txt: Skip this test since the LayoutTestController::setDefersLoading is not implemented for chromium.

Moved innerTextElement from RenderTextControl to HTMLTextFormControlElement. It is implemented by
HTMLInputElement and HTMLTextAreaElement instead of RenderTextControlSingleLine and
RenderTextControlMultiLine.

This refactoring removes the indirection through RenderTextControl and makes the ownership of
shadow DOM for input and textarea elements clear. Accessing the shadow DOM of input and textarea elements
are now less error prone because it no longer depends on the lifetime of the render tree.

This is to make way for the new flexbox needing a similar method.
RenderObject also has isFlexingChildren() and isStretchingChildren(),
but we may be able to use those for the new flexbox as well so I
didn't rename them.

Walking the failure history looking for failures turns out to be
slightly tricky because the network requests are asynchronous.
Currently we do all the fetches serially and our cache is unbounded.
We'll probably optimize both those parameters eventually.

This patch also generalizes some functionality in the unit testing
framework to make testing this sort of code easier.

This patch introduces a command that's able to rebaseline a single
test. Currently, the command works only with the build.chromium.org
buildbots, but extending it to work with the build.webkit.org bots
shouldn't be that hard.

A complete rebaseling tool should also include an "optimize baselines"
command (which moves/deletes baselines in order to reduce the number of
expected results files), but that will come in a future patch.

Really BuilderToPort should be merged into builders.py, but I'm going
to save that for a future patch as well. (We need to stop shaving yaks
at some point.)

Changed the SetLocal instruction to always validate that the value being stored
into the local variable is an array, if that variable was marked PredictArray.
This is necessary since uses of arrays assume that if a PredictArray value is
in a local variable then the speculation check validating that the value is an
array was already performed.

No new tests. fixes canvas/philip/tests/2d.gradient.object.update.html

Remove (now empty) platform helpers for fill/stroke gradients/patterns. We now pickup the platformGradient
and platformPattern fresh when they're needed, so we can see any edits that have occurred to them
2d.gradient.object.update.html sets the fillgradient, and then edits the gradient object. This CL allows
us to see that edit.

(WebCore::HTMLTextFormControlElement::selectedText): Extracted from AccessibilityRenderObject::selectedText.
(WebCore::hasVisibleTextArea): Added.
(WebCore::HTMLTextFormControlElement::setSelectionRange): Merged with the function of the same name in RenderTextControl.
(WebCore::HTMLTextFormControlElement::selectionStart): Calls computeSelectionStart instead of RenderTextControl::selectionStart.
(WebCore::HTMLTextFormControlElement::computeSelectionStart): Moved from RenderTextControl::selectionStart.
(WebCore::HTMLTextFormControlElement::selectionEnd): Calls computeSelectionEnd instead of RenderText::selectionEnd.
(WebCore::HTMLTextFormControlElement::computeSelectionEnd): Moved from RenderTextControl::selectionStart.
(WebCore::setContainerAndOffsetForRange): Moved from RenderTextControl.cpp.
(WebCore::HTMLTextFormControlElement::selection): Merged with the function of the same name in RenderTextControl.
(WebCore::HTMLTextFormControlElement::restoreCachedSelection): Calls computeSelectionStart and computeSelectionEnd instead of
RenderTextControl::selectionStart and RenderTextControl::selectionEnd.
(WebCore::HTMLTextFormControlElement::selectionChanged): Calls selectionStart and selectionEnd.

html/HTMLFormControlElement.h:

html/HTMLInputElement.cpp:

(WebCore::HTMLInputElement::setValue): Calls setSelectionRange.

rendering/RenderTextControl.cpp:

(WebCore::RenderTextControl::textFormControlElement): Added.

rendering/RenderTextControl.h:

Source/WebKit/qt:

Replaced calls to WebCore::setSelectionRange by calls to HTMLTextFormControlElement::setSelectionRange.

Shared/WebNavigationDataStore.h:
(WebKit::WebNavigationDataStore::encode): Handle the encoding of the original request.
(WebKit::WebNavigationDataStore::decode): Handle the decoding of the original request.

(WebCore::CanvasRenderingContext2D::stroke): Instead of using
Path::strokeBoundingRect() to calculate the exact bounding rect
for a path stroke, get the Path::boundingRect() and inflate it by
miterLimit + lineWidth to get a slightly oversized dirty rect
in a fraction of the time.

This patch refactors the way the viewport visible area is handled.
Previously, the TiledDrawingAreaProxy would ask for the visible rect
when painting or updating. This is reversed with this patch, and the viewport
informs the page of any change in the view area.

With this change, the TiledDrawingAreaProxy does not need to know about QTouchWebPage,
and can use the TouchViewInterface directly.

Teach TestFailures that ORWT's results.html file might be missing due to all tests passing

There are three reasons why we might fail to fetch ORWT's results.html:

All tests passed, so no results.html was generated

Some error during the test run caused results.html not to be generated (e.g., ORWT
timed out)

Some network error occurred when fetching results.html

We were failing to account for the first possibility in some cases. For test runs beforer89610, we first check build.webkit.org/json to determine how many tests failed and whether
ORWT exited early due to too many failures; if all tests passed then we don't fetch
results.html at all. r89610 changed ORWT to put information in results.html about exiting
early due to too many failures, so we no longer needed to check build.webkit.org/json to get
that information, and in r89619 I changed TestFailures to do just that. But I forgot that we
still needed to check build.webkit.org/json to find out if all tests passed!

Now, for test runs after r89610, we check results.html first, and then check
build.webkit.org/json if we fail to fetch results.html. This lets us distinguish between all
tests passing and the error cases.

(LayoutTestResultsLoader.prototype.start): Bumped the cache version so that old, buggy
cached data will get evicted. We were marking builds where all tests passed as errors!
(LayoutTestResultsLoader.prototype._fetchAndParseORWTResults): Added success/error callback
parameters to the fetchAndParseResultsHTML helper function, and added a similar
fetchNumberOfFailingTests function that fetches data from build.webkit.org/json (code came
from later in the function). For test runs before r89610, we first check
build.webkit.org/json then check results.html. For builds after r89610, we first check
results.html and then check build.webkit.org/json if we couldn't fetch results.html.

Deleting these results caused the tests to start failing on the bots. The only test result I
didn't add back was
win-wk2/http/tests/uri/username-with-no-hostname-expected.txt, as that test is not currently
failing on the bots.