Record previously selected files and then compare them with newly selected files.
If the previously selected files and their order are not equal to those of
the newly selected files, we trigger the 'change' event.

Record previously selected files and then compare them with newly selected files.
If the previously selected files and their order are not equal to those of
the newly selected files, we trigger the 'change' event.

Test: fast/forms/file-input-change-event.html

html/FileInputType.cpp:
(WebCore::FileInputType::filesChosen): Calls dispathChangeEvent() only when the previously selected files are different from the newly selected files

rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSliderThumb):
Need to pass the RenderObject of the owner <input> because
updateFocusedState() checks the outline style of the specified
renderer, and we'd like to make a slider thumb reflect the owner
focus style.

Fix the missing flush() call that appears to be needed by the
logging package in python 2.5. Also fix the regressions
introduced in the run_webkit_test tests when we switched from
thread to processes (since processes aren't available on 2.5).

Stop throwing away all compiled code every time
we're told to do a full GC. Instead unlink all
callsites during such GC passes to maximise the
number of collectable functions, but otherwise
leave compiled functions alone.

Teach the new results.html how to display a warning when testing exited early.
The warning isn't quite as nice as ORWT since I couldn't figure out how to
find the total tests run, or total unexpected crashes. I figure
this is enough to get us going and we can refine it further.

Fix-up the exited early messages printed by NRWT so that
the buildbot can parse them as expected.
It looks for lines using "if line.find('Exiting early') >= 0:"

I also plumbed the "early exit" status through to results.json
in the form of an "interrupted" bool. It was unclear to me
if results.json already had enough information to compute this bool
itself. It's possible Ojan could come up with a better fix.

This patch adds some basic infrastructure to garden-o-matic.
Currently, the infrastructure is just used to make the "quit" command
use Ajax, but in the future, this infrastructure will be used to do
more sophistocated remote proceedure calls.

This patch adds a trivial "Hello, world" garden-o-matic command,
complete with an HTTP server. This command re-uses a bunch of code
from the existing rebaseline-server command. Over time, this command
will grow to be a tool useful for gardening the WebKit tree.

Make prepare-ChangeLog include modified Perl functions in its ChangeLog template

This is a very simple first cut. Functions must start with a line that starts with "sub "
and end with a line that starts with a closing brace. No leading whitespace is allowed.
Package names aren't parsed at all.

searching for function line ranges. This is already done inside the get_function_line_ranges
function.
(get_function_line_ranges): Cleaned up coding style a little bit. Call
get_function_line_ranges_for_perl for files with .pl and .pm extensions. For files with an
unknown extension or no extension, read the shebang line to try to determine the script
interpreter. Call get_function_line_ranges_for_perl if the interpreter seems to be Perl.
(get_function_line_ranges_for_perl): Added. Does extremely basic parsing of the file to find
lines starting with "sub " or "}".

(runTest):
(populateTests):
Made Windows use the formerly-Mac-only codepaths which correctly suppress gtest output
except in verbose mode. Most changes are due to indentation. Use of the arch utility is now
the only Mac-specific thing in these functions. Some other platform-specific code was moved
from here...

Replace the OwnHandle<> member in V8LocalContext with
v8::Persistent<v8::Context>.
The code that used OwnHandle<> would not correctly Dispose
of the Context, which would cause the memory to fill up when creating
and destructing many V8LocalContext objects, such as in the case
of IndexedDB.

Use ShadowBlur instead of ContextShadow to handle canvas and css shadows. ShadowBlur is
a newer and platform independent shadow implementation.
Qt QPainter does not have support for shadows so is necessary to create a layer support
to draw complex shapes and fonts. The beginShadowLayer creates a temporary shadow buffer
where the canvas can draw onto and endShadowLayer applies the blur filter, colors the
shadow buffer and draw the final shadow to the graphics context.

Modified baseUrl to be a local file in order to get a security origin
that is allowed to request local resources. Removed QSignalSpy from it
as loadFinished always happens, and the original test was split into two.

Add 'leftFirst' parameter to jsLess, jsLessEq matching that described in the ES5
spec. This allows these methods to be reused to perform >, >= relational compares
with correct ordering of type conversions.

dfg/DFGOperations.cpp:

interpreter/Interpreter.cpp:

(JSC::Interpreter::privateExecute):

jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

runtime/Operations.h:

(JSC::jsLess):
(JSC::jsLessEq):

LayoutTests:

Updated layout test results. Two of these tests now pass, however for
the third we now need to check in failing results, since the test is
incorrect!

The problem if that the test author has made the mistake of thinking
that the evaluation order for the operands to '>' is RHS then LHS.
This is due to a quirk in the way the spec is written. The greater
than opeator is defined to call the abstract relational comparison
algorithm with 'leftFirst' set to false, and as such conversion is
performed on the second operand ('y') first (see 11.8.5). However
the abstract relational comparison algorith is performing a less
than comaprison, and the greater than operator calls this algorithm
with the operands to the greater than operator reversed (see 11.8.2).
As such, the second operand to the abstract comaparison is the LHS
of the greater than. This bug also affects the corresponding less
than or equals test, where we already we have failing results checked
in, and again it is the test that is wrong (for the same reason).

We can remove the virtual "isChachedImage, isPendingImage, isGeneratedImage" functions to speed up the StyleImage.
Some profile data shows this part is significant, especially in small CSS-based sites.
Removing the virtual functions - removing the calls - makes a small performance progression on this part.

Added tests for plugin content saving and replacing in NetworkResourcesData.
Adjusted older tests to use new window.internals method setInspectorResourcesDataSizeLimits
to ensure NetworkResourcesData is in the correct state before test.

Now the data from didReceiveData callback is passed to inspector.
It is then saved in NetworkResourcesData structure for plugin requests.
Added window.internals.setInspectorResourcesDataSizeLimits() method
for testing replacement logic.

When step is "any", 0 was chosen as step, but this is not intuitive.
So changed to use the default step.

html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::getAllowedValueStep):
Calls getAllowedValueStepWithDecimalPlaces with RejectAny.
(WebCore::HTMLInputElement::getAllowedValueStepWithDecimalPlaces):
Takes a new arugument AnyStepHandling. If it is AnyIsDefaultStep, this method
allows "step" attribute to take a value "any" to use the default step as step value.
Otherwise, INVALID_STATE_ERR will be returned if "step" is "any".
(WebCore::HTMLInputElement::applyStep): ditto.
(WebCore::HTMLInputElement::stepUp):
Calls applyStep with RejectAny.
(WebCore::HTMLInputElement::stepDown): ditto.
(WebCore::HTMLInputElement::stepUpFromRenderer):
Removes a check that step is "any". It is checked in getAllowedValueStepWithDecimalPlaces.

Our arbitrary radix (2..36) toString conversion is inaccurate.
This is partly because it uses doubles to perform math that requires
higher accuracy, and partly becasue it does not attempt to correctly
detect where to terminate, instead relying on a simple 'epsilon'.

helper class, u16int with infinite precision fraction, used to convert
the fractional part of the number to a string.

(JSC::Uint16WithFraction::operator*=):

Multiply by a uint16.

(JSC::Uint16WithFraction::operator<):

Compare two Uint16WithFractions.

(JSC::Uint16WithFraction::floorAndSubtract):

Extract the integer portion of the number, and subtract it (clears the integer portion).

(JSC::Uint16WithFraction::comparePoint5):

Compare to 0.5.

(JSC::Uint16WithFraction::sumGreaterThanOne):

Passed a second Uint16WithFraction, returns true if the result of adding
the two values would be greater than one.

(JSC::Uint16WithFraction::isNormalized):

Used by ASSERTs to consistency check internal representation.

(JSC::BigInteger::BigInteger):

helper class, unbounded integer value, used to convert the integer part
of the number to a string.

(JSC::BigInteger::divide):

Divide this value through by a uint32.

(JSC::BigInteger::operator!):

test for zero.

(JSC::toStringWithRadix):

Performs number to string conversion, with the given radix (2..36).

(JSC::numberProtoFuncToString):

Changed to use toStringWithRadix.

Tools:

Added forwarding header.

DumpRenderTree/ForwardingHeaders/wtf/StdLibExtras.h: Added.

LayoutTests:

Our arbitrary radix (2..36) toString conversion is inaccurate.
This is partly because it uses doubles to perform math that requires
higher accuracy, and partly becasue it does not attempt to correctly
detect where to terminate, instead relying on a simple 'epsilon'.

Since r87067, the RenderStyle for the inner text element is reset
by the value update, but the renderer for the inner text element
keeps to have metrics calculated by the previous style. So
RenderTextControlSingleLine::layout() didn't set a desired height
to the renderer for the inner text element.

This patch changes the style creation code so that it has the
desired height initially.

This clears the way to fix Bug#63880. We currently handle greater-than comparisons
as being using the corresponding op_less, etc opcodes. This is incorrect with
respect to evaluation ordering of the implicit conversions performed on operands -
we should be calling ToPrimitive on the LHS and RHS operands to the greater than,
but instead convert RHS then LHS.

This patch adds opcodes for greater-than comparisons mirroring existing ones used
for less-than.

Only the core features are implemented. Most functions are actually
stubs and will be implemented as soon as its features are needed.
Build system changes will be made as soon as DRT is completely
upstreamed.

Use jsTestIsAsync and finishJSTest() in WebSocket tests which are run asynchronously.
Script tags loading js-test-post-function.js must be removed, and instead js-test-post.js
must be loaded after each test.

http/tests/websocket/tests/alert-in-event-handler.html:

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

http/tests/websocket/tests/bad-sub-protocol-control-chars.html:
This test is done synchronously, thus there is no need to use jsTestIsAsync and
finishJSTest(). As we are moving away from js-test-post-function.js,
isSuccessfullyParsed() should not be used anymore.

http/tests/websocket/tests/bad-sub-protocol-empty.html:

http/tests/websocket/tests/bad-sub-protocol-non-ascii.html:

http/tests/websocket/tests/bufferedAmount-after-close.html:

http/tests/websocket/tests/close-before-open.html:

http/tests/websocket/tests/close-on-navigate-new-location.html:

http/tests/websocket/tests/close-on-unload-and-force-gc.html:

http/tests/websocket/tests/close-on-unload-reference-in-parent.html:

http/tests/websocket/tests/close-on-unload.html:

http/tests/websocket/tests/close-unref-websocket.html:

http/tests/websocket/tests/cross-origin.html:

http/tests/websocket/tests/error-detect.html:

http/tests/websocket/tests/frame-length-longer-than-buffer.html:

http/tests/websocket/tests/frame-length-overflow.html:
Add close tags for <body> and <html> elements which were not present for some reason.

pywebsocket automatically sends handshake response when web_socket_do_extra_handshake()
finishes, and starts closing handshake (sends a close frame and waits for client's response)
after web_socket_transfer_data() exits. To stop this behavior, a handler must raise an
exception.

Some of our handlers send broken handshake in web_socket_do_extra_handshake(). If this handler
function exits without raising an exception, pywebsocket automatically sends another handshake
response, which is not really necessary. Normally this extra handshake message is not a problem,
because the client does not read any data beyond the end of the first (broken) handshake if
the client is working correctly. However, if the client erroneously accepts the first handshake,
it will be hard to diagnose the problem because of the extra message. The same can happen for
web_socket_transfer_data().

Generally, pywebsocket handlers should raise an exception if they do not want to send any more
data. However, this fact has been overlooked in past changes, and handlers in many tests exit
normally where they should raise an exception. This change fix these errors.

http/tests/websocket/tests/bad-handshake-crash_wsh.py:

http/tests/websocket/tests/frame-length-overflow_wsh.py:

http/tests/websocket/tests/handshake-fail-by-maxlength_wsh.py:
Do not need to cycle until disconnection.

http/tests/websocket/tests/long-invalid-header_wsh.py:
Some ports (Chromium) intercept handshake messages and do not pass server's response
to WebCore until they find the end of handshake response (i.e. "\r\n\r\n" and 16-byte data).
If the handler aborts the connection without sending this end-of-response marker, entire
response is ignored, which causes the test to fail.

Our arbitrary radix (2..36) toString conversion is inaccurate.
This is partly because it uses doubles to perform math that requires
higher accuracy, and partly becasue it does not attempt to correctly
detect where to terminate, instead relying on a simple 'epsilon'.

helper class, u16int with infinite precision fraction, used to convert
the fractional part of the number to a string.

(JSC::Uint16WithFraction::operator*=):

Multiply by a uint16.

(JSC::Uint16WithFraction::operator<):

Compare two Uint16WithFractions.

(JSC::Uint16WithFraction::floorAndSubtract):

Extract the integer portion of the number, and subtract it (clears the integer portion).

(JSC::Uint16WithFraction::comparePoint5):

Compare to 0.5.

(JSC::Uint16WithFraction::sumGreaterThanOne):

Passed a second Uint16WithFraction, returns true if the result of adding
the two values would be greater than one.

(JSC::Uint16WithFraction::isNormalized):

Used by ASSERTs to consistency check internal representation.

(JSC::BigInteger::BigInteger):

helper class, unbounded integer value, used to convert the integer part
of the number to a string.

(JSC::BigInteger::divide):

Divide this value through by a uint32.

(JSC::BigInteger::operator!):

test for zero.

(JSC::toStringWithRadix):

Performs number to string conversion, with the given radix (2..36).

(JSC::numberProtoFuncToString):

Changed to use toStringWithRadix.

Tools:

Added forwarding header.

DumpRenderTree/ForwardingHeaders/wtf/StdLibExtras.h: Added.

LayoutTests:

Our arbitrary radix (2..36) toString conversion is inaccurate.
This is partly because it uses doubles to perform math that requires
higher accuracy, and partly becasue it does not attempt to correctly
detect where to terminate, instead relying on a simple 'epsilon'.

loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
Only make the load FrameLoadTypeSame if it has not already been set as FrameLoadTypeReload*.
FrameLoadTypeReload* loads are set through http-equiv refreshes, manual reloads, or location.reload()
and honour the user's scroll position in the frame. A FrameLoadTypeSame is for when the frame is loading
the same page again, e.g. by clicking a link.

loader/NavigationScheduler.cpp:
(WebCore::ScheduledRedirect::fire): Tell FrameLoader::changeLocation() if this is a reload.

We applied transforms from previous animation repeats to a transform list. The problem is, that we calculated the current
transform based on the percentage of the current repeat count. This causes an animation starting from scale level 0
on every repeat. Now I add the repeat count to the current percentage, so that the distance calculation starts from 100% on
the first repeat, from 200% on the second and so on.

loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
Only make the load FrameLoadTypeSame if it has not already been set as FrameLoadTypeReload*.
FrameLoadTypeReload* loads are set through http-equiv refreshes, manual reloads, or location.reload()
and honour the user's scroll position in the frame. A FrameLoadTypeSame is for when the frame is loading
the same page again, e.g. by clicking a link.

loader/NavigationScheduler.cpp:
(WebCore::ScheduledRedirect::fire): Tell FrameLoader::changeLocation() if this is a reload.

platform/qt/http/tests/cookies/strict-third-party-cookie-blocking-expected.txt: Added.
This test is a stricter version of third-party-cookie-relaxing.html with
the expected behaviour that all third-party cookies are blocked.

platform/qt/Skipped: Prepare tests for unskipping on Qt-4.8.

platform/qt/http/tests/cookies/third-party-cookie-relaxing-expected.txt: Added.
Qt returns cookie lists in a different order from other ports.

Identifying third-party cookies is facilitated by API new to QUrl from
Qt 4.8: QUrl::topLevelDomain(). This API uses the Mozilla public suffix
list to determine the top-level registry-controlled domain of the Url.

The first two are self-explanatory, the third mimics Safari's
default behaviour of permitting third-party cookies when the user
already has cookies from the third-party site. This was
introduced to allow third-party cookie blocking to play well with
facebook sharing etc. AlwaysAllowThirdPartyCookies is the default.

There is scope for adding an 'exceptions' list API and clients would
struggle to implement it themselves given the paucity of information
available from setCookiesForUrl().

PluginView needs to use page->focusController()->setFocusedNode() when focusing a plugin
in order to clear the FrameSelection in the currently focused node. In its platform-specific
code Chromium already does this (WebPluginContainerImpl.cpp).

PluginView needs to use page->focusController()->setFocusedNode() when focusing a plugin
in order to clear the FrameSelection in the currently focused node. In its platform-specific
code Chromium already does this (WebPluginContainerImpl.cpp).

Move the rebaseline server out of the commands package and into the
(new) servers package. This patch prepares for refactoring this code
to share server infrastructure with the (forthcoming) garden-o-matic
command.

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

Scripts/webkitpy/tool/servers/init.py: Added.

Scripts/webkitpy/tool/servers/data/rebaselineserver/loupe.js:

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

Scripts/webkitpy/tool/servers/data/rebaselineserver/queue.js:

Scripts/webkitpy/tool/servers/rebaselineserver.py: Added.

07/02/11:

Remove failing expectation for fast/events/panScroll-click-hyperlink.html
(Chromium still doesn't pass the test, since it doesn't have pan
scrolling enabled, but r90235 added failing expectations for the Windows
port, which Chromium Win and Linux pick up)

Also remove flaky expectations for some tests that have not failed as
far back as the flakiness dashboard has data for.

(WebKit::Plugin::initialize):
New function that initializes the plug-in controller and then calls the real
virtual initialize member function.

WebProcess/Plugins/Plugin.h:
Add m_pluginController member variable and a new initialize virtual member function that doesn't take a
PluginController parameter. Make the "old" initialize member function set up the plug-in controller.

Add ops CheckHasInstance & InstanceOf to implement bytecodes
op_check_has_instance & op_instanceof. This is an initial
functional implementation, performance is a wash. We can
follow up with changes to fuse the InstanceOf node with
a subsequant branch, as we do with other comparisons.

Add Chromium Mac Snow Leopard baselines for editing/selection/vertical*
since the regular Mac baselines can't be used due to single-pixel
differences in character rendering (presumably caused by 32-bit vs.
64-bit binaries).

[Chromium] FileSystem API can be used to learn about installed software on the user's computer.
Added a new MIMETypeRegistry method to return a type based on a well known set of mappings
without consulting the OS/registry.​https://bugs.webkit.org/show_bug.cgi?id=63220

Add SVGElement::reportAttributeParsingError, which will
write a Web Inspector console message if passed an SVGParsingError
and the attribute which was being applied, only in the case where
there is actually an error.

Include the SVG document's URI when writing to the Web Inspector
console, so that the UI displays both the filename and the line number.

platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::clampedContentsScaleForScale):
Increased the maximum scale since scale factor can now include
both page contents scale and backing scale.

WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
(WebKit::LayerTreeHostCA::initialize): Set contents scale on the
non-composited content layer based on the backing scale factor.
(WebKit::LayerTreeHostCA::createPageOverlayLayer): Set contents
scale on the page overlay layer based on the backing scale factor.

location.replace('#foo') would not update the HistoryItem with the
new URL, thus navigating back to the page would use the previous
URL, even though it had been replaced. Make
HistoryController::updateForSameDocumentNavigation mirror
HistoryController::replaceState.

Fix expected results after r90275. I checked in Mac-specific results for these tests.
Move them to platform/mac and revert the changes in platform-independent results.
Also copy results to platform/win because they fallback to Mac by default.

Also fixed a bug that WebKit does not preserve non-directional selection after undo.

Test: editing/selection/directionality-after-undo-replace.html

WebCore.exp.in: Updated the signature of setSelection.

editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection): Removed the call to setIsDirectional.
(WebCore::shouldAlwaysUseDirectionalSelection): Added.
(WebCore::FrameSelection::setSelection): No longer takes DirectionalityPolicy.
Calls setIsDirectional(true) when the platform doesn't support non-directional selection.
Passes align and granularity to setSelection of the base end point as expected.
No longer updates granularity when updating the selection of a different frame.
(WebCore::FrameSelection::willBeModified): Calls VisibleSelection::isDirectional().
(WebCore::FrameSelection::modify): No longer calls trialFrameSelection.setIsDirectional
because the directionality is passed from m_selection automatically.
Also calls shouldAlwaysUseDirectionalSelection.

In rare cases it's possible for a GC sweep to occur while a
live, but not completely initialised object is on the stack.
In such a case we may incorrectly choose to mark it, even
though it has no children that need marking.

We resolve this by always zeroing out the structure of any
value returned from JSCell::operator new(), and making the
markstack tolerant of a null structure.

Add ScriptCodesFromICU.h to wtf/unicode and make necessary changes in
build files for ports not using ICU.
Add icu/unicode/uscript.h for ports using ICU. It's taken from
ICU 3.6 (the version used on Mac OS 10.5)

Make generic font family getters/setters accept an additional
argument (script code). It has a default value so that if an embedder
does not have/want a per-script font family setting, call-sites
don't have to be changed.
This is to prepare for fixing bug 10874 (font selection is not
language-dependent) and bug 18085.

uscript.h has been updated to that of ICU 3.6 (the version of ICU on
Mac OS 10.5)

ReportCrash chews up too many system resources that it destablizes
tests run concurrently. This patch causes us to spin down all the
worker processes when ReportCrash is running.

Also, this patch causes the master process to tell the user we're
waiting for the crash reporter rather than having that be the worker's
job. This stops the user from getting spammed with too many "waiting
for crash reporter" messages and also cleans up some minor UI issues
with the meter.

r90229 moved the "Need a short description and bug URL" line to the top of the ChangeLog
template. But webkitpy didn't know this, so the various rollout-related commands were
leaving that line in the ChangeLog.

This adds specialised thunks for Math.abs, Math.round, Math.ceil,
Math.floor, Math.log, and Math.exp as they are apparently more
important in real web content than we thought, which is somewhat
mind-boggling. On average doubles the performance of the common
cases (eg. actually passing numbers in). They're not as efficient
as they could be, but this way gives them the most portability.

fix-it:"JavaScriptCore/jit/JITOpcodes32_64.cpp":{741:9-741:9}:"("
fix-it:"JavaScriptCore/jit/JITOpcodes32_64.cpp":{741:35-741:35}:")"JavaScriptCore/jit/JITOpcodes32_64.cpp:741:36:{741:28-741:94}: note: place parentheses around the '?:' expression to evaluate it first [3]

WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
Revert the return value of NPP_HandleEvent because the plugin function
returns with 0 if it handled the event.
(WebKit::NetscapePlugin::platformHandleMouseEvent):
(WebKit::NetscapePlugin::platformHandleWheelEvent):
(WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
(WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
(WebKit::NetscapePlugin::platformHandleKeyboardEvent):

commit-log-editor was changed in r46899 to move the bug title and URL to the top of the
commit message in order to make git-based tools, which expect the first line of the commit
message to be a summary of the change, to work better. But this reordering of the ChangeLog
entry was unpredictable and unexpected.

I changed prepare-ChangeLog to put the bug title and URL at the top of the ChangeLog entry
so that commit-log-editor doesn't have to move them. Then I changed commit-log-editor not to
try to move them.

line and try to move it down below the bug title and URL. The order of the text in the
ChangeLog is now preserved, except that we insert a "Patch by" line just above the "Reviewed
by" line in cases where the committer and author are not the same person.

Scripts/prepare-ChangeLog: Moved the "Reviewed by" line down below the bug title and URL.

r90163 bumped the version of the WKBundlePageLoaderClient passed in by WebKitTestRunner from 0 to 1.
This made it run in to the ad-hoc client version checking implemented directly in WKBundlePageSetPageLoaderClient,
resulting in no client being set. After r90162 the ad-hoc checking is not necessary as the APIClient
template takes care of the relevant version checks.

Shared/APIClient.h:

(WebKit::APIClient::initialize): Fix a bug I noticed along the way: don't attempt to copy anything if
the client version is newer than what we support. This matches the behavior of the ad-hoc version checking.

MailQuirksUserScript.js is injected into WebViews in Mail.app on
Leopard to resolve an incompatibility between it and the HTML5 parser.
It did so by taking all nodes in the document between <html> and <body>
and moving them to be children of <body>. This maintains Mail.app's
assumption that document.firstChild.firstChild == document.body.

While this script fixed a specific issue with the Signature panel in
Mail.app, it caused regressions in other WebViews. Since the issue with
the Signature panel is with the empty <head> node implicitly created by
the parser, we can simplify this script by removing this implicit
<head> in the case it has no attributes and no children. This fixes the
Signature panel without affecting other WebViews that have non-trivial
<head> nodes.

Misc/MailQuirksUserScript.js: If <head> exists but has no attributes
and no children, remove it.