Lots of LayoutUnit assertions when loading a Wikipedia article
https://bugs.webkit.org/show_bug.cgi?id=110270

Reviewed by Levi Weintraub.

Change RenderBlock::adjustRectForColumns to ensure that the
endColumn calculation does not overflow.

No new tests, covered by existing tests.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::adjustRectForColumns):
Make the endOffset value be no less than the beforeBorderPadding
value to ensure that endColumn is not negative.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143669 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Threaded HTML Parser fails fast/dom/Document/readystate.html
https://bugs.webkit.org/show_bug.cgi?id=110529

Reviewed by Eric Seidel.

Source/WebCore:

We need to create the tokenizer even when we finish a script-created
parser. Most of the time, the tokenizer has already been created at
this point because it is created by calls to document.write.

Test: fast/parser/body-should-exist-after-open-close.html

* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::finish):

LayoutTests:

This test is a reduction of the original issue.

* fast/parser/body-should-exist-after-open-close-expected.txt: Added.
* fast/parser/body-should-exist-after-open-close.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143670 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Add executable property to cmd file.
Required for executable files to maintain their executable permissions over svn.

* JavaScriptCore.vcxproj/copy-files.cmd: Added property svn:executable.
* WTF.vcxproj/copy-files.cmd: Added property svn:executable.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143671 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] support the lucid version of freetype on precise in DRT
https://bugs.webkit.org/show_bug.cgi?id=107338

Reviewed by Tony Chang.

Source/WebKit/chromium:

Add in a linux-only dependency on Freetype2 so that we can
match the version shipped in Ubuntu Lucid.

* DEPS:

Tools:

Modify the DRT build so that we can optionally link against
a fixed version of Freetype2. This allows us to share pixel test
results across multiple versions of Ubuntu without having to
worry about differences in font rendering.

At the moment this feature is off by default. Eventually it will
be on by default on linux.

Note that this only affects DRT; the regular Chromium binary
(and, for now, content_shell) will still use the system version
of Freetype.

* DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
tables/mozilla/bugs/bug8950.html fails with threaded parser due to attribute duplication
https://bugs.webkit.org/show_bug.cgi?id=110532

Reviewed by Adam Barth.

This is a very basic failure which we should have caught earlier with the html5lib parser
tests, except those use document.write and thus avoid the threaded parser.

AtomicHTMLToken expects its attributes to be unique.  We were not doing that for the
CompactHTMLToken path, and this ancient mozilla table test caught that.

Fixes tables/mozilla/bugs/bug8950.html.

* html/parser/AtomicHTMLToken.h:
(WebCore::AtomicHTMLToken::AtomicHTMLToken):
(WebCore::AtomicHTMLToken::initializeAttributes):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143673 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Remove chromium/public/platform directory
https://bugs.webkit.org/show_bug.cgi?id=110471

Reviewed by Adam Barth.

Part of a larger refactoring series; see tracking bug 82948.

* WebKit.gyp:
* public/platform: Removed.
* public/platform/WebKitPlatformSupport.h: Removed.
* public/platform/android: Removed.
* public/platform/default: Removed.
* public/platform/linux: Removed.
* public/platform/mac: Removed.
* public/platform/win: Removed.
* src/WebKit.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
QuickTime plugin doesn't load when accelerated compositing is disabled
https://bugs.webkit.org/show_bug.cgi?id=110534

Patch by Dima Gorbik <dgorbik@apple.com> on 2013-02-21
Reviewed by Anders Carlsson.

We shouldn't disable accelerated compositing for plugins, because
plugins such as QuickTime rely on this and will try to set other drawing
models that we don't support.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::isAcceleratedCompositingEnabled):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143675 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the build after r143664.

Unreviewed.

* WebCore.exp.in:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25-30% regression in V8 RayTrace test in 32 bit builds with JIT disabled
https://bugs.webkit.org/show_bug.cgi?id=110539

Reviewed by Filip Pizlo.

Change the scale used to lookup pointers in JSGlobalObject::m_specialPointers to be 4 bytes for
the 32 bit version of the interpreter.

* llint/LowLevelInterpreter32_64.asm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add support for testing states changing asynchronously. Apply it to state-url-sets-links-visited.html.
https://bugs.webkit.org/show_bug.cgi?id=109883

Reviewed by Antti Koivisto.

Some tests depends on state change happening asynchronously. This is typically solved by using
timers with a long enough interval.

Timers have the general pitfalls of causing unreliable tests, and forcing unnecessary delays
in the tests.

This patch introduces new testing helpers, shouldBecomeEqual and shouldBecomeEqualToString, to
test a change of state repetively until it succeed (or timeout). Those test functions execute
the condition every 5ms until the test succeed.

The helper shouldBecomeEqualToString is applied on state-url-sets-links-visited.html to illustrate
the concept.

* fast/js/resources/js-test-pre.js:
(_waitForCondition): Generic helper function for the familly shouldBecomeXXX.
(.condition):
(.failureHandler):
(shouldBecomeEqual):
(shouldBecomeEqualToString):

* fast/loader/stateobjects/state-url-sets-links-visited.html:
* platform/wk2/TestExpectations:
state-url-sets-links-visited.html fails on WebKit2 because the visited links table is updated
asynchronously, and the style is only updated after 1 IPC message + 1 timer + 1 IPC message.

The test is changed to use shouldBecomeEqualToString in order to become reliable. If the UIProcess
does not update the style in a reasonable amount of time, the test fails.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix a typo that broke the 32 bit build.

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Better sizing model for Snapshotted plugins
https://bugs.webkit.org/show_bug.cgi?id=110541

Reviewed by Simon Fraser.

Clarify the way we apply sizing rules to snapshotted plug-ins. In
testing we've found that plug-ins smaller than 40px in either
dimension should never be frozen. Also, larger plugins should
be explicitly marked, because often they are the single dominant
element on the page.

As a drive-by, I removed the flag that indicated whether or not
the label should show automatically. It wasn't being used. This is
all determined from the shadow root and its CSS now.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): New values for size thresholds.
(WebCore::HTMLPlugInImageElement::createRenderer): Remove call to setShouldShowSnapshotLabelAutomatically.
(WebCore::classNameForShadowRoot): Remove logging and clearly assign sizing classes.
(WebCore::HTMLPlugInImageElement::updateSnapshotInfo): We don't need the page size any more.
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Use new constant names.
* html/HTMLPlugInImageElement.h:
(HTMLPlugInImageElement): Remove setShouldShowSnapshotLabelAutomatically.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143680 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/fast/encoding/parser-tests-*.html timeout with threaded HTML parser
https://bugs.webkit.org/show_bug.cgi?id=109995

Unreviewed speculative fix for Mac WK1.

It appears that m_frame can be null for Mac WK1.

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
TriState.h should be a Project header
https://bugs.webkit.org/show_bug.cgi?id=110543

Rubber-stamped by Dan Bernstein.

WTF uses a script to copy headers to the build destination, so it isn't
necessary to mark headers as Private/Public (and doing so can be problematic).

* WTF.xcodeproj/project.pbxproj: Mark TriState.h as a Project header.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clean up computePreferredLogicalWidths functions in TableLayout subclasses
https://bugs.webkit.org/show_bug.cgi?id=110515

Reviewed by Tony Chang.

No change in behavior. This is just a cleanup in preparation for other
refactoring to this code.

* rendering/FixedTableLayout.cpp:
(WebCore::FixedTableLayout::calcWidthArray):
Move a FIXME here from computePreferredLogicalWidths. It makes more sense here.
(WebCore::FixedTableLayout::computePreferredLogicalWidths):
-Remove outdated or unhelpful comments.
-Isolate the fixed width codepath to make it a bit less convoluted.
(WebCore::FixedTableLayout::layout):
* rendering/FixedTableLayout.h:
The argument to calcWidthArray is never used. Remove it.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Followup commit for https://bugs.webkit.org/show_bug.cgi?id=110541
from a comment by Jon Lee.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Logic
in conditional was unnecessarily complex.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Invalidate outstanding checkpoints for the background input stream and preload scanner
https://bugs.webkit.org/show_bug.cgi?id=110537

Reviewed by Adam Barth.

fast/tokenizer/write-before-load.html caused duplicate didFailSpeculation() calls for the same checkpoint.
One was triggered by processParsedChunkFromBackgroundParser and the other by resumeParsingAfterScriptExecution.
This change ensures that after we send a checkpoint, it is cleared so it won't be sent again until the next
processParsedChunkFromBackgroundParser().

No new tests because no new functionality.

* html/parser/BackgroundHTMLInputStream.cpp:
(WebCore::BackgroundHTMLInputStream::rewindTo):
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::didFailSpeculation):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::rewindTo):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Split SelectorChecker's fast-checking logic into its own class.
https://bugs.webkit.org/show_bug.cgi?id=106860

Reviewed by Antti Koivisto.

No functional changes, covered by existing tests.

* CMakeLists.txt: Added new class to existing build system.
* GNUmakefile.list.am: Ditto.
* Target.pri: Ditto.
* WebCore.gypi: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* css/CSSAllInOne.cpp: Ditto.
* css/RuleSet.cpp:
(WebCore::RuleData::RuleData): Changed to use SelectorCheckerFastPath.
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matches): Ditto.
* css/SelectorChecker.h:
(SelectorChecker): Move fast path code into SelectorCheckerFastPath.
* css/SelectorCheckerFastPath.cpp: Added.
* css/SelectorCheckerFastPath.h: Added.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::ruleMatches): Changed to use SelectorCheckerFastPath.
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::initialize): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move fastlog2() to WTF/MathExtras.h so it can be used from multiple projects.

Rubberstamped by Geoff Garen.

Source/WebCore:

* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::lruListFor): Remove the inline fastlog2 and use WTF::fastlog2.

Source/WTF:

* wtf/MathExtras.h:
(WTF::fastLog2):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow to retrieve the request data from abstract TextCheckingRequest to be accessible for WK2
https://bugs.webkit.org/show_bug.cgi?id=110208

Reviewed by Hajime Morrita.

Source/WebCore:

The WebCore changes are required to implement asynchronous spell checking in WK2.
The idea of asynchronous spell checking in WK1 is to pass the pointer to the abstract object
to the client who is able to verify the given text and notify the WebCore about results.
WK2 will extract the request data and pass it (with additional information) to the UIProcess.

No new tests, covered by editing/spelling tests.

* editing/Editor.cpp:
(WebCore::Editor::markAndReplaceFor):
Extract the request data as it is the member of 'TextCheckingRequest'.

* editing/SpellChecker.cpp:
(WebCore):
(WebCore::SpellCheckRequest::didCancel):
(WebCore::SpellCheckRequest::setCheckerAndSequence):
(WebCore::SpellChecker::requestCheckingFor):
(WebCore::SpellChecker::enqueueRequest):
(WebCore::SpellChecker::didCheck):
(WebCore::SpellChecker::didCheckSucceed):
* platform/text/TextChecking.h:
(WebCore):
(TextCheckingRequestData):
Introduce a new 'TextCheckingRequestData' class to keep the request data and to
easy extract it from the 'TextCheckingRequest'.

(WebCore::TextCheckingRequestData::TextCheckingRequestData):
(TextCheckingRequest):
(WebCore::TextCheckingRequest::~TextCheckingRequest):

Source/WebKit/blackberry:

* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::requestCheckingOfString):
Extract the request data as it is the member of 'TextCheckingRequest'.

Source/WebKit/chromium:

* src/EditorClientImpl.cpp:
(WebKit::EditorClientImpl::requestCheckingOfString):
Extract the request data as it is the member of 'TextCheckingRequest'.

Source/WebKit/mac:

* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::didCheckSucceed):
(WebEditorClient::requestCheckingOfString):
Extract the request data as it is the member of 'TextCheckingRequest'.


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