Fixes a bug where two consecutive lists are not merged if they have been converted
from ordered/unordered lists inside another list.

The bug was caused by InsertListCommand::doApply where it did not merge a newly inserted
list element and its neighbors. This patch adds code to doApply so that after inserting
the list element, it updates previousList and nextList to the outermost list elements around
insertionPos under the same enclosing list. Because the next and the previous list elements
are not necessarily visually next to the newly inserted element before moveParagraph moves
the paragraph into the new list element, doApply merges lists after moveParagraph is called.

editing/TextIterator.cpp: TextIterator can use RenderText::textWithoutTranscoding and now plainText() uses this version
(WebCore::TextIterator::TextIterator):
(WebCore::TextIterator::init):
(WebCore::TextIterator::emitText):
(WebCore::plainTextToMallocAllocatedBuffer):

This patch to new-run-webkit-tests adds a --log 'trace' option
that prints out detailed info about a given test as it executes
(where the baselines are, what the expectation is, what we got,
how long it took).

The implementation of StringImpl & UStringImpl is very similar. Restructure
StringImpl to match UStringImpl, moving the flags and length into a base class,
so that this can be shared between both string types to increase code reuse.

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.

Use a python script to automatically generate character tables
for the builtin YARR character classes. This allows us to generate
actual tables as well, by using these tables we can both increase
performance of the check (for complex builtins) and reduce the actual
code size.

4-8% win on string-unpack-code, but lots of noise on other tests so
i'm only confident saying its a 1% win overall.

(WebCore::UserContentURLPattern::parse): Use equalIgnoringCase when comparing for "file" schemes.
(WebCore::UserContentURLPattern::matches): Use equalIgnoringCase when comparing schemes. Only call
matchesHost if the scheme isn't "file".
(WebCore::UserContentURLPattern::matchesHost): Call equalIgnoringCase when comparing hosts. The endsWith
was already doing a case-insensitive compare, so existing tests worked though this path.

Added a setting to enable/disable media per-page and have the SVGImage
disable media for its dummy page. Also found and fixed a related bad
cast in the V8 bindings (JSC had a custom wrapper for this already).

In updateFocusCandidateIfCloser method, we do all bail out checks in the begining of
the method body. If after those bail out checks, no "best FocusCandidate" has been taken
yet (i.e. focusCandidate.isNull() == true), we can safely take the current candidate,
and exit earlier.

First step: if an iframe's document goes into compositing mode, also throw the parent
document into compositing mode (all the way up to the root). This is required both
to preserve layering (since parent document content can obscure iframe content),
and so that we can eventually hook the layer trees together.

Test: compositing/iframes/composited-iframe.html

rendering/RenderIFrame.h:

rendering/RenderIFrame.cpp:
(WebCore::RenderIFrame::requiresLayer): In order to make an iframe composited, it also has to have
a RenderLayer, so must return |true| from requiresLayer().
(WebCore::RenderIFrame::requiresAcceleratedCompositing): Returns true if the content document
is in compositing mode.
(WebCore::RenderIFrame::isRenderIFrame): Required so that RenderLayerCompositor can check
if a renderer is an iframe.
(WebCore::toRenderIFrame): Required so that RenderLayerCompositor can cast to a RenderIFrame.

rendering/RenderLayerCompositor.h:

rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::enableCompositingMode): Call out to the RenderView when
the compositing mode changes, so that the parent document can update its compositing status.
(WebCore::RenderLayerCompositor::requiresCompositingLayer): Call requiresCompositingForIFrame().
(WebCore::RenderLayerCompositor::requiresCompositingForIFrame): Check to see if the iframe
wants to be composited.

I fixed the queue to not ignore Tor as a reviwer in r57531,
but instead it throws an exception every time his name is in a patch.

This fixes our Executive.run_command code to work around a Popen
bug ​http://bugs.python.org/issue5290 whereby python versions before 2.6
do not correctly handle unicode objects as input or output to
Popen.communicate.

Following the advice of:​http://farmdev.com/talks/unicode/
I'm attempting to take the python unicode plunge and use unicode()
objects as strings instead of str() objects everywhere in webkitpy.

We do not have to use u"" instead of "" because u"a" == "a" as expected
in Python. Python will generate a warning to the console in cases where
a unicode() == str() operation cannot be performed.

I also cleaned up the input handling in run_command a little by adding
a new _compute_input() method which can return early instead of having
such a long/cluttered if-block.

Executive.run* now correctly accept and return unicode() objects.
I attempted to fix all the places that we call .write() to make sure we
encode any unicode() objects into utf-8.

All places which use StringIO need to be sure to pass StringIO a
pre-encoded byte-array (str object) instead of unicode so that
clients which read from the StringIO don't have encoding exceptions.
To make this easier, I removed the patch_file_object support from
add_patch_to_bug, and changed the 4 places which previously used
StringIO to create a fake patch file.

I attempted to document any places where we are not correctly converting
to/from bytes (str() objects) to strings (unicode() objects).

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

Read/write utf-8 files instead of ascii.

Update the tests to use test for proper unicode() handling.

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

Use unicode() strings instead of str() byte arrays.

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

Remove use of str().

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

Read/write utf-8 files and use unicode() strings in testing.

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

Use \u instead of \x to make slightly clearer what we're doing.

Scripts/webkitpy/common/net/bugzilla.py:

Add a new _string_contents() method and explain why
we have to call unicode() on the result of soup.string
and why it's safe to do so w/o needing to pass a codec name.

Remove the (unused) support for passing a file object to add_patch_to_bug().

Scripts/webkitpy/common/net/buildbot.py:

Use unicode() instead of str() when needing to coax a
NavigableString object into a unicode() object.

Move these classes up to WTF so they are available to all clients of WTF (in
particular JSC).

As a first patch, making the most minimal change possible, since this patch
could easily grow rather large since we'll have to change every class forward
declaration ( e.g. every "namespace WebCore { class String; }" much change to
"namespace WTF { class String; }").

Change PassRefPtr<FileChooser> parameter of chooseIconForFiles()
to FileChooser*. Though an implementation of chooseIconForFiles()
might have ownership of the FileChooser instance, we don't need to
use PassRefPtr<> in this case.

WebCoreSupport/PasteboardHelperGtk.cpp: Moved most of the code to WebCore.
(WebKit::PasteboardHelperGtk::PasteboardHelperGtk): This constructor just initializes the target list.
(WebKit::PasteboardHelperGtk::~PasteboardHelperGtk): The destructor no longer needs to free the target list.
(WebKit::PasteboardHelperGtk::getIdForTargetType): Added, virtual method for getting target ids.
(WebKit::PasteboardHelperGtk::usePrimarySelectionClipboard): Added, virtual method for querying current clipboard.

RenderPartObject is a useless intermediate class between RenderPart and
RenderEmbeddedObject, and we can now remove it. Its only method, viewCleared(),
applies to objects and embeds when the content is a FrameView, so can move
to RenderEmbeddedObject.

SVGAnimateElement::resetToBaseValue reset 'm_propertyType' in the process of animation.
This will cause problems when attributes 'fill' and 'stroke' have the value 'none', because in this case
the property type determined by base value may be different from the one determined by 'fromTo' values.

No new tests. The test suite in svg/animation is not working for target element with attribute 'fill' set to 'none'.
Now animateColor on target element with attributes 'fill' and 'stroke' set to 'none' is possible.

This patch adds a renderer for SVGFilterElement. SVGFilterElement is now independent
from the SVGResources.
A clean-up solves the dependencies between SVGFilterElement, the filter primitives
and SVGResources. This shall make the filter code more readable and better maintable.
The Filter primitives get dumped now, as long as they have externalRepresentation
implemented.

This patch adds a renderer for SVGFilterElement. SVGFilterElement is now independent
from the SVGResources.
A clean-up solves the dependencies between SVGFilterElement, the filter primitives
and SVGResources. This shall make the filter code more readable and better maintable.
The Filter primitives get dumped now, as long as they have externalRepresentation
implemented.

[Qt] GraphicsLayer: support fill-modes​https://bugs.webkit.org/show_bug.cgi?id=36216
Implement the CSS-animation "fill mode" concept in GraphicsLayerQt. The concept
enables a key-frame animation to go to the animation's starting point before the delay,
and/or to stay at the animation's ending point after its ended, without reverting to the default
value.
We do that by manually setting the value to keyframe-0 before the delay if fill-mode is backwards/both,
and manually modifying the default value to the animated value as we animate, with fill-mode forwards/both.

Add a new renderer for iframes, named RenderIFrame. Add a new shared base class
between this and RenderFrame, called RenderFrameBase (following the existing HTMLFrameElementBase),
and move code from RenderPart and RenderPartObject into these new classes.

There should be no functionality difference with this change, so no new tests.

Fixing up renderer names in the layout tests will be done in a later pass.

new-run-webkit-tests - repurpose the "Passing" port as "Dryrun" port
that can be used to test platforms other than the one you are running
on. This can be useful for checking baselines and testing code
coverage.

Note that running the code on the "wrong" port requires each
port-specific implementation to actually not require any
platform-specific python code (e.g., the chromium-win port must
test for the existence of windows functions before calling them).

It adds methods to IWebFrameLoadDelegatePrivate2, a delegate interface that is implemented
by shipping clients of WebKit on Windows. Adding methods to a delegate interface in this
manner breaks ABI compatibility and leads to crashes or other unexpected behavior when the
methods are used.

new-run-webkit-tests: add a way (--print-unexpected-results) to
(re-)print out the tests that produced unexpected results in the
last run. Also add a way (--retry-unexpected-results) to
automatically re-test them.

The desired behavior is that chromium-win use one set of baselines and
chromium-mac/chromium-linux use another, however to do we have to
duplicate the mac+linux results into chromium-mac and chromium-linux.

new-run-webkit-tests: add 'summary' and 'unexpected-results' options
to the --log flag. Also add a 'progress' flag to enable the regular
progress bar (as opposed to 'detailed-progress', which enables the
dots). Also add a 'nothing' flag to allow you to be explicit that
you don't want any logging on the command line.

The default is
'--log detailed-progress,summary,unexpected,unexpected-results'

(The default logging is unchanged by this patch, this just makes things
properly configurable).

Note that 'nothing' doesn't work properly yet; I need a couple other
patches to land to avoid rewriting things several different ways.

Changes the logic of appending/inserting document fragment to first stashing all of its children
to a vector, then processing the vector. This avoids ghastliness that would be caused by mutation
events mucking with the document fragment while it's being appended/inserted.

Test: fast/dom/Node/fragment-mutation.html

dom/ContainerNode.cpp:

(WebCore::targetNodes): Added method to populate a vector of nodes (targets) to be used in

Fix breakage of chromium-win canary bots caused by r57806. That patch
introduced the option of using Chrome's new port of DumpRenderTree,
but unfortunately that port relies on the webkit.py class
implementation which uses non-blocking I/O that isn't available on
Windows. This patch turns off that option and doesn't import the
class if we're running on Windows.

html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadNextSourceChild): Create a new MediaPlayer instead of
just setting a URL on the one used for the previous <source> element. This restores
the behavior prior to the changes for ​https://bugs.webkit.org/show_bug.cgi?id=37728.

(WebCore::AtomicStringTable::create):
(WebCore::AtomicStringTable::table):
(WebCore::AtomicStringTable::destroy):
(WebCore::stringTable): Access the AtomicStringTable on wtfThreadData() rather then threadGlobalData().

WebCore: Added notification when the favicons for a page are changed
from a script.
The Document object will notify the frame loader, which will
notify the client. Implementations of FrameLoaderClient will
have to add one method; dispatchDidChangeIcons().

WebKit/chromium: Added notification when the favicons for a page are changed
from a script.
The Document object will notify the frame loader, which will
notify the client. Implementations of FrameLoaderClient will
have to add one method; dispatchDidChangeIcons().

WebKit/gtk: Added notification when the favicons for a page are changed
from a script.
The Document object will notify the frame loader, which will
notify the client. Implementations of FrameLoaderClient will
have to add one method; dispatchDidChangeIcons().

WebKit/mac: Added notification when the favicons for a page are changed
from a script.
The Document object will notify the frame loader, which will
notify the client. Implementations of FrameLoaderClient will
have to add one method; dispatchDidChangeIcons().

WebKit/qt: Added notification when the favicons for a page are changed
from a script.
The Document object will notify the frame loader, which will
notify the client. Implementations of FrameLoaderClient will
have to add one method; dispatchDidChangeIcons().

WebKit/win: Added notification when the favicons for a page are changed
from a script.
The Document object will notify the frame loader, which will
notify the client. Implementations of FrameLoaderClient will
have to add one method; dispatchDidChangeIcons().

WebCore: ​https://bugs.webkit.org/show_bug.cgi?id=37717
Allow clients concerned with memory consumption to set a quota on session storage
since the memory used won't be released until the Page is destroyed.
The default is noQuota, which matches the current behavior.

html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::attributeChanged): Schedule load every time 'src' attribute
changes unless it is missing.
(WebCore::HTMLMediaElement::prepareForLoad): Include steps 3 to 6 from loadInternal.
(WebCore::HTMLMediaElement::loadInternal): Steps 3 to 6 are now in prepareForLoad.
(WebCore::HTMLMediaElement::loadResource): MediaPlayer is now allocated in prepareForLoad
so the previously loading file, if any, is cancelled there.

To avoid unsafe situations caused by running WebCore code (through firing timers) when destruction of QCoreApplication
has been started, we should explicitly destroy the SharedTimerQt instance on application exit.
We can achieve that through installing a self-destroying slot for the QCoreApplication::aboutToQuit() signal
into the SharedTimerQt instance.

Web Inspector: implement JavaScriptCallFrame that works for v8.
Implementing this binding for v8 allows to make evaluations on
call frames and protects access to the debugger context from
inspected context.

Allows access to the computed styles for the pseudo-elements through the second argument to getComputedStyle.
This approach does not provide the correct values for 'length' properties and does not work for the ':selection' pseudo-element and will instead return results similiar to those returned by Firefox. This approach also requires waiting until at least one iteration of a hardware accelerated composited animation to return the correct values for the "opacity" and "transform" properties of a pseudo-element associated with the element being animated.
Those values need to be retrieved from the renderer for the pseudo-element as opposed to the cached RenderStyle for the element on which the pseudo-element is defined, which is further complicated by the fact that not all elements have renderers.

(WebCore::CSSComputedStyleDeclaration::CSSComputedStyleDeclaration):
Parse the and store the pseudo-element specifier from the string provided by the user.
(WebCore::CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword):
Get the computed style for the pseudo-element if it has been specified.
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
Get the computed style for the pseudo-element if it has been specified, with a FIXME noting that the values returned for the "opacity" and "transform" properties of a pseudo-element associated with an element being animated and using hardware accelerated compositing will not be correct until after the first iteration of the animation.
(WebCore::CSSComputedStyleDeclaration::length):
Get the computed style for the pseudo-element if it has been specified.
(WebCore::CSSComputedStyleDeclaration::cssPropertyMatches):
Ditto.

css/CSSComputedStyleDeclaration.h:

(WebCore::computedStyle):
Take into consideration the pseudo-element.

css/CSSSelector.cpp:

(WebCore::CSSSelector::pseudoId):
Return the PseudoId that corresponds to the given PseudoType. If there is no corresponding PseudoId, returns NOPSEUDO.
(WebCore::nameToPseudoTypeMap):
Create and return the mapping between string names and PseudoTypes.
(WebCore::CSSSelector::parsePseudoType):
Parse and the given string into a PseudoType.
(WebCore::CSSSelector::extractPseudoType):
Refactored to use parsePseudoType.

css/CSSSelector.h:

css/CSSStyleSelector.cpp:

(WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
Refactored to use pseudoId.

dom/Element.cpp:

(WebCore::Element::computedStyle):
If the pseudo-element is specified, then return the cached RenderStyle for that PseudoId. Added a FIXME to find the actual renders of the pseudo-elements instead of just the cached RenderStyle of the RenderStyle for the associated element.

dom/Element.h:

(WebCore::Element::virtualComputedStyle):
Because Element::computedStyle is used so often, don't make it virtual. Instead, provide a virtualComputedStyle method in the Node.h class andmake computedStyle non-virtual. That way the Element version and the Node version of computedStyle will have the same name and look the same at the call site, but the Element version will be more efficient.

dom/Node.h:

(WebCore::Node::computedStyle):
Ditto.

dom/Node.cpp:

(WebCore::Node::virtualComputedStyle):
Get the computed style for the pseudo-element if it has been specified.

Removed search_limit, which wasn't very useful anyway.
Added a log about the long load time loading from the builders.
Prompt the user for what revision to start walking from (makes it easy to restart upon failure).

This revision is an intermediate step towards separating our
style-checking code from the logic of iterating over files and
reading them.

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

Added a logMessages() method to the LoggingTestCase class.
This method provides unit tests with access to the raw list
of log messages in case the tester needs to do something more
than simply assert the list of existing messages.

Scripts/webkitpy/style/checker.py:

Added a ProcessorBase class that processors of lists of lines
should eventually inherit from.

Also added a FIXME to use the ProcessorBase class and the
TextFileReader class added below.

Scripts/webkitpy/style/filereader.py: Added.

Created a TextFileReader class that encapsulates reading
and iterating over text files.

Scripts/webkitpy/style/filereader_unittest.py: Added.

Added a TextFileReaderTest class to unit-test the
new TextFileReader class.

bindings/scripts/CodeGeneratorJS.pm: Use global object as a wrapper for window event
listeners set via document.body. The body wrapper can go away if nothing else references it.

html/HTMLBodyElement.idl: Override listeners that exist on Element with custom implementations,
because we need to use window object as a wrapper, not the element. Marked all window event
listeners as such for code generator.

We tried using the mumble_references convention to manage our
dependencies, but it doesn't seem to be providing much value for the
steps and commands module because these modules are small pieces of the
larger tool module. In this patch, I've removed the references file
for these modules.

I've left the style_references file for the style module because that
module seems better isolated from the rest of webkitpy and the
style_references file appears to be providing some value.

I've split the platform specific parts of this test into separate
files. On KURL-based ports these should have the same results on every
platform. We can decide whether to have platform-specific behavior at
a later time.

(WebCore::CachedFont::getSVGFontById): Make sure we really get an SVGFontElement by using
getElementsByNameNS: the element factory chooses which element to create based on both
localName and namespace.

LayoutTests:

Test that load an SVG document not in the SVG namespace with @font-face does not
lead to a crash.

[Qt] GraphicsLayer: support fill-modes​https://bugs.webkit.org/show_bug.cgi?id=36216
Implement the CSS-animation "fill mode" concept in GraphicsLayerQt. The concept
enables a key-frame animation to go to the animation's starting point before the delay,
and/or to stay at the animation's ending point after its ended, without reverting to the default
value.
We do that by manually setting the value to keyframe-0 before the delay if fill-mode is backwards/both,
and manually modifying the default value to the animated value as we animate, with fill-mode forwards/both.

Moved the expected result into platform-independent chromium subdirectory, since
the only chromium-specific difference is the way v8 formats an error message.
Also updated the expected result to match the passing now test.

If name or value is not valid UTF-8, nameStr or valueStr would be
null string, so crashed in headers->add(nameStr, valueStr).
Check both nameStr and valueStr are not null string.
Otherwise handshake will fail.

Test: websocket/tests/bad-handshake-crash.html

websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::readHTTPHeaders): check nameStr and valueStr are not null string.

Updating the hover state of an element caused the document to need style
recalc, and then updating the hover state of a link caused style recalc,
which changed the render tree while updateHoverActiveState() was iterating
over it, leading to a crash.

rendering/RenderLayer.cpp:

(WebCore::RenderLayer::updateHoverActiveState): Collect the nodes to be
updated into vectors, then update their active and hover states.

WebCore's strings should not know about JSC::UString, this should be abstracted
away in the bindings. Add explicit conversion methods rather than relying on
overloaded cast operators / constructors being implicitly called.

This patch only changes the class String, once this has landed StringImpl, and
hopefully AtomicString too, should follow suit.

Make GraphicsLayerQt always use ItemCoordinateCache, and remove ItemUsesExtendedStyleOption.
This aligns our implementation with the Safari implementation - layers are always uploaded
to textures in item units, and WebCore is responsible for the heuristics.