REGRESSION (r89900): Assertion failure on null view() when destroying the document
https://bugs.webkit.org/show_bug.cgi?id=91547

Patch by Elliott Sprehn <esprehn@gmail.com> on 2012-07-18
Reviewed by Abhishek Arya.

Source/WebCore:

Check for document destruction during insertion to avoid crash on null RenderView when trying
to count the number of RenderQuote and RenderCounter objects.

Test: fast/css-generated-content/bug91547.html

* rendering/RenderObjectChildList.cpp:
(WebCore::RenderObjectChildList::appendChildNode):
(WebCore::RenderObjectChildList::insertChildNode):

LayoutTests:

Test for crash caused by null RenderView in RenderQuote and RenderCounter.

* fast/css-generated-content/bug91547-expected.txt: Added.
* fast/css-generated-content/bug91547.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid calling GraphicsContext drawing primitives for 0px borders
https://bugs.webkit.org/show_bug.cgi?id=90039

Reviewed by Eric Seidel.

Source/WebCore:

The current code would happily call GraphicsContext to draw empty (0px) borders.
There is no good use case for going all the way to GraphicsContext in this case as
0px borders, regardless of the border-style, will not be painted. Thus this is a waste
of time on all platforms. On Chromium, this trigger some issues with pdf rendering as
Skia interprets 0px lines as very thin lines.

This change adds 0-checks in the border painting code as well as ASSERTs for
performance and to catch future bad use.

Test: fast/borders/0px-borders.html

* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawRect):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawRect):
* platform/graphics/openvg/GraphicsContextOpenVG.cpp:
(WebCore::GraphicsContext::drawRect):
* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContext::drawRect):
* platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContext::drawRect):
* platform/graphics/wx/GraphicsContextWx.cpp:
(WebCore::GraphicsContext::drawRect):
Added an ASSERT on all platforms to catch incorrect use.

* rendering/RenderBoxModelObject.cpp:
(WebCore::BorderEdge::shouldRender):
Changed to not render 0px borders, which should avoid unneeded work
in the patining code (context saving / restoring or transparency layer
push).

(WebCore::RenderBoxModelObject::paintOneBorderSide):
Added an ASSERT here that the border side is not empty.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::drawLineForBoxSide):
Added an early return with a comment as to why it's not feasible to
ASSERT as would be best.

LayoutTests:

The ref-tests are pretty similar and the exact rendering doesn't matter. What matters
is that we try to exercise the border painting code with 0px borders. Note that the
test were passing before already as they are meant to trigger the newly added ASSERTs
if something changes.

* fast/borders/0px-borders-expected.html: Added.
* fast/borders/0px-borders.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in RenderTableSection::addCell.
http://webkit.org/b/89496

Reviewed by Abhishek Arya.

Source/WebCore:

The issue comes from RenderBox::splitAnonymousBoxesAroundChild that would move sections
across tables but didn't force the table to do a synchronous section recalc. This opened
the way for race conditions where we would query the table column structure while it's dirty
(this is not uncommon but as usually the table's column representation is always bigger or
more split than a section's, it's usually harmless).

The fix is to force a synchronous section recalc.

Test: fast/table/split-table-no-section-update-crash.html

* rendering/RenderBox.cpp:
(WebCore::markBoxForRelayoutAfterSplit):
Changed to call forceSectionsRecalc ie force a section recalc.

* rendering/RenderTable.cpp:
(WebCore::RenderTable::recalcSections):
Added missing ASSERT for unneeded calls.

* rendering/RenderTable.h:
(WebCore::RenderTable::forceSectionsRecalc):
Added this helper function.

LayoutTests:

The test is still pretty complex as it involves lots of generated content. It should
be possible to get a smaller test case based on the conditions for the crash. However
this test is a pretty good stress test so I decided against creating a more simple test
case.

* fast/table/split-table-no-section-update-crash-expected.txt: Added.
* fast/table/split-table-no-section-update-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123062 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add window resize benchmark
https://bugs.webkit.org/show_bug.cgi?id=91070

Reviewed by Ryosuke Niwa.

PerformanceTests:

Added window-resize.html which exercise html5.html. This test
resizes the window and forces re-layout repeatedly.

* Interactive/resources/window-resize.js: Added.
* Interactive/window-resize.html: Added.
* Parser/resources/html5.html: Modified to inject driver scripts.

Tools:

Added some more output filters to take care of html5.html output.

* Scripts/webkitpy/performance_tests/perftest.py:
(PerfTest):


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