Reimplement RenderQuote placement algorithm
https://bugs.webkit.org/show_bug.cgi?id=93056

Patch by Elliott Sprehn <esprehn@gmail.com> on 2012-08-09
Reviewed by Eric Seidel.

Greatly simplify the code that maintains the linked list of RenderQuotes. Now RenderQuote
is placed into the linked list in computePreferredLogicalWidths on first access and is
detached when destroyed (or explicitly removed).

The new algorithm doesn't require walking up the tree of renderers when there are no
RenderQuotes in the tree yet, and also removes the need to walk over every subtree
when inserting in rendererSubtreeAttached.

No new tests because this patch doesn't change any behavior.

* rendering/RenderObjectChildList.cpp:
(WebCore::RenderObjectChildList::removeChildNode): Call detachQuote when removing from a child list.
(WebCore::RenderObjectChildList::appendChildNode):
(WebCore::RenderObjectChildList::insertChildNode):
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::RenderQuote):
(WebCore::RenderQuote::~RenderQuote):
(WebCore::RenderQuote::willBeDestroyed): Call detachQuote to ensure all destroyed quotes are detached.
(WebCore::RenderQuote::originalText):
(WebCore::RenderQuote::computePreferredLogicalWidths): Attach quote before computing the width.
(WebCore):
(WebCore::RenderQuote::attachQuote): Puts the RenderQuote in the linked list of quotes and computes the depth.
(WebCore::RenderQuote::detachQuote): Removes the quote from the linked list.
(WebCore::RenderQuote::updateDepth):
* rendering/RenderQuote.h:
(RenderQuote):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff): Return StyleDifferenceLayout if quotes change and remove check in styleDidChange in RenderQuote.
* rendering/RenderView.cpp:
(WebCore::RenderView::RenderView):
* rendering/RenderView.h:
(WebCore):
(WebCore::RenderView::setRenderQuoteHead):
(WebCore::RenderView::renderQuoteHead): Stores the first quote in the document.
(RenderView):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Append the unit in place when generating the text value of a CSSPrimitiveValue
https://bugs.webkit.org/show_bug.cgi?id=93572

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-08-09
Reviewed by Andreas Kling.

Previously, the units were added to the formatted number by the operator+. This would create
a new WTF::String for the unit, then use String::append() to add it to the number.

This was ineffective because it required one malloc for the unit, followed by a realloc + copying
the bytes.

This patch adds handling for the unit directly in formatNumber() so that we only do one malloc
and append the units in place.

Avoiding the intermediate string is both more efficient (9% faster as seen from JavaScript)
and generate more compact code (~8kb less code on x86_64).

* css/CSSPrimitiveValue.cpp:
(WebCore::formatNumber):
(WebCore::CSSPrimitiveValue::customCssText):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sandboxing view source documents is ineffective
https://bugs.webkit.org/show_bug.cgi?id=93660

Reviewed by Eric Seidel.

Prior to this patch, Document::setIsViewSource changed the
SecurityOrigin object on Document but didn't update the copy on
DOMWindow. As a consequence, the security checks that use the copy on
DOMWindow didn't notice the change and acted as if the document wasn't
sandboxed.

This bug wasn't present for most view source documents because
HTMLViewSourceDocument sets the flag in its constructor. However, for
view source documents created by the XMLTreeViewer, the bit was set at
the end of parsing rather than during construction.

This mechansim is really more of a mitigation than an important
security check, and I was tempted to remove the sandboxing entirely
given that sandboxing a document at the end of parsing isn't overly
effective anyway. However, we can worry about that issue in a future
patch.

For the time being, this patch just synchronizes DOMWindow and
Document's copy of the SecurityOrigin. The long-term solution here, of
course, is to keep working on fixing
https://bugs.webkit.org/show_bug.cgi?id=75793, which this patch gets us
one (small) step closer to fixing.

* dom/Document.cpp:
(WebCore::Document::setIsViewSource):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Versioning.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125224 268f45cc-cd09-0410-ab3c-d52691b4dbfc