kjs/JSGlobalData.h: Added.
This class encapsulates all data that should be per-thread (or shared between legacy clients).
It will also keep a Heap pointer, but right now, Heap (Collector) methods are all static.

kjs/identifier.h:
(KJS::Identifier::Identifier):
Added a constructor explicitly taking JSGlobalData to access IdentifierTable. Actually,
all of them should, but this will be a separate patch.

kjs/identifier.cpp:
(KJS::IdentifierTable::literalTable):
(KJS::createIdentifierTable):
(KJS::deleteIdentifierTable):
(KJS::Identifier::add):
(KJS::Identifier::addSlowCase):
Combined IdentifierTable and LiteralIdentifierTable into a single class for simplicity.

kjs/grammar.y: kjsyyparse now takes JSGlobalData, not just a Lexer.

kjs/nodes.cpp:
(KJS::Node::Node):
(KJS::EvalFunctionCallNode::emitCode):
(KJS::ScopeNode::ScopeNode):
Changed to access Lexer and Parser via JSGlobalData::threadInstance(). This is also a
temporary measure, they will need to use JSGlobalData explicitly.

<rdar://problem/5890684> REGRESSION(r23969): Deleting a line break changes the style of text after the break

Serialization of font-family:-webkit-monospace when it came from a
CSSMutableStyleDeclaration would wrap the value in single quotes but
serialization of the same property value pair from a CSSComputedStyleDeclaration
wouldn't, which kept code that checked for and removed non-redundant styles from
style spans from working correctly.

A redundant style left on a style span would not normally create a rendering
difference, but it did in this case because an element with
font-family:-webkit-monospace does not appear to inherit font-size.
Added a FIXME about how we might need to keep font-size on a style span if its
non-redundant styles include font-family:-webkit-monospace, although I couldn't
create a test case to produce this scenario.

css/FontFamilyValue.cpp:
(WebCore::isValidCSSIdentifier): Don't return false if the String starts
with a '-'. This function now appears identical to isCSSTokenizerIdentifier,
so perhaps we should use a single function.

editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::handleStyleSpans): Added FIXME. Removed the
creation of two Strings that were never used.

editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete): applyStyle
can destroy insertedPlaceholder if it needs to move it, but it will set an
endingSelection() at [movedPlaceholder, 0] if it does so. Re-fetch insertedPlaceholder
if that happens. The long term solution for these crashes is to make moveParagraphs
not copy/destroy/move content, and to make VisiblePositions update themselves on DOM
mutations.

editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::indentRegion): Early return to avoid crashes like this
in the future, but ASSERT to catch them in debug builds.

xmlhttprequest-onProgress-open-should-zero-length.html supposes that the onprogress event
is dispatched 3 times to test that the position is reset when XMLHttpRequest.open() is
called.
The test was failing because CoreFoundation keeps the data if they are not big enough
(which led to only 1 progress event dispatched).

We now generate a big response instead of a small one.

Warning: this test is not guaranteed to succeed as we cannot guarantee that the server

will send responses' sizes that are close for 2 different requests to the same
resource.

editing/RemoveFormatCommand.cpp:
(WebCore::RemoveFormatCommand::doApply): If the selection was all
formatting (like an empty list) the format-less text will be empty.
Early return to avoid the ASSERT that fires if input(...) is called
with an empty String.

ApplyStyleCommand::applyInlineStyle does some work and then checks to see
if the start offset of the Range it's operating on is now past the caretMaxOffset
of the start container. If it is, applyInlineStyle updates the position to
[startContainer->traverseNextNode(), 0] and then operates on that new start
position.

caretMaxOffset was incorrect for horizontal rules. It should be 1 and it was 0. So,
if the horizontal rule was the last node in the document, applyInlineStyle would update
its start position to [0, 0] and then try to operate on that position, assuming it was
non-null, leading to the ASSERT.

Added the -fno-tree-pre flag to the Machine.cpp build, to tell GCC not
to perform Partial Redundancy Elimination (PRE) on trees in Machine.cpp,
since GCC's PRE doesn't do very well with computed goto code.

A crash would occur when indenting a selection that started just before a table
and ended inside that table. With a selection like this, we'd indent the entire
table, then try and indent paragraphs inside it, but the stored position for the
next paragraph to indent was inside content that had been removed from the document
during the first Indent.

Fixed the crash adjusting the selection to perform the indent on to prepare it
for paragraph iteration using selectionForParagraphIteration. We do this adjustment
for paragraph iteration in InsertList as well.

Also, indenting paragraphs inside table cells would break table structure because
we were splitting the DOM all the way up to the root editable element to insert
a blockquote. Fixed this by only splitting up to the enclosing table cell. This
matches FF. Lastly, fixed a bug where indenting several paragraphs inside different
table cells would move all the selected text into the same table cell. FF still has
this bug.

force inlining of a template function that only has one call site per specialization
1.3% speedup on SunSpider

kjs/collector.cpp:
(KJS::Collector::heapAllocate): This template function is only
called from allocate() and allocateNumber() (once per
specialization) and the extra call overhead for GC allocation
shows up, so force inlining.

platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::setPlatformShadow): In Core Graphics, shadow
dimensions are always in device space. Account for that, and apply the
current context transform to shadow offset, and multiply the blur radius
by the inverse of the operator norm of the inverse transform (which is
the radius of the circle inscribed in the transformed unit circle).

rendering/RenderObject.cpp:
(WebCore::RenderObject::paintBoxShadow): Added 1px separation between
the edge of the filled shape and the edge of the clipped-out shape,
because in a transformed context, due to antialiasing, the fill can
bleed into the clip if they touch.

<rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
profiler.

This patch removes the use of recursion for the sort functions.

JavaScriptCore.exp: Change the signatures of the functions being
exported.

profiler/Profile.cpp:
(KJS::Profile::sort): This generic function will accept any of the
static sort functions and apply them to the whole tree.

profiler/Profile.h: All of the sorting functions now call the new
sort() function.
(KJS::Profile::sortTotalTimeDescending):
(KJS::Profile::sortTotalTimeAscending):
(KJS::Profile::sortSelfTimeDescending):
(KJS::Profile::sortSelfTimeAscending):
(KJS::Profile::sortCallsDescending):
(KJS::Profile::sortCallsAscending):
(KJS::Profile::sortFunctionNameDescending):
(KJS::Profile::sortFunctionNameAscending):

profiler/ProfileNode.cpp:
(KJS::ProfileNode::ProfileNode): m_head used to point to the head node
if this was the head node. It now points to null to make iteration easy
(KJS::ProfileNode::willExecute): Now must check if m_head is null, this
check used to happend in the constructor.
(KJS::ProfileNode::stopProfiling): Again the check is slightly different
to determine if this is the head.
(KJS::ProfileNode::traverseNextNode): This function returns the next
node in post order.
(KJS::ProfileNode::sort): This generic function will sort according to
the comparator passed in, then reset the children pointers to macth the
new order.

profiler/ProfileNode.h: The sorting function were removed from the
definition file and instead use the new generic sort() function
(KJS::ProfileNode::totalPercent): because the head can now be empty we
need to check here too for the head node.
(KJS::ProfileNode::selfPercent): Ditto
(KJS::ProfileNode::firstChild): This function is necessary for the
iterative algorithm in Profile.cpp.
(KJS::ProfileNode::sortTotalTimeDescending):
(KJS::ProfileNode::sortTotalTimeAscending):
(KJS::ProfileNode::sortSelfTimeDescending):
(KJS::ProfileNode::sortSelfTimeAscending):
(KJS::ProfileNode::sortCallsDescending):
(KJS::ProfileNode::sortCallsAscending):
(KJS::ProfileNode::sortFunctionNameDescending):
(KJS::ProfileNode::sortFunctionNameAscending):
(KJS::ProfileNode::childrenBegin):
(KJS::ProfileNode::childrenEnd):
(KJS::ProfileNode::totalTimeDescendingComparator):
(KJS::ProfileNode::totalTimeAscendingComparator):
(KJS::ProfileNode::selfTimeDescendingComparator):
(KJS::ProfileNode::selfTimeAscendingComparator):
(KJS::ProfileNode::callsDescendingComparator):
(KJS::ProfileNode::callsAscendingComparator):
(KJS::ProfileNode::functionNameDescendingComparator):
(KJS::ProfileNode::functionNameAscendingComparator):

API/JSClassRef.cpp: (OpaqueJSClass::OpaqueJSClass): Since JSClass is constructed without
a context, there is no way for it to create Identifiers.
Also, added initializeThreading(), just for good measure.

API/JSCallbackObjectFunctions.h: (KJS::::getPropertyNames): Make an Identifier out of the
string here, because propertyNames.add() needs that.

kjs/identifier.cpp:

kjs/identifier.h:
(KJS::Identifier::equal):

kjs/ustring.cpp:
(KJS::equal):
Moved equal() from identifier.h to ustring.h, because it's not really about Identifiers,
and to make it possible to use it from StrHash.
Include StrHash.h from ustring.h to avoid having the behavior depend on headers that happen
to be included.

wtf/StrHash.h: Removed.

kjs/ustring.h: Made RefPtr<UString::Rep> use the same default hash as UString::Rep* (it
used to default to pointer equality). Moved the whole StrHash header into ustring.h.

JavaScriptCore.exp: Export equal() for WebCore use (this StrHash is used in c_class.cpp,
jni_class.cpp, and npruntime.cpp).

The getOwnPropertySlot virtual function now takes care of the toObject call
for get. Similarly, the put function (and later deleteProperty) does the
same for those operations. To do this, the virtual functions were moved from
the JSObject class to the JSCell class. Also, since the caller no longer knows
the identity of the "original object", which is used by JavaScript-function
based getters, changed the PropertySlot class so the original object is
already stored in the slot when getOwnPropertySlot is called, if the caller
intends to call getValue.

This affected the old interpreter code enough that the easiest thing for me
was to just delete it. While I am not certain the mysterious slowdown is not
still occurring, the net change is definitely a significant speedup.

VM/Machine.cpp: Moved the UNLIKELY macro into AlwaysInline.h.
(KJS::resolve): Set up the originalObject in the PropertySlot before
calling getPropertySlot. Also removed the originalObject argument from
getValue.
(KJS::resolve_skip): Ditto.
(KJS::resolveBaseAndProperty): Ditto.
(KJS::resolveBaseAndFunc): Ditto.
(KJS::Machine::privateExecute): Removed the toObject calls from the get and
put functions where possible, instead calling directly with JSValue and letting
the JSValue and JSCell calls handle toObject. Same for toThisObject.

kjs/ExecState.h: Removed OldInterpreterExecState.

API/JSBase.cpp: Updated includes.

kjs/LocalStorageEntry.h: Removed contents. Later we can remove the file too.

kjs/array_instance.cpp:
(KJS::ArrayInstance::lengthGetter): Removed originalObject argumet.
(KJS::ArrayInstance::inlineGetOwnPropertySlot): Don't pass a base value to
setValueSlot. Also use UNLIKELY around the "getting elements past the end of
the array" code path; less common than successfully getting an element.

kjs/array_object.cpp:
(KJS::getProperty): Initialize the PropertySlot with the original object.
Don't pass the original object to the get function.
(KJS::arrayProtoFuncFilter): Ditto.
(KJS::arrayProtoFuncMap): Ditto.
(KJS::arrayProtoFuncEvery): Ditto.
(KJS::arrayProtoFuncForEach): Ditto.
(KJS::arrayProtoFuncSome): Ditto.

kjs/lexer.cpp:
(KJS::Lexer::shift): Changed shift to just do a single character, to unroll
the loop and especially to make the one character case faster.
(KJS::Lexer::setCode): Call shift multiple times instead of passing a number.
(KJS::Lexer::lex): Ditto.
(KJS::Lexer::matchPunctuator): Ditto. Also removed unneeded elses after returns.
(KJS::Lexer::scanRegExp): Ditto.

kjs/nodes.cpp: Removed some of the things needed only for the pre-SquirrelFish
execution model.
(KJS::ForNode::emitCode): Handle cases where some expressions are missing by
not emitting any code at all. The old way was to emit code for "true", but
this is an unnecessary remnant of the old way of doing things.

kjs/nodes.h: Removed some of the things needed only for the pre-SquirrelFish
execution model.

kjs/object.cpp:
(KJS::JSObject::fillGetterPropertySlot): Changed to only pass in the getter
function. The old code passed in a base, but it was never used when
actually getting the property; the toThisObject call was pointless. Also
changed to not pass a base for setUndefined.

kjs/object.h: Added the new JSCell operations to GetterSetterImp.
Never called.
(KJS::JSObject::get): Initialize the object in the PropertySlot and don't
pass it in getValue.
(KJS::JSObject::getOwnPropertySlotForWrite): Removed the base argument
in calls to setValueSlot.
(KJS::JSObject::getOwnPropertySlot): Ditto.
(KJS::JSValue::get): Added. Here because it calls through to JSObject.
A version of JSObject::get that also handles the other types of JSValue
by creating the appropriate wrapper. Saves the virtual call to toObject.
(KJS::JSValue::put): Ditto.
(KJS::JSValue::deleteProperty): Ditto.

kjs/property_slot.cpp:
(KJS::PropertySlot::undefinedGetter): Removed the originalObject argument.
(KJS::PropertySlot::ungettableGetter): Ditto.
(KJS::PropertySlot::functionGetter): Ditto. Use the value in the base
as the "this" object, which will be set to the original object by the new
PropertySlot initialization code. Also call toThisObject. The old code did
not do this, but needed to so we can properly handle the activation object
like the other similar code paths.

kjs/property_slot.h:
(KJS::PropertySlot::PropertySlot): Added a constructor that takes a base
object. In debug builds, set the base to 0 if you don't pass one.
(KJS::PropertySlot::getValue): Don't take or pass the originalObject.
(KJS::PropertySlot::setValueSlot): Don't take a base object, and clear the
base object in debug builds.
(KJS::PropertySlot::setGetterSlot): Ditto.
(KJS::PropertySlot::setUndefined): Ditto.
(KJS::PropertySlot::setUngettable): Ditto.
(KJS::PropertySlot::slotBase): Assert that a base object is present.
This will fire if someone actually calls the get function without having
passed in a base object and the getter needs it.
(KJS::PropertySlot::setBase): Added. Used by the code that implements
toObject so it can supply the original object after the fact.
(KJS::PropertySlot::clearBase): Added. Clears the base, but is debug-only
code because it's an error to fetch the base if you don't have a guarantee
it was set.

kjs/string_object.h:
Removed originalObject arguments from getters. Don't pass base values to
the various PropertySlot functions that no longer take them.

kjs/value.cpp:
(KJS::JSCell::getOwnPropertySlot): Added. Calls toObject and then sets the slot.
This function has to always return true, because the caller can't walk the prototype
chain. Because of that, we do a getPropertySlot, not getOwnPropertySlot, which works
for the caller. This is private, only called by getOwnPropertySlotInternal.
(KJS::JSCell::put): Added. Calls toObject and then put.
(KJS::JSCell::toThisObject): Added. Calls toObject.

kjs/value.h: Added get, put, and toThisObject to both JSValue
and JSCell. These take care of the toObject operation without an additional virtual
function call, and so make the common "already an object" case faster.

wtf/AlwaysInline.h: Moved the UNLIKELY macro here for now. Maybe we can find a
better place later, or rename this header.

<rdar://problem/5763082> GMail: Hang when removing indent from nested list
<rdar://problem/5775449> In Gmail and GoogleDocs, a hang occurs when I attempt to apply a list style to a large selection of text
<rdar://problem/5937624> 9D32: Hang in Safari. Using 100% of processor

editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::modifyRange): doApply() may operate on and remove
the last paragraph of the selection from the document if it's in the same list
item as startOfCurrentParagraph. Return early to avoid an infinite loop and
because there is no more work to be done. Added a FIXME (<rdar://problem/5983974>)
about the incorrect endingSelection()s.

<rdar://problem/5763082> GMail: Hang when removing indent from nested list
<rdar://problem/5775449> In Gmail and GoogleDocs, a hang occurs when I attempt to apply a list style to a large selection of text
<rdar://problem/5937624> 9D32: Hang in Safari. Using 100% of processor

editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::modifyRange): doApply() may operate on and remove
the last paragraph of the selection from the document if it's in the same list
item as startOfCurrentParagraph. Return early to avoid an infinite loop and
because there is no more work to be done. Added a FIXME (<rdar://problem/5983974>)
about the incorrect endingSelection()s.

Added a DebuggerStatementNode to handle codegen, and added a new
DidReachBreakPoint debug event (which will hopefully be useful
if we ever move breakpoint management into JSC proper). Also
added didReachBreakpoint to Debugger to allow us to actually respond
to this event.

page/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::ariaRoleHasPresentationalChildren):
Put a default case back in the switch statement so we don't get warned about
all the unhandled cases with GCC. Remove the unreachable code that was causing
a warning in Visual Studio.

Api/qwebhistoryinterface.cpp: Remove WebCore::historyContains(). This
function is not used anywhere internally and is only a convenience
function that can still be accomplished using
QWebHistoryInterface::historyContains();

Only 1 set of CLSIDs are now used, since we don't need to worry about registry collisions.
The second set remains, but only temporarily so nightlies continue to work.

This is supported for XPSP2 and later. Earlier systems require an installer
to write the required registry keys. Nightlies and developer builds require
XPSP2, Server 2003, or later.

Reviewed by Adam.

ForEachCoClass.cpp: Moved COM registration code here from WebKitDLL.cpp. This is ONLY used in the nightly case.
(substituteGUID): Moved here from WebKitDLL.cpp.
(registerWebKit): Moved here from WebKitDLL.cpp.
(setUseOpenSourceWebKit): Call registerWebKit instead of swapping progids. There is only 1 set of progids now - for the nightly.

ForEachCoClass.h: Removed production progids.

Interfaces/WebKit.idl: Added prototype for shutDownWebKit.

WebKit.vcproj/Interfaces.vcproj: Changed path to type library to move it out of project directory.

WebKit.vcproj/WebKit.vcproj: Changed path to type library to move it out of project directory.

WebKitDLL.cpp:
(DllUnregisterServer): Does nothing. Entry point is still present for backward compatibility.
(DllRegisterServer): Does nothing. Entry point is still present for backward compatibility.
(RunAsLocalServer): Does nothing. Entry point is still present for backward compatibility.
(shutDownWebKit): Moved from ForEachCoClass.

next/previousLinePosition didn't work if the input position was the last line in its
block. The code for handling such a position assumed that the input position was
editable, and that the position to be returned needed to also be editable. Changed
this code to just maintain the same editability.

No test case for now because we haven't enabled selection extension operations for
non-editable selections. I enabled them temporarily to test the fix, however.

dom/Node.cpp: Removed the now unused nextEditable(int).

dom/Node.h:

editing/visible_units.cpp:
(WebCore::previousLeafWithSameEditability): Added. Like previousEditable but just returns
a node of the same editability.
(WebCore::previousLinePosition): Call previousLeaf instead of previousEditable.
(WebCore::nextLeafWithSameEditability): Added.
(WebCore::nextLinePosition): Same as above.

Some ARIA roles are designated to have presentational children, which
means that their descendants aren't exposed to assistive technologies
on an individual basis. What this means in webcore is that descendants
of such roles need to be ignored in terms of accessibility.

(1) Removed remaining cases of the old hack of putting "this" into the
symbol table; replaced with explicit tracking of m_thisRegister.

(2) Made m_thisRegister behave the same for function, eval, and program
code, removing the static programCodeThis() function.

(3) Added a feature to nix a ScopeNode's declaration stacks when done
compiling, to save memory.

(4) Removed code that copied eval declarations into special vectors: we
just use the originals in the ScopeNode now.

VM/CodeGenerator.h: Removed unneded parameters from the CodeGenerator
constructor: we just use get that data from the ScopeNode now.

VM/Machine.cpp:
(KJS::Machine::execute): When executing an eval node, don't iterate a
special copy of its declarations; iterate the originals, instead.

kjs/nodes.cpp: Moved responsibility for knowing what AST data to throw
away into the CodeGenerator. Nodes no longer call shrinkCapacity on
their data directly.

kjs/nodes.h: Changed FunctionStack to ref its contents, so declaration
data stays around even after we've thrown away the AST, unless we explicitly
throw away the declaration data, too. This is useful for eval code, which
needs to reference its declaration data at execution time. (Soon, it will
be useful for program code, too, since program code should do the same.)

<rdar://problem/5954226> JSProfiler: Move the calls from
JavaScriptProfileNode to JavaScriptProfile in WebCore (19231)

This Makes the profiler now call sorting function s on a per-profile
basis instead of on a node in the profile.

This is also needed to remove the recursion limit in the profiler
<rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
profiler
since once the limit is removed calling sort on a node will only sort
that node's children not the entire sub-tree of that node.

page/JavaScriptProfile.cpp: All of these functions were moved from
JavaScriptProfileNode.
(WebCore::sortTotalTimeDescending):
(WebCore::sortTotalTimeAscending):
(WebCore::sortSelfTimeDescending):
(WebCore::sortSelfTimeAscending):
(WebCore::sortCallsDescending):
(WebCore::sortCallsAscending):
(WebCore::sortFunctionNameDescending):
(WebCore::sortFunctionNameAscending):
(WebCore::ProfileClass):

page/JavaScriptProfileNode.cpp:
(WebCore::ProfileNodeClass):

page/inspector/ProfileView.js: Change uses of JavaScriptProfileNode
for sorting to JavaScriptProfile.

bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::hasCSSPropertyNamePrefix): Tweak implementation a tiny bit for
improved performance when the first character does not match.
(WebCore::cssPropertyName): Reject property names with a leading uppercase
letter.

<rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
profiler
Implement Next Sibling pointers as groundwork for removing the recursion
limit in the profiler.

profiler/ProfileNode.cpp: Also I renamed parentNode and headNode since
'node' is redundant.
(KJS::ProfileNode::ProfileNode): Initialize the nextSibling.
(KJS::ProfileNode::willExecute): If there are already children then the
new child needs to be the nextSibling of the last child.
(KJS::ProfileNode::didExecute):
(KJS::ProfileNode::addChild): Ditto.
(KJS::ProfileNode::stopProfiling):
(KJS::ProfileNode::sortTotalTimeDescending): For all of the sorting
algorithms once the children are sorted their nextSibling pointers need
to be reset to reflect the new order.
(KJS::ProfileNode::sortTotalTimeAscending):
(KJS::ProfileNode::sortSelfTimeDescending):
(KJS::ProfileNode::sortSelfTimeAscending):
(KJS::ProfileNode::sortCallsDescending):
(KJS::ProfileNode::sortCallsAscending):
(KJS::ProfileNode::sortFunctionNameDescending):
(KJS::ProfileNode::sortFunctionNameAscending):
(KJS::ProfileNode::resetChildrensSiblings): This new function simply
loops over all of the children and sets their nextSibling pointers to
the next child in the Vector
(KJS::ProfileNode::debugPrintData):

page/inspector/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype.addScript): Move the addBreakpoint()
call inside the for loop so each breakpoint is added. Also check the
breakpoint's enabled state before calling addBreakpoint().

Fixes a bug where the line highlight and the execution line were conflicting.
The line highlight no longer shows up when the execution line changes, only
when showResource or showScript is called with a line number.

Reviewed by Darin Adler.

page/inspector/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype.showScript): Pass true for shouldHighlightLine.
(WebInspector.ScriptsPanel.prototype.showResource): Ditto.
(WebInspector.ScriptsPanel.prototype._showScriptOrResource): Added a shouldHighlightLine
argument that triggers the highlightLine() call on the SourceFrame.
(WebInspector.ScriptsPanel.prototype._goBack): Pass false for shouldHighlightLine since
we need to pass true for fromBackForwardAction.
(WebInspector.ScriptsPanel.prototype._goForward): Ditto.

Fixed ASSERT due to execution continuing after an exception is thrown
during array sort.

kjs/array_instance.cpp:
(KJS::AVLTreeAbstractorForArrayCompare::compare_key_key): Don't call the
custom comparator function if an exception has been thrown. Just return
1 for everything, so the sort completes quickly. (The result will be
thrown away.)

Clients will change the ifdef in RenderTheme.cpp and implement
any platform specific adjustments in RenderThemeXXX.cpp, either
by loading a file as the Qt port does, or by modifying the style
directly.