Only measure text once instead of twice when performing line layout.
https://bugs.webkit.org/show_bug.cgi?id=98317
<rdar://problem/12080821>

Reviewed by Dan Bernstein.

Since we are measuring each word to find out where the line break should occur,
we should cache that information to avoid measuring the run again when
creating the line box. The bulk of the change is in nextLineBreak, where
the measurements are collected and placed in a vector so that they can
be consumed in setLogicalWidthForTextRun where we used to measure the
text one more time.
Each entry in the vector is a WordMeasurement object that contains information
about the start and end offset in the run, the renderer, the measured width
and, possibly, a list of fallback fonts.
When we need to compute the width of the run to create the line box, we add
all the measurements for the given renderer in the run to get the total width.
This optiomization is currently disabled for platforms using HarfBuzz.

* platform/graphics/Font.cpp:
(WebCore::Font::width): Added fallback fonts parameter.
* platform/graphics/Font.h:
(Font): Added fallback fonts parameter to the width static member function.
This method is called when we compute the width using TextLayout.
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::TextLayout::width): Added fallback fonts parameter.
(WebCore::Font::width):
(WebCore::ComplexTextController::advance):
* platform/graphics/mac/ComplexTextController.h:
(ComplexTextController): Added fallback fonts parameter to advance method.
* rendering/RenderBlock.h: Added WordMeasures parameter to few methods.
* rendering/RenderBlockLineLayout.cpp:
(WordMeasurement): Added new class to hold measurement information.
(WebCore::setLogicalWidthForTextRun): This is where we compute the run width using the
cached information.
(WebCore::RenderBlock::computeInlineDirectionPositionsForLine): Added wordMeasures parameter.
(WebCore::RenderBlock::createLineBoxesFromBidiRuns): Added wordMeasures parameter.
(WebCore::RenderBlock::layoutRunsAndFloatsInRange): Added declaration of the WordMeasures
vector and its use.
(WebCore::textWidth): Added fallbackFonts parameter, since now we only measure once.
(WebCore::RenderBlock::LineBreaker::nextLineBreak): This method has been modified to collect
the measurements of the individual words and add them to the vector.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Initialize $written variable in load-and-stall.php script
https://bugs.webkit.org/show_bug.cgi?id=98854

Reviewed by Kent Tamura.

* http/tests/resources/load-and-stall.php:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130852 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r130838.
http://trac.webkit.org/changeset/130838
https://bugs.webkit.org/show_bug.cgi?id=98860

The patch is causing X errors (=> crashes) on GTK 64-bit
Release builder (Requested by zdobersek on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-10-09

* webkit/webkitwebview.cpp:
(resizeWebViewFromAllocation):
(webkit_web_view_size_allocate):
(webkitWebViewMap):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130853 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Fix harfbuzz-ng related code after r130231
https://bugs.webkit.org/show_bug.cgi?id=98858

Reviewed by Kent Tamura.

Replace first/second with key/value.

No new tests. No changes in behavior.

* platform/graphics/harfbuzz/ng/HarfBuzzNGFaceSkia.cpp:
(WebCore::harfbuzzGetGlyph):
* platform/graphics/skia/SimpleFontDataSkia.cpp:
(WebCore::SimpleFontData::canRenderCombiningCharacterSequence):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130854 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Recursively detach SVGElementInstances
https://bugs.webkit.org/show_bug.cgi?id=98851

Reviewed by Ryosuke Niwa and Abhishek Arya

Before this patch, SVGElementInstance child nodes were not being detached. This
patch makes detach() recursively detach SVGElementInstances.

* svg/SVGElementInstance.cpp:
(WebCore::SVGElementInstance::detach):


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