[Mac] respect in-band caption color
https://bugs.webkit.org/show_bug.cgi?id=109203

Reviewed by Dean Jackson.

Source/WebCore: 

Test: media/track/track-in-band-style.html

* WebCore.xcodeproj/project.pbxproj: Add HTMLDivElement.h to private headers because it is 
    included by HTMLTextElement, which is included by HTMLMediaElement.h, which is included 
    by files in WebKit/WebKit2.
* html/track/InbandTextTrack.cpp:
(WebCore::InbandTextTrack::addGenericCue): Set cue colors if necessary.

* html/track/TextTrackCue.h:
(WebCore::TextTrackCue::element): New, accessor for the cue element so it can be styled.

* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): Set container and cue background 
    color if necessary.
(WebCore::TextTrackCueGeneric::operator==): Compare cue colors.
* html/track/TextTrackCueGeneric.h:
(WebCore::TextTrackCueGeneric::foregroundColor): Add color accessors.
(WebCore::TextTrackCueGeneric::setForegroundColor):
(WebCore::TextTrackCueGeneric::backgroundColor):
(WebCore::TextTrackCueGeneric::setBackgroundColor):

* page/CaptionUserPreferencesMac.mm:
(WebCore::CaptionUserPreferencesMac::registerForCaptionPreferencesChangedCallbacks): Always
    regenerate override CSS when an element registers for callbacks.
(WebCore::CaptionUserPreferencesMac::captionsWindowCSS): Drive by fix of "window color" padding.
(WebCore::CaptionUserPreferencesMac::captionsStyleSheetOverride): Log the stylesheet generated
    for easier debugging.

* platform/graphics/InbandTextTrackPrivateClient.h:
(WebCore::GenericCueData::foregroundColor): Add color getters/setters.
(WebCore::GenericCueData::setForegroundColor):
(WebCore::GenericCueData::backgroundColor):
(WebCore::GenericCueData::setBackgroundColor):

* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::makeRGBA32FromARGBCFArray): Initialize a RGBA32 from a CFArray of color values.
(WebCore::InbandTextTrackPrivateAVF::processCueAttributes): Process cue colors.

LayoutTests: 

* media/track/track-in-band-style-expected.txt: Added.
* media/track/track-in-band-style.html: Added.

* platform/chromium/TestExpectations: Skip new test.
* platform/efl/TestExpectations: Ditto.
* platform/gtk/TestExpectations: Ditto.
* platform/mac/TestExpectations: Ditto.
* platform/qt/TestExpectations: Ditto.
* platform/win/TestExpectations: Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix ASSERT when the Web Content Process crashes
https://bugs.webkit.org/show_bug.cgi?id=109346

Reviewed by Simon Fraser.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidCrash):
We need to remove ourselves as a message receiver before calling out to the client, as
the client might want to re-add us (as Safari does).

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: show whitespace characters in DTE
https://bugs.webkit.org/show_bug.cgi?id=108947

Patch by Andrey Lushnikov <lushnikov@chromium.org> on 2013-02-09
Reviewed by Pavel Feldman.

Source/WebCore:

New test: inspector/editor/text-editor-show-whitespaces.html

Split consecutive whitespace characters into groups of 16, 8, 4, 2 and 1 and
add ::before pseudoclass for this groups which contains necessary
amount of "dots" (u+00b7). Add a setting "Show whitespace" for this
option in "Sources" section of "General" tab.

* English.lproj/localizedStrings.js:
* inspector/front-end/DefaultTextEditor.js:
(WebInspector.TextEditorMainPanel.prototype.wasShown):
(WebInspector.TextEditorMainPanel.prototype.willHide):
(WebInspector.TextEditorMainPanel.prototype._renderRanges):
(WebInspector.TextEditorMainPanel.prototype._renderWhitespaceCharsWithFixedSizeSpans):
(WebInspector.TextEditorMainPanel.prototype._paintLine):
* inspector/front-end/Settings.js:
* inspector/front-end/SettingsScreen.js:
(WebInspector.GenericSettingsTab):
* inspector/front-end/inspectorSyntaxHighlight.css:
(.webkit-whitespace-1::before):
(.webkit-whitespace-2::before):
(.webkit-whitespace-4::before):
(.webkit-whitespace-8::before):
(.webkit-whitespace-16::before):
(.webkit-whitespace::before):

LayoutTests:

Add layout test to verify whitespace highlight functionality.

* inspector/editor/text-editor-show-whitespace-expected.txt: Added.
* inspector/editor/text-editor-show-whitespace.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, another GTK+ build fix after r142343.

* Source/autotools/symbols.filter: Expose the InlineBox delete operator.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142352 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed EFL gardening.

Rebaseline fast/text/international/bidi-ignored-for-first-child-inline.html
after r142152.

* platform/efl/TestExpectations:
* platform/efl/fast/text/international/bidi-ignored-for-first-child-inline-expected.png:
* platform/efl/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening.

* platform/gtk/TestExpectations: Adding a failure expectation for the test introduced in r142335.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142354 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][Qt][WebGL] Share the common code between GraphicsSurfaceGLX and X11WindowResources.
https://bugs.webkit.org/show_bug.cgi?id=106666

Patch by Kondapally Kalyan <kalyan.kondapally@intel.com> on 2013-02-09
Reviewed by Kenneth Rohde Christiansen.

Covered by existing WebGL tests.

This patch removes any duplicate code in X11WindowResources and
GraphicsSurfaceGLX. No new functionality is added.

* PlatformEfl.cmake:
* Target.pri:
* platform/graphics/surfaces/egl/EGLConfigSelector.cpp:
(WebCore::EGLConfigSelector::pixmapContextConfig):
* platform/graphics/surfaces/egl/EGLConfigSelector.h:
(EGLConfigSelector):
* platform/graphics/surfaces/egl/EGLSurface.cpp:
(WebCore::EGLWindowTransportSurface::EGLWindowTransportSurface):
(WebCore::EGLWindowTransportSurface::destroy):
(WebCore::EGLWindowTransportSurface::setGeometry):
* platform/graphics/surfaces/egl/EGLSurface.h:
(WebCore):
(EGLWindowTransportSurface):
* platform/graphics/surfaces/glx/GLXConfigSelector.h:
(WebCore::GLXConfigSelector::GLXConfigSelector):
(WebCore::GLXConfigSelector::visualInfo):
(WebCore::GLXConfigSelector::pBufferContextConfig):
(WebCore::GLXConfigSelector::createSurfaceConfig):
(GLXConfigSelector):
* platform/graphics/surfaces/glx/GLXContext.cpp:
(WebCore::initializeARBExtensions):
(WebCore::GLXOffScreenContext::GLXOffScreenContext):
(WebCore::GLXOffScreenContext::initialize):
(WebCore::GLXOffScreenContext::platformReleaseCurrent):
(WebCore::GLXOffScreenContext::freeResources):
* platform/graphics/surfaces/glx/GLXContext.h:
(GLXOffScreenContext):
* platform/graphics/surfaces/glx/GLXSurface.cpp:
(WebCore::GLXTransportSurface::GLXTransportSurface):
(WebCore::GLXTransportSurface::setGeometry):
(WebCore::GLXTransportSurface::destroy):
(WebCore::GLXPBuffer::initialize):
* platform/graphics/surfaces/glx/GLXSurface.h:
(GLXTransportSurface):
(GLXPBuffer):
* platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp:
(WebCore):
(WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):
(WebCore::GraphicsSurfacePrivate::initialize):
(GraphicsSurfacePrivate):
(WebCore::GraphicsSurfacePrivate::createSurface):
(WebCore::GraphicsSurfacePrivate::createPixmap):
(WebCore::GraphicsSurfacePrivate::display):
(WebCore::GraphicsSurfacePrivate::flags):
(WebCore::GraphicsSurfacePrivate::clear):
(WebCore::GraphicsSurface::platformPaintToTextureMapper):
No new functionality added. Made changes to take the common code into use.

* platform/graphics/surfaces/glx/X11WindowResources.h: Removed.
* platform/graphics/surfaces/glx/X11Helper.cpp: Renamed from Source/WebCore/platform/graphics/surfaces/glx/X11WindowResources.cpp.
(WebCore):
(WebCore::DisplayConnection::DisplayConnection):
(DisplayConnection):
(WebCore::DisplayConnection::~DisplayConnection):
(WebCore::DisplayConnection::display):
(OffScreenRootWindow):
(WebCore::OffScreenRootWindow::OffScreenRootWindow):
(WebCore::OffScreenRootWindow::~OffScreenRootWindow):
(WebCore::OffScreenRootWindow::rootWindow):
(WebCore::X11Helper::resizeWindow):
(WebCore::X11Helper::createOffScreenWindow):
(WebCore::X11Helper::destroyWindow):
(WebCore::X11Helper::isXRenderExtensionSupported):
(WebCore::X11Helper::nativeDisplay):
(WebCore::X11Helper::offscreenRootWindow):
* platform/graphics/surfaces/glx/X11Helper.h: Added.
(WebCore):
(WebCore::handleXPixmapCreationError):
(X11Helper):
(ScopedXPixmapCreationErrorHandler):
(WebCore::ScopedXPixmapCreationErrorHandler::ScopedXPixmapCreationErrorHandler):
(WebCore::ScopedXPixmapCreationErrorHandler::~ScopedXPixmapCreationErrorHandler):
(WebCore::ScopedXPixmapCreationErrorHandler::isValidOperation):
Moved common code from GraphicsSurfaceGLX to X11Helper.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142355 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Drop ExceptionCode from IDB's directionToString and modeToString.
https://bugs.webkit.org/show_bug.cgi?id=109143

Reviewed by Jochen Eisinger.

No caller of either IDBCursor::directionToString or
IDBTransaction::modeToString makes use of the ExceptionCode these
methods require. This patch removes the 'ExceptionCode&' parameter from
both methods and their callsites.

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::direction):
(WebCore::IDBCursor::directionToString):
    Drop the 'ExceptionCode&' parameter, and replace the 'TypeError'
    exception previously generated with ASSERT_NOT_REACHED.
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::mode):
(WebCore::IDBTransaction::modeToString):
    Drop the 'ExceptionCode&' parameter, and replace the 'TypeError'
    exception previously generated with ASSERT_NOT_REACHED.
* Modules/indexeddb/IDBTransaction.h:


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

* platform/chromium/TestExpectations:
Correct encrypted-media-v2-*.html expectation.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix crash by img[ismap] with content property
https://bugs.webkit.org/show_bug.cgi?id=108702

Reviewed by Adam Barth.

Source/WebCore:

Test: fast/dom/HTMLAnchorElement/anchor-ismap-crash.html

* html/HTMLAnchorElement.cpp:
(WebCore::appendServerMapMousePosition):
Check if the renderer of an img element is RenderImage.

LayoutTests:

* fast/dom/HTMLAnchorElement/anchor-ismap-crash-expected.txt: Added.
* fast/dom/HTMLAnchorElement/anchor-ismap-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142358 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add missing copyright header
https://bugs.webkit.org/show_bug.cgi?id=107507

* Resources/pagepopups/chromium/calendarPickerChromium.css:
* Resources/pagepopups/chromium/pickerCommonChromium.css:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142359 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Trying to turn the build.webkit.org builders greener

Unreviewed expectations.

We seem to have an issue with build.webkit.org test bots and
Chromium.WebKit test bots doing different things. This is temporary
until we figure out what went wrong.

* platform/chromium/TestExpectations: Re-adding all the changes due to Skia flags.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142360 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Rolled Chromium DEPS to last-known good revision.
Requested by "Stephen Chenney" <schenney@chromium.org> via
sheriffbot.

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

* DEPS:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142361 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Rolled Chromium DEPS to last-known good revision. Really this time.

* DEPS: 181594


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix TextDocumentParser to play nice with threading
https://bugs.webkit.org/show_bug.cgi?id=109240

Reviewed by Adam Barth.

Before the HTML5 parser re-write the text document parser
was completely custom.  With the HTML5 parser, we just made
the TextDocumentParser use the HTMLDocumentParser with an
artificial script tag.

However, our solution was slightly over-engineered to avoid
lying about the column numbers of the first line of the text document
during parsing. :)

This change makes us use a simpler (and threading-compatible)
solution by just inserting a real "<pre>" tag into the
input stream instead of hacking one together with the treebuilder
and manually setting the Tokenizer state.

fast/parser/empty-text-resource.html covers this case.

* html/parser/TextDocumentParser.cpp:
(WebCore::TextDocumentParser::TextDocumentParser):
(WebCore::TextDocumentParser::insertFakePreElement):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Set mouse document position for mouse event in updateCursor.
https://bugs.webkit.org/show_bug.cgi?id=109094.

Patch by Tiancheng Jiang <tijiang@rim.com> on 2013-02-09
Reviewed by Rob Buis.

RIM PR 246976
Internally Reviewed by Genevieve Mak.

BlackBerry::Platform::MouseEvent have document viewport and document
content position as members. When we create the event, we should initial
them as well.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::updateCursor):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142364 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sanitize m_keyTimes for paced value animations
https://bugs.webkit.org/show_bug.cgi?id=108828

Reviewed by Dirk Schulze.

Source/WebCore:

SVG animations with calcMode=paced calculate new m_keyTimes in
SVGAnimationElement::calculateKeyTimesForCalcModePaced() because paced animations do not
specify keyTimes. If an error occurs while calculating m_keyTimes, and there exists
user-specified values, a crash could occur because the user-specified values were not
sanitized.

This change clears user-specified keyTimes before calculating new ones.

Test: svg/animations/animate-keytimes-crash.html

* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):

LayoutTests:

* svg/animations/animate-keytimes-crash-expected.html: Added.
* svg/animations/animate-keytimes-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[TexMap] Separate classes per file in TextureMapperBackingStore.h
https://bugs.webkit.org/show_bug.cgi?id=109333

Reviewed by Noam Rosenthal.

TextureMapperBackingStore.h had the classes TextureMapperBackingStore,
TextureMapperTiledBackingStore, TextureMapperSurfaceBackingStore and
TextureMapperTile which was quite confusing. Now each one has its
own header and its own source file.

No new tests needed, refactoring only.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/TextureMapperBackingStore.cpp:
* platform/graphics/texmap/TextureMapperBackingStore.h:
* platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp: Added.
(WebCore):
(WebCore::TextureMapperSurfaceBackingStore::setGraphicsSurface):
(WebCore::TextureMapperSurfaceBackingStore::swapBuffersIfNeeded):
(WebCore::TextureMapperSurfaceBackingStore::texture):
(WebCore::TextureMapperSurfaceBackingStore::paintToTextureMapper):
* platform/graphics/texmap/TextureMapperSurfaceBackingStore.h: Added.
(WebCore):
(TextureMapperSurfaceBackingStore):
(WebCore::TextureMapperSurfaceBackingStore::create):
(WebCore::TextureMapperSurfaceBackingStore::~TextureMapperSurfaceBackingStore):
(WebCore::TextureMapperSurfaceBackingStore::TextureMapperSurfaceBackingStore):
* platform/graphics/texmap/TextureMapperTile.cpp: Added.
(WebCore):
(WebCore::TextureMapperTile::updateContents):
(WebCore::TextureMapperTile::paint):
* platform/graphics/texmap/TextureMapperTile.h: Added.
(WebCore):
(TextureMapperTile):
(WebCore::TextureMapperTile::texture):
(WebCore::TextureMapperTile::rect):
(WebCore::TextureMapperTile::setTexture):
(WebCore::TextureMapperTile::setRect):
(WebCore::TextureMapperTile::~TextureMapperTile):
(WebCore::TextureMapperTile::TextureMapperTile):
* platform/graphics/texmap/TextureMapperTiledBackingStore.cpp: Copied from Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp.
(WebCore):
(WebCore::TextureMapperTiledBackingStore::TextureMapperTiledBackingStore):
(WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
(WebCore::TextureMapperTiledBackingStore::adjustedTransformForRect):
(WebCore::TextureMapperTiledBackingStore::paintToTextureMapper):
(WebCore::TextureMapperTiledBackingStore::drawBorder):
(WebCore::TextureMapperTiledBackingStore::drawRepaintCounter):
(WebCore::TextureMapperTiledBackingStore::createOrDestroyTilesIfNeeded):
(WebCore::TextureMapperTiledBackingStore::updateContents):
(WebCore::TextureMapperTiledBackingStore::texture):
* platform/graphics/texmap/TextureMapperTiledBackingStore.h: Added.
(WebCore):
(TextureMapperTiledBackingStore):
(WebCore::TextureMapperTiledBackingStore::create):
(WebCore::TextureMapperTiledBackingStore::~TextureMapperTiledBackingStore):
(WebCore::TextureMapperTiledBackingStore::setContentsToImage):
(WebCore::TextureMapperTiledBackingStore::rect):
* platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142366 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Text Autosizing] Cleanup change: converter the pointer argument to be a reference since
non-null pointer is always expected.
https://bugs.webkit.org/show_bug.cgi?id=109079

Patch by Anton Vayvod <avayvod@chromium.org> on 2013-02-09
Reviewed by Kenneth Rohde Christiansen.

Cleanup change, no need to add new tests or modify the existing ones.

* rendering/TextAutosizer.cpp:

Changed parameter from a pointer to a reference in the methods below.

(WebCore::TextAutosizer::processSubtree):
(WebCore::TextAutosizer::processCluster):
(WebCore::TextAutosizer::processContainer):
(WebCore::TextAutosizer::isNarrowDescendant):
(WebCore::TextAutosizer::isWiderDescendant):
(WebCore::TextAutosizer::isAutosizingCluster):
(WebCore::TextAutosizer::clusterShouldBeAutosized):
(WebCore::TextAutosizer::measureDescendantTextWidth):

* rendering/TextAutosizer.h: updated method prototypes.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142367 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: Rename AXObject::cachedIsIgnoredValue to lastKnownIsIgnoredValue
https://bugs.webkit.org/show_bug.cgi?id=108238

Reviewed by Chris Fleizach.

Simple refactoring, no new tests.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::getOrCreate):
(WebCore::AXObjectCache::childrenChanged):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::AccessibilityObject):
(WebCore::AccessibilityObject::lastKnownIsIgnoredValue):
(WebCore::AccessibilityObject::setLastKnownIsIgnoredValue):
(WebCore::AccessibilityObject::notifyIfIgnoredValueChanged):
* accessibility/AccessibilityObject.h:
(AccessibilityObject):


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