2013-03-27  Geoffrey Garen  <ggaren@apple.com>

        Unreviewed build fix: Removed a dead field.

        Pointed out by Mark Lam.

        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::ByteCodeParser):
        (ByteCodeParser):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147055 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed gardening. Test Expectations update.

http/tests/cache/subresource-failover-to-network.html is failing.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147056 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename toScriptElement -> toScriptElementIfPossible
https://bugs.webkit.org/show_bug.cgi?id=113473

Reviewed by Ryosuke Niwa.

Rename ScriptElement::toScriptElement to ScriptElement::toScriptElementIfPossible to
differentiate this function from other to*Element functions, and to better describe the
function's behavior. Other to*Element functions do not return null if the cast fails,
whereas toScriptElementIfPossible does.

No new tests as this is just a refactoring.

* dom/ScriptElement.cpp:
(WebCore::toScriptElementIfPossible):
* dom/ScriptElement.h:
(WebCore):
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::timerFired):

    This is the only unchecked return value but there isn't a security issue here.

* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::collectOptionInnerText):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::attachLater):
(WebCore::HTMLConstructionSite::insertForeignElement):
* html/parser/HTMLScriptRunner.cpp:
(WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
(WebCore::HTMLScriptRunner::requestPendingScript):
(WebCore::HTMLScriptRunner::runScript):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::notifyFinished):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::startElementNs):
(WebCore::XMLDocumentParser::endElementNs):
* xml/parser/XMLDocumentParserQt.cpp:
(WebCore::XMLDocumentParser::parseStartElement):
(WebCore::XMLDocumentParser::parseEndElement):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a way to update GraphicsLayerCA visibleRects without having to do a flush
https://bugs.webkit.org/show_bug.cgi?id=113459

Reviewed by Tim Horton.

Some platforms need to update TiledBacking visible rects from
outside of WebKit, for example if they use delegated scrolling.
They want to avoid forcing layout to be up-to-date when doing this.

Currently, updating the visibleRect happens when the GraphicsLayerCA
layer are being flushed, but that makes some assumptions about
layout being up-to-date.

To fix this, add a light-weight pass over the layer tree that
uses TransformState to compute the visibleRect for each
layer, and only if the visibleRect would cause a change in the
tiles in a TiledBacking trigger a layer flush.

* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::recomputeVisibleRects):
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::recursiveComputeVisibleRect):
(WebCore::GraphicsLayerCA::recomputeVisibleRects):
(WebCore::GraphicsLayerCA::computeVisibleRect):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/mac/TileController.h:
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::tilesWouldChangeForVisibleRect):
(WebCore::TileController::computeTileCoverageRect):
(WebCore::TileController::revalidateTiles):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PDFPlugin: Enable PDFPlugin only if its dependencies exist on the system
https://bugs.webkit.org/show_bug.cgi?id=113372
<rdar://problem/12685301>

Reviewed by Alexey Proskuryakov.

* Shared/mac/PDFKitImports.h: Wrap in #if PLATFORM(MAC).
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createPlugin): Use shouldUsePDFPlugin.
(WebKit::WebPage::shouldUsePDFPlugin): If the PDFPlugin setting is enabled but PDFLayerController is not available, don't use PDFPlugin.
* WebProcess/WebPage/WebPage.h:
(WebPage): Add shouldUsePDFPlugin
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::platformPreferencesDidChange): Use shouldUsePDFPlugin.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed Qt build fix after http://trac.webkit.org/changeset/147067.

* WebProcess/WebPage/WebPage.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147068 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Dragging to edge should always snap to min/max.
https://bugs.webkit.org/show_bug.cgi?id=113477

Reviewed by Kent Tamura.

Source/WebCore:

Dragging to the edge of a slider should always snap to the min/max.

Test: fast/forms/range/range-slow-drag-to-edge.html

* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::setPositionFromPoint):

LayoutTests:

* fast/forms/range/range-slow-drag-to-edge-expected.txt: Added.
* fast/forms/range/range-slow-drag-to-edge.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed gardening. Test Expectations update.

* platform/chromium/TestExpectations:

compositing/rtl tests are failing also on Linux Debug.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed gardening. Test Expectations update.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147073 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Timeline. Refresh is slow when user drags the overview window.
https://bugs.webkit.org/show_bug.cgi?id=113371

Reviewed by Pavel Feldman.

The root of problem is the 300ms delay in scheduleRefresh method.
It was introduced for the case when we add a huge number of records per second.
The scheduleRefresh was written such a way that refresh happened immediately
only for the scrolling operations. Actually we would like to see fast
refresh every time when it is forced by an user action.

In this patch additional flag newRecordWasAdded was added to the
_invalidateAndScheduleRefresh. I made it mandatory because the function
is also used as a callback for an event and it is easy to make a mistake and
interpret the event as the flag.

* inspector/front-end/TimelinePanel.js:
(WebInspector.TimelinePanel.prototype._onCategoryCheckboxClicked):
(WebInspector.TimelinePanel.prototype._durationFilterChanged):
(WebInspector.TimelinePanel.prototype._repopulateRecords):
(WebInspector.TimelinePanel.prototype._onTimelineEventRecorded):
(WebInspector.TimelinePanel.prototype._onRecordsCleared):
(WebInspector.TimelinePanel.prototype._invalidateAndScheduleRefresh):
(WebInspector.TimelinePanel.prototype._scheduleRefresh):
(WebInspector.TimelinePanel.prototype._revealRecord):
(WebInspector.TimelinePanel.prototype._refreshRecords):
(WebInspector.TimelinePanel.prototype.performFilter):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147076 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix for the EFL and GTK ports.

* runtime/CodeCache.cpp:
(JSC::CodeCacheMap::pruneSlowCase): Pass a 0 casted to the int64_t type instead of 0LL
to the std::max call so the arguments' types match.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147079 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed gardening. Test Expectations update.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147080 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CMAKE] Build fix after r147052. Add WebKit2/Shared/Plugins to include path
https://bugs.webkit.org/show_bug.cgi?id=113484

Unreviewed build fix.

Add "WebKit2/Shared/Plugins" to include path for TestWebKitAPI, WebKitTestRunner.

Patch by Jaehun Lim <ljaehun.lim@samsung.com> on 2013-03-28

* TestWebKitAPI/CMakeLists.txt:
* WebKitTestRunner/CMakeLists.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSSRegions] Consolidate use of RenderRegion::isValid
https://bugs.webkit.org/show_bug.cgi?id=113154

Reviewed by David Hyatt.

After https://bugs.webkit.org/show_bug.cgi?id=98752, the list of invalid regions is kept separately than the list of valid regions.
A valid region has always a valid flow thread attached. We can use isValid() throughout the RenderRegion code
instead of testing for both isValid() and m_flowThread.

No new tests since there is no change is functionality, just code refactoring.

* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::addRegionToNamedFlowThread): Added a new function to keep the code
used in addRegionToThread and checkInvalidRegions.
(WebCore::RenderNamedFlowThread::addRegionToThread):
(WebCore::RenderNamedFlowThread::checkInvalidRegions):
* rendering/RenderNamedFlowThread.h:
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::overflowRectForFlowThreadPortion):
(WebCore::RenderRegion::isFirstRegion):
(WebCore::RenderRegion::isLastRegion):
(WebCore::RenderRegion::paintObject):
(WebCore::RenderRegion::nodeAtPoint):
(WebCore::RenderRegion::incrementAutoLogicalHeightCount):
(WebCore::RenderRegion::decrementAutoLogicalHeightCount):
(WebCore::RenderRegion::layoutBlock):
(WebCore::RenderRegion::repaintFlowThreadContentRectangle):
(WebCore::RenderRegion::attachRegion):
(WebCore::RenderRegion::renderBoxRegionInfo):
(WebCore::RenderRegion::setRenderBoxRegionInfo):
(WebCore::RenderRegion::logicalTopOfFlowThreadContentRect):
(WebCore::RenderRegion::logicalBottomOfFlowThreadContentRect):
(WebCore::RenderRegion::computePreferredLogicalWidths):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147082 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Gardening. Organize expected results, because the generic expected file should be the one that uses JSC.
https://bugs.webkit.org/show_bug.cgi?id=113291.

Reviewed by Csaba Osztrogonác.

* inspector/console/console-eval-syntax-error-expected.txt:
* inspector/debugger/debugger-pause-in-eval-script-expected.txt:
* inspector/extensions/extensions-eval-expected.txt:
* platform/chromium/inspector/debugger/debugger-pause-in-eval-script-expected.txt: Copied from LayoutTests/inspector/debugger/debugger-pause-in-eval-script-expected.txt.
* platform/chromium/inspector/extensions/extensions-eval-expected.txt: Copied from LayoutTests/inspector/extensions/extensions-eval-expected.txt.
* platform/mac/inspector/console/console-eval-syntax-error-expected.txt: Removed.
* platform/mac/inspector/debugger/debugger-pause-in-eval-script-expected.txt: Removed.
* platform/mac/inspector/extensions/extensions-eval-expected.txt: Removed.
* platform/qt/inspector/console/console-eval-syntax-error-expected.txt: Removed.
* platform/qt/inspector/debugger/debugger-pause-in-eval-script-expected.txt: Removed.
* platform/qt/inspector/extensions/extensions-eval-expected.txt: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] Convert layout tests region-style-block-background-color[2] to ref-tests
https://bugs.webkit.org/show_bug.cgi?id=86339

Patch by Mihai Tica <mitica@adobe.com> on 2013-03-28
Reviewed by Tony Chang.

This patch converts the pixel test baseline into ref-tests for the following tests:
fast/regions/region-style-block-background-color.html
fast/regions/region-style-block-background-color2.html

* fast/regions/region-style-block-background-color-expected.html: Added.
* fast/regions/region-style-block-background-color.html:
* fast/regions/region-style-block-background-color2-expected.html: Added.
* fast/regions/region-style-block-background-color2.html:
* platform/chromium-linux/fast/regions/region-style-block-background-color-expected.png: Removed.
* platform/chromium-linux/fast/regions/region-style-block-background-color2-expected.png: Removed.
* platform/chromium-mac-lion/fast/regions/region-style-block-background-color-expected.png: Removed.
* platform/chromium-mac-lion/fast/regions/region-style-block-background-color2-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/regions/region-style-block-background-color-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/regions/region-style-block-background-color2-expected.png: Removed.
* platform/chromium-mac/fast/regions/region-style-block-background-color-expected.png: Removed.
* platform/chromium-mac/fast/regions/region-style-block-background-color2-expected.png: Removed.
* platform/chromium-win/fast/regions/region-style-block-background-color-expected.png: Removed.
* platform/chromium-win/fast/regions/region-style-block-background-color-expected.txt: Removed.
* platform/chromium-win/fast/regions/region-style-block-background-color2-expected.png: Removed.
* platform/chromium-win/fast/regions/region-style-block-background-color2-expected.txt: Removed.
* platform/chromium/fast/regions/region-style-block-background-color-expected.txt: Removed.
* platform/chromium/fast/regions/region-style-block-background-color2-expected.txt: Removed.
* platform/efl/fast/regions/region-style-block-background-color-expected.png: Removed.
* platform/efl/fast/regions/region-style-block-background-color-expected.txt: Removed.
* platform/efl/fast/regions/region-style-block-background-color2-expected.png: Removed.
* platform/efl/fast/regions/region-style-block-background-color2-expected.txt: Removed.
* platform/gtk/fast/regions/region-style-block-background-color-expected.png: Removed.
* platform/gtk/fast/regions/region-style-block-background-color-expected.txt: Removed.
* platform/gtk/fast/regions/region-style-block-background-color2-expected.png: Removed.
* platform/gtk/fast/regions/region-style-block-background-color2-expected.txt: Removed.
* platform/mac/fast/regions/region-style-block-background-color-expected.png: Removed.
* platform/mac/fast/regions/region-style-block-background-color-expected.txt: Removed.
* platform/mac/fast/regions/region-style-block-background-color2-expected.png: Removed.
* platform/mac/fast/regions/region-style-block-background-color2-expected.txt: Removed.
* platform/qt/fast/regions/region-style-block-background-color-expected.png: Removed.
* platform/qt/fast/regions/region-style-block-background-color-expected.txt: Removed.
* platform/qt/fast/regions/region-style-block-background-color2-expected.png: Removed.
* platform/qt/fast/regions/region-style-block-background-color2-expected.txt: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147084 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK build fix after r147039.

* Source/autotools/symbols.filter: Export the missing symbols.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147085 268f45cc-cd09-0410-ab3c-d52691b4dbfc
X-Frame-Options: Multiple headers are ignored completely.
https://bugs.webkit.org/show_bug.cgi?id=113387

Reviewed by Nate Chapin.

Source/WebCore:

If a server sends multiple 'X-Frame-Options' headers, we end up with a
value like 'SAMEORIGIN, SAMEORIGIN'. Currently, we're treating that as
invalid, and ignoring the header. It would be safer to follow Gecko's
lead[1] by:

- Folding duplicated entries into their common value (that is:
  'sameorigin, sameorigin' -> 'sameorigin').

- Failing closed in the case of conflicts (that is:
  'sameorigin, allowall' -> 'deny').

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=761655

Tests: http/tests/security/XFrameOptions/x-frame-options-multiple-headers-conflict.html
       http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-allow.html
       http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
    Call out to parseXFrameOptionsHeader to get the header's disposition
    and deal with each case in a switch statement for clarity. Add a new
    console warning for the conflict case described above.
* platform/network/HTTPParsers.cpp:
(WebCore::parseXFrameOptionsHeader):
* platform/network/HTTPParsers.h:
    Move X-Frame-Options parsing out into HTTPParsers, as it's getting
    more and more complicated. To do this, the patch defines a new enum
    to pass around the header's disposition.

LayoutTests:

* http/tests/security/XFrameOptions/resources/x-frame-options-multiple-headers-conflict.cgi: Added.
* http/tests/security/XFrameOptions/resources/x-frame-options-multiple-headers-sameorigin.cgi: Added.
* http/tests/security/XFrameOptions/x-frame-options-multiple-headers-conflict-expected.txt: Added.
* http/tests/security/XFrameOptions/x-frame-options-multiple-headers-conflict.html: Added.
* http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-allow-expected.txt: Added.
* http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-allow.html: Added.
* http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt: Added.
* http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny.html: Added.
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-conflict-expected.txt: Added.
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-allow-expected.txt: Added.
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147086 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Regression: Crash when selecting Hebrew and numbers in a list
https://bugs.webkit.org/show_bug.cgi?id=111894

Patch by Arpita Bahuguna <a.bah@samsung.com> on 2013-03-28
Reviewed by Ryosuke Niwa.

Source/WebCore:

There is a crash when trying to click/select an anonymous
renderer.

This is a regression due to r143313 which tries to add border/padding
to the computed caret rect in RenderBox::localCaretRect().
The patch calls on the node() method for the corresponding
renderer. For an anonymous renderer though, node() returns
null. Since no check had been added for this, a crash occurs when
caret rect for an anonymous renderer is being computed.

Test: editing/selection/click-on-anonymous-content-crash.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::localCaretRect):
Added a check for validating the return from the node() call.

LayoutTests:

* editing/selection/click-on-anonymous-content-crash-expected.txt: Added.
* editing/selection/click-on-anonymous-content-crash.html: Added.
Added a testcase for verifying that no crash occurs when trying to
select/click an anonymous renderer, in this case the list marker's
renderer.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Fixed property text indentation in Styles sidebar.
https://bugs.webkit.org/show_bug.cgi?id=113409

Patch by Vladislav Kaznacheev <kaznacheev@chromium.org> on 2013-03-28
Reviewed by Alexander Pavlov.

When the sidebar is too narrow and the property text wraps around it breaks the indentation.
This was introduced in r143207 which spuriously modified DOM elements order.

* inspector/front-end/StylesSidebarPane.js:

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