[EFL][WK2] Use MutexLocker instead of lock()/unlock().
https://bugs.webkit.org/show_bug.cgi?id=101015

Patch by Byungwoo Lee <bw80.lee@samsung.com> on 2012-11-02
Reviewed by Kenneth Rohde Christiansen.

Instead of lock()/unlock(), use MutexLocker in WorkQueue::performWork()
and WorkQueue::performTimerWork().

The locking scope will be more clear and simple with using MutexLocker.

* Platform/efl/WorkQueueEfl.cpp:
(WorkQueue::performWork):
(WorkQueue::insertTimerWorkItem):
(WorkQueue::performTimerWork):
(WorkQueue::dispatchAfterDelay):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
SVG classes cause layering violations in platform Font code
https://bugs.webkit.org/show_bug.cgi?id=98513

Reviewed by Eric Seidel.

Add a contained class to save and restore GlpyhPage state in FontFallbackList.
This allows us to remove the layering violation, and several methods, that
previously existed to support SVGTextRunRenderingContext.

No new tests because no change at all in functionality.

* platform/graphics/FontFallbackList.h:
(FontFallbackList):
(GlyphPagesStateSaver): New state save and restore class
(WebCore::FontFallbackList::GlyphPagesStateSaver::GlyphPagesStateSaver): Save GlyphPage state
(WebCore::FontFallbackList::GlyphPagesStateSaver::~GlyphPagesStateSaver): Restore GlyphPage state
* rendering/svg/SVGTextRunRenderingContext.cpp:
(WebCore::SVGTextRunRenderingContext::glyphDataForCharacter): Shift to usage of the new class.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Console: remove obsolete ctrl-shift-m shortcut
https://bugs.webkit.org/show_bug.cgi?id=101036

Patch by Eugene Klyuchnikov <eustas.bug@gmail.com> on 2012-11-02
Reviewed by Pavel Feldman.

Ctrl-shift-m on console dumps MemoryAgent.getDOMNodeCount
This functionality seems to be obsolete.

* inspector/front-end/ConsoleView.js: Removed shortcut and function.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Regression r130057: Improper preferred width calculation when an inline replaced object, wrapped in an inline flow, follows some text.
https://bugs.webkit.org/show_bug.cgi?id=99442

Patch by Arpita Bahuguna <arpitabahuguna@gmail.com> on 2012-11-02
Reviewed by Levi Weintraub.

Source/WebCore:

Extra width is displayed after an inline replaced object that follows some
text (not ending in a whitespace) within an inline-block. This is due to
the end width (endMin) of the text object being carried forward (via inlineMin)
and added onto the next line containing the inline replaced object.

This was caused as a regression to, or rather became apparent post the fix
http://trac.webkit.org/changeset/130057 which fixed the block's preferred
width when a renderInline with width contained an inline replaced object.

Test: fast/block/block-with-inline-replaced-child-following-text.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeInlinePreferredLogicalWidths):
Introduced another flag (shouldBreakLineAfterText) which is set when
our current Text line (object) does not end in a whitespace, thereby
implying that there could be more text following, for which the end width
needs to be carried forward onto the next line.

In case the following object instead turns out to be an Inline Replaced
object, we should terminate our previous line and reset this extra width.
This is now being handled by checking for the shouldBreakLineAfterText
flag while processing Inline Replaced objects.

Once set, shouldBreakLineAfterText shall be reset only if we get another
Text object that ends in a whitespace, signifying the termination of
that text line. For all other cases, we persist with this flag through
the block's inline contents.

LayoutTests:

* fast/block/block-with-inline-replaced-child-following-text-expected.txt: Added.
* fast/block/block-with-inline-replaced-child-following-text.html: Added.
Test added for verifying the width of the inline-block when an inline replaced
object follows some text object which does not end in a whitespace.

The correct width of our containing box in this case should be 94px which is
determined by the min-width of our text (using ahem font) which is 64px +
the padding - 30px.

Prior to this fix, the trailing end-width from the text (64px) would be carried
onto the next line containing the inline replaced object. This would then make
that line's width as 64px (end width of text) + 30 px (padding) + 50px (width
of our image object) making it 144px in total. This would then incorrectly
define the width of our containing box.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133292 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix test calendar-picker-key-operations.html
https://bugs.webkit.org/show_bug.cgi?id=101020

Reviewed by Kent Tamura.

The test was wrong and failing.

* platform/chromium-win/platform/chromium/fast/forms/calendar-picker/calendar-picker-key-operations-expected.txt:
* platform/chromium/fast/forms/calendar-picker/calendar-picker-key-operations-expected.txt:
* platform/chromium/fast/forms/calendar-picker/calendar-picker-key-operations.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] ASSERT hit for every mouse click
https://bugs.webkit.org/show_bug.cgi?id=100607

Reviewed by Jocelyn Turcotte.

.:

Added a test with a link that contains an <em> tag surrounding the entire inner text.
The test should be run on an assert enabled build and the assert should not be
triggered when tapping the link.

* ManualTests/tap-gesture-on-em-link-tap-highlight-assert.html: Added.

Source/WebCore:

Changed the logic of absolutePathForRenderer to use the first highlight box as the mid box
by uniting the two in case the mid box is empty. This allows the first box to be merged with
the last box should they intersect, and thereby prevents an ASSERT in addHighlightRect that is
triggered by two intersecting boxes being passed to addHighlightRect as separate ones.

Also, this patch removes some superfluous checks for LayoutRect::isEmpty, which is being checked
in LayoutRect::intersects already.

No new tests, but added manual test: ManualTests/tap-gesture-on-em-link-tap-highlight-assert.html

* page/GestureTapHighlighter.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] Add missing variable initialization in PageViewportController

Reviewed by Jocelyn Turcotte.

Updating the viewport state depends on uninitialized booleans
which it should not.

* UIProcess/PageViewportController.cpp:
(WebKit::PageViewportController::PageViewportController):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2][AC] Wrong translation of mouse events
https://bugs.webkit.org/show_bug.cgi?id=100983

Reviewed by Kenneth Rohde Christiansen.

The transform that we build for mouse events is scaled by the scale factor.
The url bar should not be scaled, so it should be scaled in the oposite
direction to compensate for that.

* UIProcess/API/efl/ewk_view.cpp:
(toWebContentTransform):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: NMI instrument NodeRareData::Map. It uses ~250k on nytimes.com
https://bugs.webkit.org/show_bug.cgi?id=101052

Reviewed by Yury Semikhatsky.

I noticed that in many cases cache structures are plain static HashMap, HashSet etc.
MemoryAgent can visit it but instrumentation for these containers report no objectType.
It means that addRootObject method needs to accept objectType property as an argument.
Otherwise I would have had to create a proxy class with proper objectType.

Source/WebCore:

* dom/WebCoreMemoryInstrumentation.cpp:
(WebCore::WebCoreMemoryInstrumentation::reportMemoryUsage):
(WebCore):
* dom/WebCoreMemoryInstrumentation.h:
(WebCoreMemoryInstrumentation):
(WebCore):
* inspector/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):

Source/WTF:

* wtf/MemoryInstrumentation.h:
(WTF::MemoryInstrumentation::addRootObject):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Output Android's device status before running tests on the bots
https://bugs.webkit.org/show_bug.cgi?id=100944

Reviewed by Dirk Pranke.

This adds a new step to the build master which will be run prior to the
actual tests-suites on the Chromium Android tester, and soon the Chromium
Android Perf bot. For each attached device, it outputs the build
information, battery level, battery temperature and username.

The Android tester currently is very flaky, and this will help tremendously
in being able to figure out what's wrong with the bot.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(OutputAndroidDeviceStatus):
(TestFactory.__init__):
* BuildSlaveSupport/chromium/output-android-device-status: Added.
(GetAttachedDevices):
(AndroidDeviceStatus):
(AndroidDeviceStatus.__init__):
(AndroidDeviceStatus._run_adb_command):
(AndroidDeviceStatus.device_type):
(AndroidDeviceStatus.device_build):
(AndroidDeviceStatus.device_fingerprint):
(AndroidDeviceStatus.battery_level):
(AndroidDeviceStatus.battery_temperature):
(AndroidDeviceStatus.username):
(main):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133299 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r133075): plugins/plugin-javascript-access.html is failing
https://bugs.webkit.org/show_bug.cgi?id=101045

Patch by Sudarsana Nagineni <sudarsana.nagineni@intel.com> on 2012-11-02
Reviewed by Kenneth Rohde Christiansen.

Encode the plugin filename in ArgumentCoder<PluginInfo> so that
plugin.filename returns the filename instead of name of the plugin.

* Shared/WebCoreArgumentCoders.cpp:
(CoreIPC::::encode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133300 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Optimize DateTimeFormat::quoteAndAppendLiteral output
https://bugs.webkit.org/show_bug.cgi?id=101040

Reviewed by Kentaro Hara.

Source/WebCore:

In LDML date format pattern, only ASCII alphabet and quote have special
roles. So we don't need to quote the input string if it doesn't contain
them.

No new tests. Updated WebKit/chromium/tests/LocaleWinTest.cpp

* platform/text/DateTimeFormat.cpp:
(WebCore::isASCIIAlphabetOrQuote): A helper to check special characters.
(WebCore::DateTimeFormat::quoteAndAppendLiteral):
Append the input string as is if it has no special character.

Source/WebKit/chromium:

* tests/LocaleWinTest.cpp:
(TEST_F): Update test results.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Fix build on Windows when Qt is configured with -release
https://bugs.webkit.org/show_bug.cgi?id=101041

Patch by Simon Hausmann <simon.hausmann@digia.com> on 2012-11-02
Reviewed by Jocelyn Turcotte.

When Qt is configured with -debug or -release, the release/debug build of for example
QtCore is not available by default. For LLIntExtractor we always need to build debug
_and_ release versions, but we do not actually need any Qt libraries nor qtmain(d).lib.
Therefore we can disable all these features but need to keep $$QT.core.includes in the
INCLUDEPATH for some defines from qglobal.h.

* LLIntOffsetsExtractor.pro:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133302 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] setPlatformStrategies always asserts after r132744
https://bugs.webkit.org/show_bug.cgi?id=100838

Reviewed by Simon Hausmann.

Source/WebCore:

The problem here is that we use QWebSettings::clearMemoryCaches, a WebKit1 API
from the injected bundle, which calls initializeWebCoreQt and it sets the platform
strategies to the one for WebKit1. We should stop using WebKit1 API's from WebKit2
code. In order to keep the behavior, this patch adds exported helpers to WebCore
that can be used from DumpRenderTree and WebKitTestRunner. This is the same idea
as WebCoreTestSupport but these helpers are specific to Qt. Technically we could
add it to the WebKit1 API for the time being, but my goal was to move in the direction
of removing the WebKit1 dependency from WebKitTestRunner. We only build the file
in non production mode.

Basically covered by all tests.

* Target.pri:
* WebCore.pri: We need to link against fontconfig (only in non-production mode) since
initializeTestFonts uses it.
* platform/PlatformStrategies.cpp:
(WebCore): Zero initialize the global static variable as it is expected by the functions
below. It is a side fix. It seems like it has not been shown on debug WebKit2 bots because
common runtime environments tend to zero initialize statics by default - but I don't think
we should rely on that.
* platform/qt/QtTestSupport.cpp: Added. I choose GPL license because code from qwebsettings.cpp
is also under that.
(WebKit):
(WebKit::QtTestSupport::clearMemoryCaches): This is basically a copy of QWebSettings::clearMemoryCaches
without calling initializeWebCoreQt.
(WebKit::QtTestSupport::initializeTestFonts): I moved this code here as well now that we have to expose
symbols from WebCore anyway. The advantage is that now we don't have to build it twice and we don't need
additional files to forward it from the directory of DumpRenderTree for WebKitTestRunner.
I added a call to FontCace::invalidate in the case when the font set has been changed so that it will do
the job even if we would stop clearing all caches between tests. Also moved the call to
QFontDatabase::removeAllApplicationFonts from callers to here.
* platform/qt/QtTestSupport.h:
(WebKit):
(QtTestSupport):

Tools:

Turned test runners to use the new QtTestSupport.

* DumpRenderTree/qt/DumpRenderTree.pro:
* DumpRenderTree/qt/DumpRenderTreeMain.cpp:
(main):
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::DumpRenderTree::open):
* QtTestBrowser/QtTestBrowser.pro:
* QtTestBrowser/qttestbrowser.cpp:
(LauncherApplication::handleUserOptions):
* WebKitTestRunner/InjectedBundle/Target.pri:
* WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp:
(WTR::activateFonts):
* WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp: Removed.
* WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h: Removed.
* WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp:
* WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp:
(WTR::TestRunner::platformInitialize): Removed the comment from here
because it was just lying, apparently two times. First, it is not incorrect
to reinitialize our font set and clear font caches, it is what the tests
expect. Second, the use of QRawFont has nothing to do with the font cache.
* WebKitTestRunner/Target.pri:
* WebKitTestRunner/qt/main.cpp:
(main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Add API unit tests for Ewk_Object
https://bugs.webkit.org/show_bug.cgi?id=101037

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> on 2012-11-02
Reviewed by Kenneth Rohde Christiansen.

Added API unit tests for Ewk_Object.

* PlatformEfl.cmake:
* UIProcess/API/efl/tests/test_ewk2_object.cpp: Added.
(TestEwkObject1):
(TestEwkObject1::create):
(TestEwkObject1::~TestEwkObject1):
(TestEwkObject2):
(TestEwkObject2::create):
(TEST_F):

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

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Rolled DEPS.

* DEPS:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133306 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Change the scope of locking in WorkQueueEfl.cpp.
https://bugs.webkit.org/show_bug.cgi?id=98978

Patch by Byungwoo Lee <bw80.lee@samsung.com> on 2012-11-02
Reviewed by Kenneth Rohde Christiansen.

Release the m_workItemQueueLock and m_timerWorkItemsLock mutexes
immediately after the protected resource is no longer modified to
prevent a possible source of a deadlock.

And additional mutex locker for the m_writeToPipeDescriptor is added
to ensure thread-safety of the sendMessageToThread() function.

* Platform/WorkQueue.h:
(WorkQueue):
* Platform/efl/WorkQueueEfl.cpp:
(WorkQueue::insertTimerWorkItem):
(WorkQueue::performTimerWork):
(WorkQueue::sendMessageToThread):
(WorkQueue::dispatch):
(WorkQueue::dispatchAfterDelay):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133307 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r133303.
http://trac.webkit.org/changeset/133303
https://bugs.webkit.org/show_bug.cgi?id=101068

"Broke qt wk2 build (seems like bots fails to rerun qmake if
needed)" (Requested by kbalazs on #webkit).

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

Source/WebCore:

* Target.pri:
* WebCore.pri:
* platform/PlatformStrategies.cpp:
(WebCore):
* platform/qt/QtTestSupport.h: Removed.

Tools:

* DumpRenderTree/qt/DumpRenderTree.pro:
* DumpRenderTree/qt/DumpRenderTreeMain.cpp:
(main):
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::DumpRenderTree::open):
* DumpRenderTree/qt/QtInitializeTestFonts.cpp: Renamed from Source/WebCore/platform/qt/QtTestSupport.cpp.
(WebKit):
(WebKit::initializeTestFonts):
* DumpRenderTree/qt/QtInitializeTestFonts.h: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp.
(WebKit):
* QtTestBrowser/QtTestBrowser.pro:
* QtTestBrowser/qttestbrowser.cpp:
(LauncherApplication::handleUserOptions):
* WebKitTestRunner/InjectedBundle/Target.pri:
* WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp:
(WTR::activateFonts):
* WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp.
* WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h: Copied from Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp.
* WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp:
(WTR::TestRunner::platformInitialize):
* WebKitTestRunner/Target.pri:
* WebKitTestRunner/qt/main.cpp:
(main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133308 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Network panel grid UI is misaligned after r132888
https://bugs.webkit.org/show_bug.cgi?id=101050

Rollback the change to basic data grid css and move it to the native memory
snapshot datagrid css.

Patch by Alexei Filippov <alph@chromium.org> on 2012-11-02
Reviewed by Alexander Pavlov.

* inspector/front-end/dataGrid.css:
(.data-grid td):
* inspector/front-end/nativeMemoryProfiler.css:
(.native-snapshot-view .data-grid td):

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