Add a new RenderBoxModelObject class that will eventually act as the direct base class for RenderInlines. For
now just adding the class and putting it in between RenderObject and RenderBox in the hierarchy. RenderInline remains
derived from RenderBox for now.

This patch tidies up the MacroAssembler, cleaning up the code and refactoring out the
platform-specific parts. The MacroAssembler gets split up like a beef burger, with the
platform-agnostic data types being the lower bun (in the form of the class AbstractMacroAssembler),
the plaform-specific code generation forming a big meaty patty of methods like 'add32',
'branch32', etc (MacroAssemblerX86), and finally topped off with the bun-lid of the
MacroAssembler class itself, providing covenience methods such as the stack peek & poke,
and backwards branch methods, all of which can be described in a platform independent
way using methods from the base class. The AbstractMacroAssembler is templated on the
type of the assembler class that will be used for code generation, and the three layers
are held together with the cocktail stick of inheritance.

The above description is a slight simplification since the MacroAssemblerX86 is actually
formed from two layers (in effect giving us a kind on bacon double cheeseburger) - with the
bulk of methods that are common between x86 & x86-64 implemented in MacroAssemblerX86Common,
which forms a base class for MacroAssemblerX86 and MacroAssemblerX86_64 (which add the methods
specific to the given platform).

I'm landing these changes first without splitting the classes across multiple files,
I will follow up with a second patch to split up the file MacroAssembler.h.

Change RenderBlock::columnGap() access permissions from protected to
public. ANDROID creates an array of focus rectangles for navigation
with a trackball or directional pad, and needs access to the column gap
to implement this logic.

When using accelerated compositing, make repaints use the correct
repaint container. Hook up the RenderLayerCompositor in RenderView,
and add to RenderView a method that repaints both the view
contents, and any intersecting composited layers.

Make enclosingCompositingLayer() a method on RenderObject, and update
the compositor to use that. Add a helper method on the compositor to
get the non-self compositing ancestor: ancestorCompositingLayer().

Add toRenderImage methods for casting RenderObjects to RenderImages. The methods will assert if the object
is not a RenderImage. Also add a toRenderImage method that takes a RenderImage but returns void and that
is unimplemented. This method will catch anyone trying to do a cast when the object is already a RenderImage.

Add m_disableFontFallback to UniscriberHelper class and set it
to true when filling up glyph pages for non-BMP code points.
When it's set true, UniscriberHelper does not do its own font
fallback. Neither does it do glyph placement. Font fallback
will be taken care of in the simple script font path and glyph
placement is not necessary for simple scripts.

Add debugging code that will catch the incorrect dirtying of a table section immediately if it happens
during calcRowHeight or layoutRows. This should make it possible to discover future bugs where table sections don't
paint.

The bug in blogs.msdn.com, which was caused by a bad setNeedsLayout in RenderLayer::updateScrollInfoAtferLayout. Make
sure to do only a local setNeedsLayout inside that function.

loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create): Fix it correctly this time.
Check for the value returned from WebCore::IconDatabase::iconForPageURL(),
not WebCore::Image::data().

Move the isRenderInline checks for clientWidth/Height and scrollWidth/Height to the DOM element
versions of the functions. Since internal render tree usage doesn't ever (incorrectly) call these
functions on RenderInlines, this manages to get virtual function calls out of contentWidth/Height and
availableWidth/Height.

Fix selection repainting to do container-relative repaints. RenderView now
repaints the seleciton using the containerForRepaint() for each RenderSelectionInfo.
selectionRect() is now a wrapper for selectionRectForRepaint() with no container.

Pull SelectionInfo out of RenderObject.h, and BlockSelectionInfo out
of RenderBlock.h and move them into RenderSelectionInfo.h, with some
sharing and refactoring.

RenderBlock::selectionGapRectsForRepaint() is not yet container-aware.

Change the way wxWidgets build gets arguments.
Change "checkForArgumentAndRemoveFromARGV" in build-webkit to check if the
argument passed matches one in ARGV exactly (allows, ie, --wx-args not to be
removed when --wx is checked for).

Avoid creating extra copies of NSURLRequests for non-HTTP URLs. Only mark platform requests
as needing updating when HTTP fields change if the scheme of the URL is actually HTTP or HTTPS.
Thus cuts down significantly on the number of copied NSURLRequests and is about a 1% gain on the PLT.

In certain circumstances when WREC::Generator::generateCharacterClassInvertedRange invokes
itself recursively, it will incorrectly emit (and thus consume) the next single character
match in the current character class. As WREC uses a binary search this out of sequence
codegen could result in a character match being missed and so cause the regex to produce
incorrect results.

bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::setHref):
(WebCore::JSLocation::setProtocol):
(WebCore::JSLocation::setHost):
(WebCore::JSLocation::setHostname):
(WebCore::JSLocation::setPort):
(WebCore::JSLocation::setPathname):
(WebCore::JSLocation::setSearch):
(WebCore::JSLocation::setHash):
(WebCore::JSLocation::assign): Treat any navigation that is not initiated
by the user as a redirect from the perspective of global history.

history/HistoryItem.cpp:
(WebCore::HistoryItem::addRedirectURL): Store the last URL in the redirect
chain.

loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader):

loader/DocumentLoader.h:
(WebCore::DocumentLoader::urlForHistoryReflectsServerRedirect):
(WebCore::DocumentLoader::urlForHistoryReflectsClientRedirect):
(WebCore::DocumentLoader::setURLForHistoryReflectsClientRedirect): Sadly,
added yet another way to track redirect state during loading, since none
of the others did what I wanted, and I didn't want to cause behavior
changes in existing code.

loader/FrameLoader.cpp:
(WebCore::isBackForwardLoadType):
(WebCore::FrameLoader::restoreDocumentState): Renamed FrameLoadTypeRedirect =>
FrameLoadTypeRedirectWithLockedBackForwardList, to distinguish from all
the other meanings of "redirect" in the loading code.

(WebCore::FrameLoader::scheduleHTTPRedirection): Treat any HTTP refresh
redirect as a redirect from the perspective of global history.

(-[WebHistory _visitedURL:withTitle:method:wasFailure:serverRedirectURL:isClientRedirect:]):
(-[WebHistory _visitedURLForRedirectWithoutHistoryItem:]): Record redirect
information in global history.

History/WebHistoryInternal.h:

WebCoreSupport/WebFrameLoaderClient.h: See above and below.

WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::updateGlobalHistory):
(WebFrameLoaderClient::updateGlobalHistoryForRedirectWithoutHistoryItem): Record redirect
information in global history.

xml/XPathNodeSet.cpp:
(WebCore::XPath::NodeSet::sort):
Use reserveInitialCapacity instead of of reserveCapacity in all these call sites,
which are working on new vectors that are guaranteed not to be empty.

​https://bugs.webkit.org/show_bug.cgi?id=23587
Refactor HitTestRequest to eliminate all the ugly boolean arguments and
use an enum bitflag instead. Cleanup all the code that constructs the
various HitTestRequests to make the code more readable.

loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::createResourceHandle): A new method that creates a resource
handle in a manner that is closer to what CachedResource does. We now make conditional
requests for better performance, and set max-age to ensure that stale responses are not used.
(WebCore::ApplicationCacheGroup::update): Use the new createResourceHandle() method.
(WebCore::ApplicationCacheGroup::didReceiveResponse): If the response code for the resource
is 304, take it from the newest cache.
(WebCore::ApplicationCacheGroup::didFail): Pre-compute request URL.
(WebCore::ApplicationCacheGroup::didReceiveManifestResponse): Don't create a resource for
the manifest if the response code was 304 - it won't be needed.
(WebCore::ApplicationCacheGroup::didReceiveManifestData): Replaced an assertion that
m_manifestResource is not null with a check.
(WebCore::ApplicationCacheGroup::didFinishLoadingManifest): Treat null m_manifestResource as
an indication that the response was 304.
(WebCore::ApplicationCacheGroup::startLoadingEntry): Use createResourceHandle().

css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::canShareStyleWithElement): Use the newly named cssTarget instead
of the old name, getCSSTarget.
(WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): Ditto.

dom/ContainerNode.cpp:
(WebCore::ContainerNode::insertedIntoDocument): Moved code from Node in here rather than
calling through to EventTargetNode::insertedIntoDocument.
(WebCore::ContainerNode::removedFromDocument): Ditto.
(WebCore::ContainerNode::insertedIntoTree): Tweaked a bit.
(WebCore::ContainerNode::removedFromTree): Ditto.

dom/ContainerNode.h: Moved the constructor definition here and made it inline.

dom/Document.cpp:
(WebCore::Document::removeAllEventListenersFromAllNodes): Iterate the document element and
its contents only to avoid the document type node. This allows us to remove the virtual
function call to isEventTargetNode from the loop.
(WebCore::Document::setCSSTarget): Changed argument to be an Element rather than Node.

dom/Document.h: Changed CSS target to be an Element rather than a Node. Renamed
getCSSTarget to cssTarget.

dom/EventTargetNode.cpp:
(WebCore::EventTargetNode::removeAllEventListenersSlowCase): Renamed and turned the
rare data check into an assertion.

dom/EventTargetNode.h: Made the fast case of removeAllEventListeners be inline.
Also moved the constructor definition here and made it inline. And added toEventTargetNode,
matching the design of the render tree checked casts. Later we can migrate all callers
from EventTargetNodeCast to toEventTargetNode.

dom/NamedAttrMap.cpp:
(WebCore::NamedAttrMap::detachAttributesFromElement): Added. Factored out from
clearAttributes, so we could use this loop in cases where we're not clearing the attributes.
(WebCore::NamedAttrMap::~NamedAttrMap): Call detachAttributesFromElement instead of
clearAttributes here.
(WebCore::NamedAttrMap::clearAttributes): Call detachAttributesFromElement here.
(WebCore::NamedAttrMap::detachFromElement): Call detachAttributesFromElement instead of
clearAttributes. We don't need to clear the attributes array just because the element is
going away, so don't.
(WebCore::NamedAttrMap::virtualLength): Added.

dom/NamedAttrMap.h: Made all the virtual functions inherited from NamedNodeMap be private.
These are all unnecessarily inefficient for use outside the DOM. Changed length to be a
non-virtual function. This was a fairly hot function.

dom/NamedMappedAttrMap.cpp:
(WebCore::NamedMappedAttrMap::setClass): Changed to use element() function now that the
m_element data member is private.

dom/NamedMappedAttrMap.h: Made a few functions private. Made the
hasMappedAttributes function non-virtual.

dom/NamedNodeMap.h: Made length a non-virtual inline function that calls a virtual
function, name virtualLength. This lets NamedAttrMap::length be a non-virtual function.

dom/Node.cpp:
(WebCore::Node::insertedIntoDocument): Removed call to insertedIntoTree, since it's
only non-empty in subclasses of ContainerNode.
(WebCore::Node::removedFromDocument): Ditto. Also removed setCSSTarget. Since a CSS
target has to be an Element, this can be moved down to ContainerNode (or it could be
moved down to Element for that matter).

html/HTMLAreaElement.h: Use AtomicString in the getter and setter DOM operations.
Change the region data member to be an OwnPtr<Path> instead of a Path to optimize
the common case where an area element is parsed but never hit-tested. This could
also have been done by changing the Path class's null case to be more efficient,
but this seems fine.

rendering/RenderObject.h: Moved the definition of the firstLineStyle
function here and made it inline. Moved the definition of the
documentBeingDestroyed function here and made it inline.

svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::getCTM): Use getAttributeItem instead of
getNamedItem here since it accomplishes the same thing but is more efficient.
(WebCore::SVGSVGElement::getScreenCTM): Ditto.

01/31/09:

On the PLT, this results in 0.36x the number of virtual function calls
to RenderText::width() and 0.69x the number of calls to
Font::isFixedPitch(), but makes 1.0004x the number of calls to
Font::width().

rendering/RenderText.cpp:
(WebCore::RenderText::width): Replaced bounds checks on 'from' and 'len'
with an assertion.

rendering/bidi.cpp:
(WebCore::textWidth): Added this inlined helper function which calls
Font::width() directly in the non-fixed-pitch, non-full-range case, and
otherwise calls RenderText::width().
(WebCore::RenderBlock::findNextLineBreak): Cache whether the font has
fixed pitch (in which case RenderText::width() will be called in order
to take advantage of the widthFromCache() optimization for fixed-pitch
fonts). Replaced all calls to RenderText::width() with calls to the
textWidth() helper function.

Cleaned up code to add/remove NSNotification observers, to avoid performance hit
of calling removeObserver with unspecified notifications, or calling removeObserver
multiple times for the same notification.

Reviewed by Darin Adler

WebView/WebHTMLView.mm:
added observingMouseMovedNotifications, observingSuperviewNotifications, and
observingWindowNotifications as BOOL ivars of _private object
(-[WebHTMLView _removeMouseMovedObserverUnconditionally]):
moved to file-internal section of file, added leading underscore, now bails out
if we aren't observing the relevant notifications, now records that we are no longer
observing the relevant notifications
(-[WebHTMLView _removeSuperviewObservers]):
ditto, also stores [NSNoticationCenter defaultCenter] in local var to avoid objc dispatch
(-[WebHTMLView _removeWindowObservers]):
ditto
(-[WebHTMLView close]):
replace general removeObserver: call with three specific calls for all the notifications
that this class actually observes
(-[WebHTMLView addMouseMovedObserver]):
bail out if already observing relevant notifications, now records that we are observing
the relevant notifications
(-[WebHTMLView removeMouseMovedObserver]):
updated for name change
(-[WebHTMLView addSuperviewObservers]):
bail out if already observing relevant notifications, now records that we are observing
the relevant notifications; also stores [NSNoticationCenter defaultCenter] in local var
to avoid objc dispatch
(-[WebHTMLView addWindowObservers]):
ditto
(-[WebHTMLView viewWillMoveToSuperview:]):
updated for name change
(-[WebHTMLView viewWillMoveToWindow:]):
updated for name changes

loader/FrameLoader.cpp: Moved FrameLoaderClient::hasHTMLView in here.
We need it to not be an inline. Sadly, FrameLoaderClient.cpp was prematurely
deleted and I don't want to bring it back just to fix the build.

More removal of code from RenderContainer. Move removeLeftoverAnonymousBlock down into RenderBlock.
Move destroyLeftoverChildren into the RenderObjectChildList. Convert all containers to use the
RenderObjectChildList.

Remove the hacks in table code around the DeleteButtonController and fix tables so that positioned children don't get wrapped in anonymous objects.
With the removal of a non-positioned DeleteButtonController renderer, table layout can be tightened up to only lay out table sections. Table section
layout is tightened up to ignore non-table rows. When a table has multiple captions, only the real one will do a layout now. The other ones will
be properly ignored.