WebKit-https.git
4 years agoSimple line layout: Introduce text fragment continuation.
zalan@apple.com [Thu, 20 Nov 2014 15:22:02 +0000 (15:22 +0000)]
Simple line layout: Introduce text fragment continuation.
https://bugs.webkit.org/show_bug.cgi?id=138274

Source/WebCore:

This patch extends simple line layout coverage to multiple text renderers.
When a particular render flow has multiple text renderers (but not any other type)
then we use simple line layout to process and paint the content. -other, existing requirements still apply
so that for example if the content requires decoration, we bail out of simple line layout.

FlowContent now supports multiple renderes. It continuously reads content from sibling renderers
so that the simple line layout parser sees it as one monolithic block of content. Run positions
are all relative to the block and they get resolved to renderer's positions on demand.
(painting, computing bounding rects etc)

Reviewed by Antti Koivisto.

Performance test already been added for the multiple rendere use case,
correctness is covered by existing test cases.
Test: fast/text/simple-lines-mutliple-renderers.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseFor): Check if children are all 8bit RenderTexts.
(WebCore::SimpleLineLayout::removeTrailingWhitespace): Move the endofline check right before where we might overflow using end position.
(WebCore::SimpleLineLayout::initializeNewLine):
(WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
(WebCore::SimpleLineLayout::splitRunsAtRendererBoundary): Split runs at renderers' boundary to be in sync with inline text renderering.
(WebCore::SimpleLineLayout::createTextRuns):
(WebCore::SimpleLineLayout::create):
* rendering/SimpleLineLayoutFlowContents.cpp:
(WebCore::SimpleLineLayout::FlowContents::FlowContents):
(WebCore::SimpleLineLayout::FlowContents::findNextBreakablePosition):
(WebCore::SimpleLineLayout::FlowContents::findNextNonWhitespacePosition):
(WebCore::SimpleLineLayout::FlowContents::textWidth): Do not measure text across renderers. It could produce different width value due to
ligature which later can produce unexpected line breaks and out sync renderering in general.
(WebCore::SimpleLineLayout::FlowContents::renderer):
(WebCore::SimpleLineLayout::FlowContents::resolveRendererPositions):
(WebCore::SimpleLineLayout::FlowContents::appendNextRendererContentIfNeeded): Read the next renderer content if needed.
(WebCore::SimpleLineLayout::FlowContents::nextNonWhitespacePosition):
(WebCore::SimpleLineLayout::FlowContents::runWidth):
* rendering/SimpleLineLayoutFlowContents.h:
(WebCore::SimpleLineLayout::FlowContents::isNewlineCharacter):
(WebCore::SimpleLineLayout::FlowContents::isEndOfContent):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::Run::text):

LayoutTests:

Rebaseline for simple line layout's multiple rendere support.

Reviewed by Antti Koivisto.

* fast/text/simple-lines-multiple-renderers-expected.html: Added.
* fast/text/simple-lines-multiple-renderers.html: Added.
* fast/tokenizer/script_extra_close-expected.txt: Multiple tab characters should collapse into a single whitespace. This
needs fixing in complex line layout.
* tables/mozilla/bugs/bug157890-expected.txt: no-op endofline run is added by complex inline layout
when multiple text content is injected through JS into a <pre>. This requires fixing complex line layout.

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

4 years ago[WinCairo] Compile error when GStreamer is enabled.
commit-queue@webkit.org [Thu, 20 Nov 2014 15:20:37 +0000 (15:20 +0000)]
[WinCairo] Compile error when GStreamer is enabled.
https://bugs.webkit.org/show_bug.cgi?id=138925

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-11-20
Reviewed by Philippe Normand.

A guard is missing for an overridden method.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:

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

4 years ago[GTK] Provide convenience API in DOM bindings to post messages to user message handlers
commit-queue@webkit.org [Thu, 20 Nov 2014 12:46:15 +0000 (12:46 +0000)]
[GTK] Provide convenience API in DOM bindings to post messages to user message handlers
https://bugs.webkit.org/show_bug.cgi?id=138871

Patch by Adrian Perez de Castro <aperez@igalia.com> on 2014-11-20
Reviewed by Carlos Garcia Campos.

Source/WebCore:

Adds a convenience function in the WebKitGTK+ DOM bindings to post
messages to user message handlers in a way convenient way more
convenient than using the autogenerated bindings.

* bindings/gobject/WebKitDOMCustom.cpp:
(webkit_dom_dom_window_webkit_message_handlers_post_message):
Added new convenience API function to post messages to user message
handlers.
* bindings/gobject/WebKitDOMCustom.h: Ditto.
* bindings/gobject/WebKitDOMCustom.symbols: Ditto.

Tools:

Add a test case for the convenience API for posting user messages
added to the DOM bindings.

* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitUserContentManager.cpp:
(testUserContentManagerMessageFromConvenienceDOMBindings):
(beforeAll):
* TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
(documentLoadedCallback):

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

4 years ago[CSS Grid Layout] Replace the usage of size_t by unsigned
svillar@igalia.com [Thu, 20 Nov 2014 09:49:17 +0000 (09:49 +0000)]
[CSS Grid Layout] Replace the usage of size_t by unsigned
https://bugs.webkit.org/show_bug.cgi?id=136218

Reviewed by Benjamin Poulain.

In general, size_t should be used for sizes of objects in
memory. We're using it to represent indexes and spans in the
grid. Now that the maximum number of tracks is 1 million, it
should be safe to replace them by unsigned integers.

No new tests as there is no change in functionality.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridTrackRepeatFunction):
* css/StyleResolver.cpp:
(WebCore::createImplicitNamedGridLinesFromGridArea):
(WebCore::createGridTrackList):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::GridIterator::GridIterator):
(WebCore::RenderGrid::GridIterator::nextGridItem):
(WebCore::RenderGrid::GridIterator::isEmptyAreaEnough):
(WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
(WebCore::RenderGrid::GridSizingData::GridSizingData):
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::gridTrackSize):
(WebCore::RenderGrid::distributeSpaceToTracks):
(WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
(WebCore::RenderGrid::ensureGridSize):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
(WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
(WebCore::RenderGrid::populateGridPositions):
* rendering/RenderGrid.h:
* rendering/style/GridCoordinate.h:
(WebCore::GridSpan::integerSpan):
* rendering/style/GridResolvedPosition.cpp:
(WebCore::GridResolvedPosition::explicitGridColumnCount):
(WebCore::GridResolvedPosition::explicitGridRowCount):
(WebCore::explicitGridSizeForSide):
(WebCore::GridResolvedPosition::resolveNamedGridLinePositionFromStyle):
(WebCore::GridResolvedPosition::resolveGridPositionFromStyle):
(WebCore::GridResolvedPosition::resolveGridPositionAgainstOppositePosition):
(WebCore::firstNamedGridLineBeforePosition):
(WebCore::GridResolvedPosition::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
(WebCore::GridResolvedPosition::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
* rendering/style/GridResolvedPosition.h:
(WebCore::GridResolvedPosition::adjustGridPositionForRowEndColumnEndSide):
(WebCore::GridResolvedPosition::adjustGridPositionForSide):
(WebCore::GridResolvedPosition::GridResolvedPosition):
(WebCore::GridResolvedPosition::toInt):
* rendering/style/StyleGridData.h:

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

4 years agoRemove "document has no sibling rules" optimization.
akling@apple.com [Thu, 20 Nov 2014 08:43:25 +0000 (08:43 +0000)]
Remove "document has no sibling rules" optimization.
<https://webkit.org/b/138902>

Reviewed by Antti Koivisto.

We were keeping a document-level flag to track whether there are any
sibling rules in any active style sheets.

This information was used to do.. nothing.

* css/StyleResolver.h:
(WebCore::StyleResolver::usesSiblingRules): Deleted.
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
(WebCore::DocumentStyleSheetCollection::combineCSSFeatureFlags):
(WebCore::DocumentStyleSheetCollection::resetCSSFeatureFlags):
* dom/DocumentStyleSheetCollection.h:
(WebCore::DocumentStyleSheetCollection::usesSiblingRules): Deleted.
(WebCore::DocumentStyleSheetCollection::setUsesSiblingRulesOverride): Deleted.
* mathml/MathMLMathElement.cpp:
(WebCore::MathMLMathElement::insertedInto): Deleted.
* mathml/MathMLMathElement.h:

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

4 years agoCaret renderer is always a RenderBlock.
akling@apple.com [Thu, 20 Nov 2014 08:36:11 +0000 (08:36 +0000)]
Caret renderer is always a RenderBlock.
<https://webkit.org/b/138912>

Reviewed by Chris Dumez.

Tighten typing in the code that finds and deals with the renderer
used to paint the caret (it's always a RenderBlock.)

* editing/FrameSelection.cpp:
(WebCore::CaretBase::updateCaretRect):
(WebCore::FrameSelection::caretRendererWithoutUpdatingLayout):
(WebCore::DragCaretController::caretRenderer):
(WebCore::repaintCaretForLocalRect):
(WebCore::CaretBase::paintCaret):
* editing/FrameSelection.h:
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::absoluteCaretBounds):
* editing/htmlediting.cpp:
(WebCore::rendererForCaretPainting):
(WebCore::localCaretRectInRendererForCaretPainting):
(WebCore::absoluteBoundsForLocalCaretRect):
* editing/htmlediting.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintCaret):

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

4 years ago[GTK] URTBF after r176363.
ossy@webkit.org [Thu, 20 Nov 2014 08:29:51 +0000 (08:29 +0000)]
[GTK] URTBF after r176363.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::setTextIndicator):
* UIProcess/API/gtk/PageClientImpl.h:

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

4 years agoREGRESSION (r172854): Web Viewer in FileMaker does not render a Base64 encoded animat...
antti@apple.com [Thu, 20 Nov 2014 08:23:19 +0000 (08:23 +0000)]
REGRESSION (r172854): Web Viewer in FileMaker does not render a Base64 encoded animated-GIF
https://bugs.webkit.org/show_bug.cgi?id=138807
<rdar://problem/18829540>

Reviewed by Simon Fraser.

Animation gets paused because WebKit thinks the GIF is outside of the view.

* page/FrameView.cpp:
(WebCore::FrameView::windowClipRect):

We need to convert to window coordinates in paintsEntireContents mode too so these functions are consistent.
This matters with some WK1 API clients.

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

4 years agoMove 'clip' CSS property to the new StyleBuilder
cdumez@apple.com [Thu, 20 Nov 2014 07:42:19 +0000 (07:42 +0000)]
Move 'clip' CSS property to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=138909

Reviewed by Andreas Kling.

Move 'clip' CSS property from DeprecatedStyleBuilder to the new
StyleBuilder by using custom code.

No new tests, no behavior change.

* css/CSSPropertyNames.in:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
(WebCore::ApplyPropertyClip::convertToLength): Deleted.
(WebCore::ApplyPropertyClip::applyInheritValue): Deleted.
(WebCore::ApplyPropertyClip::applyInitialValue): Deleted.
(WebCore::ApplyPropertyClip::applyValue): Deleted.
(WebCore::ApplyPropertyClip::createHandler): Deleted.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderFunctions::applyInitialClip):
(WebCore::StyleBuilderFunctions::applyInheritClip):
(WebCore::StyleBuilderFunctions::applyValueClip):

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

4 years agoDon't track sub-resources that are started after main frame progress has completed.
commit-queue@webkit.org [Thu, 20 Nov 2014 05:45:52 +0000 (05:45 +0000)]
Don't track sub-resources that are started after main frame progress has completed.
https://bugs.webkit.org/show_bug.cgi?id=138582

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2014-11-19
Reviewed by Sam Weinig.

After main frame progress has finished, starting loading a sub-resource shouldn't affect
UI process's view of page loading status (i.e., the page has already completed loading
and the progress shouldn't change). To achive that, don't track the subresources that
are started after the main frame has finished, except for those triggered by user interaction.

* WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp:  Notify WebPage that the main frame progress
    has started or finished.
(WebKit::WebProgressTrackerClient::progressStarted):
(WebKit::WebProgressTrackerClient::progressFinished):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::addResourceRequest): Don't track the resource request if it is initiated after
    the main frame is loaded and it is not triggered by user interaction.
(WebKit::WebPage::removeResourceRequest):
* WebProcess/WebPage/WebPage.h: Rename m_networkResourceRequestIdentifiers to m_trackedNetworkResourceRequestIdentifiers.
(WebKit::WebPage::setMainFrameProgressCompleted):

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

4 years agoRemove dead code from TiledBackingStore
ryuan.choi@navercorp.com [Thu, 20 Nov 2014 05:35:49 +0000 (05:35 +0000)]
Remove dead code from TiledBackingStore
https://bugs.webkit.org/show_bug.cgi?id=138864

Reviewed by Andreas Kling.

Since r168151, paint() method, m_commitTileUpdatesOnIdleEventLoop and related code are not used.

No new tests, no behavior change.

* platform/graphics/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::TiledBackingStore):
(WebCore::TiledBackingStore::setTileSize):
(WebCore::TiledBackingStore::invalidate):
(WebCore::TiledBackingStore::createTiles):
(WebCore::TiledBackingStore::paint): Deleted.
(WebCore::TiledBackingStore::startTileBufferUpdateTimer): Deleted.
(WebCore::TiledBackingStore::tileBufferUpdateTimerFired): Deleted.
(WebCore::TiledBackingStore::startBackingStoreUpdateTimer): Deleted.
(WebCore::TiledBackingStore::backingStoreUpdateTimerFired): Deleted.
* platform/graphics/TiledBackingStore.h:
(WebCore::TiledBackingStore::setCommitTileUpdatesOnIdleEventLoop): Deleted.

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

4 years agoFix typos in r176203.
rniwa@webkit.org [Thu, 20 Nov 2014 04:28:37 +0000 (04:28 +0000)]
Fix typos in r176203.

* public/v2/app.js:
(App.ChartsController.actions.addPaneByMetricAndPlatform):
(App.AnalysisTaskRoute):

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

4 years agoWeb Inspector: LayoutTests/inspector should not have localStorage side effects
commit-queue@webkit.org [Thu, 20 Nov 2014 02:19:12 +0000 (02:19 +0000)]
Web Inspector: LayoutTests/inspector should not have localStorage side effects
https://bugs.webkit.org/show_bug.cgi?id=138895

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-11-19
Reviewed by Brian Burg.

When running inspector tests, do not restore/save WebInspector.Settings
to localStorage, as that will cause side effects. Instead each Setting
will be initialized with its default value and can be modified during
the run of the test.

* UserInterface/Base/Test.js:
(WebInspector.loaded):
Name the setting to match the normal setting name now that persistence
is not an issue.

* UserInterface/Models/Setting.js:
(WebInspector.Setting.prototype.get value):
(WebInspector.Setting.prototype.set value):
Do not restore/save when in tests.

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

4 years ago[EFL] Fix build failure since r176363.
gyuyoung.kim@samsung.com [Thu, 20 Nov 2014 02:03:47 +0000 (02:03 +0000)]
[EFL] Fix build failure since r176363.
https://bugs.webkit.org/show_bug.cgi?id=138903

Patch by Sun-woo Nam <sunny.nam@samsung.com> on 2014-11-19
Reviewed by Gyuyoung Kim.

The parameter for animation on setTextIndicator() was removed on 'PageClient' class.

* UIProcess/CoordinatedGraphics/WebView.cpp:
(WebKit::WebView::setTextIndicator):
* UIProcess/CoordinatedGraphics/WebView.h:

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

4 years agoTry to fix the iOS build
timothy_horton@apple.com [Thu, 20 Nov 2014 01:55:54 +0000 (01:55 +0000)]
Try to fix the iOS build

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::performDictionaryLookupForSelection):
(WebKit::WebPage::performDictionaryLookupForRange):

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

4 years agoRemove "document has no ::before and/or ::after rules" optimization.
akling@apple.com [Thu, 20 Nov 2014 01:36:27 +0000 (01:36 +0000)]
Remove "document has no ::before and/or ::after rules" optimization.
<https://webkit.org/b/138897>

Reviewed by Antti Koivisto.

This optimization has been dead for a long time, since the default UA
style contains both ::before and ::after rules.

* css/RuleFeature.cpp:
(WebCore::recursivelyCollectFeaturesFromSelector):
(WebCore::RuleFeatureSet::add):
(WebCore::RuleFeatureSet::clear):
* css/RuleFeature.h:
(WebCore::RuleFeatureSet::RuleFeatureSet):
* css/StyleResolver.h:
(WebCore::StyleResolver::usesBeforeAfterRules): Deleted.
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
(WebCore::DocumentStyleSheetCollection::combineCSSFeatureFlags):
(WebCore::DocumentStyleSheetCollection::resetCSSFeatureFlags):
* dom/DocumentStyleSheetCollection.h:
(WebCore::DocumentStyleSheetCollection::usesBeforeAfterRules): Deleted.
(WebCore::DocumentStyleSheetCollection::setUsesBeforeAfterRulesOverride): Deleted.
* html/HTMLQuoteElement.cpp:
(WebCore::HTMLQuoteElement::insertedInto): Deleted.
* html/HTMLQuoteElement.h:
* style/StyleResolveTree.cpp:
(WebCore::Style::needsPseudoElement):

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

4 years ago[OS X] Upright vertical text is completely broken for multi-code-unit codepoints
mmaxfield@apple.com [Thu, 20 Nov 2014 01:35:09 +0000 (01:35 +0000)]
[OS X] Upright vertical text is completely broken for multi-code-unit codepoints
https://bugs.webkit.org/show_bug.cgi?id=138891

Reviewed by Dan Bernstein.

Source/WebCore:

We were assuming that we can use the string index (in UTF-16) as the glyph
index. This falls down when a single codepoint (and glyph) contians
multiple code units.

Test: platform/mac/fast/text/multiple-codeunit-vertical-upright.html

* platform/graphics/GlyphPage.h:
* platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
(WebCore::GlyphPage::fill):

LayoutTests:

Make sure a single upright vertical multi-code-unit codepoint is rendered the same as
the same codepoint rendered horizontally.

* platform/mac/fast/text/multiple-codeunit-vertical-upright-expected.html: Added.
* platform/mac/fast/text/multiple-codeunit-vertical-upright.html: Added.
* platform/mac/fast/text/resources/multiple-codeunit-vertical-upright.otf: Added.

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

4 years agoAttempt to fix the Apple Internal Mavericks build after <https://trac.webkit.org...
dbates@webkit.org [Thu, 20 Nov 2014 01:23:38 +0000 (01:23 +0000)]
Attempt to fix the Apple Internal Mavericks build after <https://trac.webkit.org/changeset/176347>
(https://bugs.webkit.org/show_bug.cgi?id=136863)

Define enumerator NSHTTPCookieAcceptPolicyExclusivelyFromMainDocumentDomain when building without
the Apple Internal SDK or with the Apple Internal SDK on OS X Mavericks or earlier.

* platform/spi/cf/CFNetworkSPI.h:

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

4 years agoFix the 32-bit build
timothy_horton@apple.com [Thu, 20 Nov 2014 01:16:11 +0000 (01:16 +0000)]
Fix the 32-bit build

* UIProcess/mac/TextIndicatorWindow.mm:
(WebKit::TextIndicatorWindow::setTextIndicator):

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

4 years agoMove the 'quotes' CSS property to the new StyleBuilder
weinig@apple.com [Thu, 20 Nov 2014 01:02:12 +0000 (01:02 +0000)]
Move the 'quotes' CSS property to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=138788

Reviewed by Chris Dumez.

Source/WebCore:

Test: fast/css/content/content-quotes-07.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
Fix the parser to only accept none as a valid primitive identifier. Tested in
the newly added content-quotes-07.html.

* css/CSSPropertyNames.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertQuotes):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
Move "quotes" to the new style builder.

* rendering/style/RenderStyle.h:
Add an initialQuotes() function for use in the auto-generated style builder.

LayoutTests:

Add a test for the behavior of non-valid primitive identifiers being
used with the quotes property.

* fast/css/content/content-quotes-07-expected.txt: Added.
* fast/css/content/content-quotes-07.html: Added.

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

4 years agoHandle unprefixed @keyframes rule
dino@apple.com [Thu, 20 Nov 2014 00:59:09 +0000 (00:59 +0000)]
Handle unprefixed @keyframes rule
https://bugs.webkit.org/show_bug.cgi?id=138899
<rdar://problem/18943117>

Reviewed by Simon Fraser.

Source/WebCore:

Support the parsing of unprefixed @keyframes. In
CSSParser, assign the same token identifier to
the prefixed and unprefixed forms. This will
keep compatibility with older content. If a page
has both forms, then whatever comes last will
win (as it does if you had duplicate names of the same
form).

Tests: animations/unprefixed-keyframes-rule.html
       animations/unprefixed-keyframes.html

* css/CSSGrammar.y.in: Rename the WEBKIT_KEYFRAME_RULE_SYM symbol to
be KEYFRAME_RULE_SYM. Same with KEYFRAMES_SYM.
* css/CSSParser.cpp:
(WebCore::CSSParser::detectAtToken): Look for the @keyframes style
strings and assign the new token values.

LayoutTests:

Tests for @keyframes, both the OM side and the parsing.

* animations/unprefixed-keyframes-expected.txt: Added.
* animations/unprefixed-keyframes-rule-expected.txt: Added.
* animations/unprefixed-keyframes-rule.html: Added.
* animations/unprefixed-keyframes.html: Added.

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

4 years agoMove pseudo-style code from RenderObject to RenderElement.
akling@apple.com [Thu, 20 Nov 2014 00:17:41 +0000 (00:17 +0000)]
Move pseudo-style code from RenderObject to RenderElement.
<https://webkit.org/b/138880>

Reviewed by Antti Koivisto.

Migrate get*PseudoStyle() to RenderElement, and the selection color
functions along with them. This gets rid of a DOM ancestor walk in
pseudo style lookup.

Narrow down some argument types to keep things building.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::logicalLeftSelectionGap):
(WebCore::RenderBlock::logicalRightSelectionGap):
(WebCore::styleForFirstLetter):
(WebCore::RenderBlock::updateFirstLetterStyle):
(WebCore::RenderBlock::createFirstLetterRenderer):
* rendering/RenderBlock.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::getCachedPseudoStyle):
(WebCore::RenderElement::getUncachedPseudoStyle):
(WebCore::RenderElement::selectionColor):
(WebCore::RenderElement::selectionPseudoStyle):
(WebCore::RenderElement::selectionForegroundColor):
(WebCore::RenderElement::selectionEmphasisMarkColor):
(WebCore::RenderElement::selectionBackgroundColor):
* rendering/RenderElement.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::selectionBackgroundColor): Deleted.
(WebCore::RenderObject::selectionColor): Deleted.
(WebCore::RenderObject::selectionPseudoStyle): Deleted.
(WebCore::RenderObject::selectionForegroundColor): Deleted.
(WebCore::RenderObject::selectionEmphasisMarkColor): Deleted.
(WebCore::RenderObject::getCachedPseudoStyle): Deleted.
(WebCore::RenderObject::getUncachedPseudoStyle): Deleted.
* rendering/RenderObject.h:
* rendering/RenderText.h:
(WebCore::RenderText::getCachedPseudoStyle):
(WebCore::RenderText::selectionBackgroundColor):
(WebCore::RenderText::selectionForegroundColor):
(WebCore::RenderText::selectionEmphasisMarkColor):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paintSelectionBackground):
(WebCore::SVGInlineTextBox::paint):

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

4 years agoAdd an optional entry transition (from selection highlight) to TextIndicator
timothy_horton@apple.com [Thu, 20 Nov 2014 00:10:57 +0000 (00:10 +0000)]
Add an optional entry transition (from selection highlight) to TextIndicator
https://bugs.webkit.org/show_bug.cgi?id=138856
<rdar://problem/18840128>

Reviewed by Anders Carlsson.

* Shared/TextIndicator.cpp:
(WebKit::outsetIndicatorRectIncludingShadow):
(WebKit::TextIndicator::createWithRange):
(WebKit::snapshotSelectionWithHighlight):
(WebKit::TextIndicator::createWithSelectionInFrame):
(WebKit::TextIndicator::frameRect):
(WebKit::TextIndicator::Data::encode):
(WebKit::TextIndicator::Data::decode):
Remove TextIndicator::draw and related functions; drawing is handled entirely
by the TextIndicatorWindow now, and TextIndicator just stores the required data.

Unify outsetIndicatorRectIncludingShadow.

Add an argument to createWithRange/createWithSelectionInFrame to indicate
if the TextIndicator should transition from the selection highlight to
the yellow bubble.

If we're doing the transition, paint the selection into a second bitmap,
without forcing the text to black and without hiding the blue highlight.

Encode/decode the second bitmap.

* Shared/TextIndicator.h:
* UIProcess/mac/TextIndicatorWindow.h:
* UIProcess/mac/TextIndicatorWindow.mm:
(-[WKTextIndicatorView initWithFrame:textIndicator:margin:transitionFromSelectionColor:]):
(-[WKTextIndicatorView presentWithCompletionHandler:]):
(-[WKTextIndicatorView hideWithCompletionHandler:]):
(-[WKTextIndicatorView isFlipped]):
(WebKit::TextIndicatorWindow::TextIndicatorWindow):
(WebKit::TextIndicatorWindow::setTextIndicator):
(WebKit::TextIndicatorWindow::closeWindow):
(WebKit::TextIndicatorWindow::startFadeOutTimerFired):
Re-implement the bounce animation using CoreAnimation instead of
the WKSI-based WKWindowBounceAnimation*.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performDictionaryLookupForSelection):
(WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
(WebKit::WebPage::performDictionaryLookupForRange):
(WebKit::WebPage::performActionMenuHitTestAtLocation):
* WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
Use the aforementioned transition animation for performDictionaryLookupOfCurrentSelection,
the context menu lookup item, and for Data Detectors.

* WebCore.exp.in:
Add an export.

* platform/spi/cocoa/QuartzCoreSPI.h:
Add some SPI.

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

4 years agoAdd a version of API::Data::createWithoutCopying that takes an NSData
andersca@apple.com [Thu, 20 Nov 2014 00:02:22 +0000 (00:02 +0000)]
Add a version of API::Data::createWithoutCopying that takes an NSData
https://bugs.webkit.org/show_bug.cgi?id=138893

Reviewed by Dan Bernstein.

* Shared/APIData.h:
* Shared/Cocoa/APIDataCocoa.mm: Added.
(API::Data::createWithoutCopying):
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]):
(releaseNSData): Deleted.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):

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

4 years agoWork around the fact that different masters may have different names for their codebases.
dburkart@apple.com [Wed, 19 Nov 2014 23:58:03 +0000 (23:58 +0000)]
Work around the fact that different masters may have different names for their codebases.
https://bugs.webkit.org/show_bug.cgi?id=138878

Reviewed by Mark Rowe.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotIteration.js:
(parseRevisionProperty): Changed.
Take a "fallback key" in addition to the primary key, so we can deal with inconsistencies in
opensource / internal codebase naming convention.

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

4 years agoMove 'outline-style' CSS property to the new StyleBuilder
cdumez@apple.com [Wed, 19 Nov 2014 23:53:11 +0000 (23:53 +0000)]
Move 'outline-style' CSS property to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=138882

Reviewed by Sam Weinig.

Move 'outline-style' CSS property from DeprecatedStyleBuilder to the
new StyleBuilder by using custom code.

No new tests, no behavior change.

* css/CSSPropertyNames.in:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
(WebCore::ApplyPropertyDefault::setValue): Deleted.
(WebCore::ApplyPropertyDefault::applyValue): Deleted.
(WebCore::ApplyPropertyDefault::createHandler): Deleted.
(WebCore::ApplyPropertyOutlineStyle::applyInheritValue): Deleted.
(WebCore::ApplyPropertyOutlineStyle::applyInitialValue): Deleted.
(WebCore::ApplyPropertyOutlineStyle::applyValue): Deleted.
(WebCore::ApplyPropertyOutlineStyle::createHandler): Deleted.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderFunctions::applyInheritOutlineStyle):
(WebCore::StyleBuilderFunctions::applyInitialOutlineStyle):
(WebCore::StyleBuilderFunctions::applyValueOutlineStyle):

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

4 years agoWeb Inspector: JSContext inspection Resource search does not work
joepeck@webkit.org [Wed, 19 Nov 2014 23:49:40 +0000 (23:49 +0000)]
Web Inspector: JSContext inspection Resource search does not work
https://bugs.webkit.org/show_bug.cgi?id=131252

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::searchInContent):
* inspector/protocol/Debugger.json:
Do some cleanup of the description and implementation of content searching.

Source/WebCore:

Test: inspector/debugger/search-scripts.html

* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::searchInResources):
A little cleanup.

Source/WebInspectorUI:

* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype.performSearch.resourceCallback):
(WebInspector.ResourceSidebarPanel.prototype.performSearch.resourcesCallback):
Cleanup by reordering things a bit.

(WebInspector.ResourceSidebarPanel.prototype.performSearch.searchScripts.scriptCallback):
(WebInspector.ResourceSidebarPanel.prototype.performSearch.searchScripts):
(WebInspector.ResourceSidebarPanel.prototype.performSearch):
Search non-resource scripts individually.

(WebInspector.ResourceSidebarPanel.prototype._searchTreeElementForScript):
Lazily create a ScriptTreeElement for the search tree outline as needed.

(WebInspector.ResourceSidebarPanel.prototype._scriptsToSearch):
When searching scripts, just perform a shallow walk of the tree outline to find
Script resources that are not also Resources. Scripts are always guarenteed to
be in a folder when inspecting a web resource. For JSContext inspection, scripts
are promoted to the top level.

* UserInterface/Main.html:
* UserInterface/Models/SourceCodeSearchMatchObject.js: Renamed from Source/WebInspectorUI/UserInterface/Models/ResourceSearchMatchObject.js.
(WebInspector.SourceCodeSearchMatchObject):
* UserInterface/Views/SearchIcons.css:
(.source-code-match-icon .icon):
(.resource-match-icon .icon): Deleted.
* UserInterface/Views/SearchResultTreeElement.js:
(WebInspector.SearchResultTreeElement):
Rename ResourceSearchMatchObject to SourceCodeSearchMatchObject.

LayoutTests:

* inspector/debugger/search-scripts-expected.txt: Added.
* inspector/debugger/search-scripts.html: Added.
Tests for Debugger.searchInContent.

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

4 years agoWeb Inspector: Provide $exception in the console for the thrown exception value
joepeck@webkit.org [Wed, 19 Nov 2014 23:49:36 +0000 (23:49 +0000)]
Web Inspector: Provide $exception in the console for the thrown exception value
https://bugs.webkit.org/show_bug.cgi?id=138726

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* debugger/DebuggerScope.cpp:
(JSC::DebuggerScope::caughtValue):
* debugger/DebuggerScope.h:
Access the caught value if this scope is a catch scope.

* runtime/JSNameScope.h:
(JSC::JSNameScope::isFunctionNameScope):
(JSC::JSNameScope::isCatchScope):
(JSC::JSNameScope::value):
Provide an accessor for the single value in the JSNameScope (with / catch block).

* inspector/InjectedScriptSource.js:
Save the exception value and expose it via $exception. Since the command line api
is recreated on each evaluation, $exception is essentially readonly.

* inspector/ScriptDebugServer.h:
* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::dispatchDidPause):
(Inspector::ScriptDebugServer::exceptionOrCaughtValue):
When pausing, get the exception or caught value. The exception will be provided
if we are breaking on an explicit exception. When inside of a catch block, we
can get the caught value by walking up the scope chain.

* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::InspectorDebuggerAgent):
(Inspector::InspectorDebuggerAgent::resume):
(Inspector::InspectorDebuggerAgent::stepOver):
(Inspector::InspectorDebuggerAgent::stepInto):
(Inspector::InspectorDebuggerAgent::stepOut):
Clearing state can be done in didContinue.

(Inspector::InspectorDebuggerAgent::didPause):
Set the exception value explicitly in the injected script when we have it.

(Inspector::InspectorDebuggerAgent::didContinue):
Clear state saved when we had paused, including clearly an exception value if needed.

(Inspector::InspectorDebuggerAgent::clearDebuggerBreakpointState):
(Inspector::InspectorDebuggerAgent::clearExceptionValue):
Call into the injected script only when needed.

* inspector/InjectedScript.cpp:
(Inspector::InjectedScript::setExceptionValue):
(Inspector::InjectedScript::clearExceptionValue):
* inspector/InjectedScript.h:
* inspector/InjectedScriptManager.cpp:
(Inspector::InjectedScriptManager::clearExceptionValue):
* inspector/InjectedScriptManager.h:
Clear on all injected scripts.

Source/WebCore:

Tests: inspector/debugger/command-line-api-exception-nested-catch.html
       inspector/debugger/command-line-api-exception.html

* inspector/CommandLineAPIModuleSource.js:
Expose $exception in the more complete command line API.

Source/WebInspectorUI:

* UserInterface/Base/Test.js:
(WebInspector.loaded):
In order to use RuntimeManager to execute in the global context or on the
active debugger call frame, we need to expose the quickConsole controller.

* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
Expose $exception to completion when we paused because of an exception.

LayoutTests:

Provide some tests to ensure $exception is the value we expect at different times,
such as on the exception line, when there is no exception, or when stepping through
catch blocks (it should always be the most recent caught exception).

* inspector/debugger/command-line-api-exception-expected.txt: Added.
* inspector/debugger/command-line-api-exception-nested-catch-expected.txt: Added.
* inspector/debugger/command-line-api-exception-nested-catch.html: Added.
* inspector/debugger/command-line-api-exception.html: Added.
* inspector/debugger/resources/exceptions.js: Added.
(triggerUncaughtTypeException):
(triggerUncaughtReferenceException):
(triggerUncaughtSyntaxException):
(triggerUncaughtDOMException):
(throwString):
(throwNumber):
(throwNull):
(throwObject):
(throwNode):
(catcher):
(nestedCatchBlocks):

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

4 years agoInvoking an action menu on a selection should result in the text menu
bdakin@apple.com [Wed, 19 Nov 2014 23:48:53 +0000 (23:48 +0000)]
Invoking an action menu on a selection should result in the text menu
https://bugs.webkit.org/show_bug.cgi?id=138892
-and corresponding-
rdar://problem/18996776

Reviewed by Tim Horton.

Source/WebKit/mac:

* WebView/WebActionMenuController.mm:
(-[WebActionMenuController _defaultMenuItems]):

Source/WebKit2:

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _defaultMenuItems]):

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

4 years agoFix iOS build.
andersca@apple.com [Wed, 19 Nov 2014 23:43:09 +0000 (23:43 +0000)]
Fix iOS build.

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:

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

4 years agoImages/replaced elements that are as tall as a page should be on their own page
hyatt@apple.com [Wed, 19 Nov 2014 23:40:23 +0000 (23:40 +0000)]
Images/replaced elements that are as tall as a page should be on their own page
https://bugs.webkit.org/show_bug.cgi?id=138886 - <rdar://problem/18296371>

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/multicol/tall-image-behavior.html (and RL/LR variants)

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::computeReplacedAndTextLineTopAndBottom):
* rendering/InlineFlowBox.h:
Add a new method that computes the line top and line bottom ignoring all margins,
overflow and line-height. This allows us to see if a line that is taller than a page
can be made to fit if we ignored margins and unused descent.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustLinePositionForPagination):
Call the new helper function, computeReplacedAndTextLineTopAndBottom and push
to a new page if we see that we can fit on a page by ourselves without blank space
included.

LayoutTests:

* fast/multicol/tall-image-behavior-lr.html: Added.
* fast/multicol/tall-image-behavior-rl.html: Added.
* fast/multicol/tall-image-behavior.html: Added.
* platform/mac/fast/multicol/tall-image-behavior-expected.png: Added.
* platform/mac/fast/multicol/tall-image-behavior-expected.txt: Added.
* platform/mac/fast/multicol/tall-image-behavior-lr-expected.png: Added.
* platform/mac/fast/multicol/tall-image-behavior-lr-expected.txt: Added.
* platform/mac/fast/multicol/tall-image-behavior-rl-expected.png: Added.
* platform/mac/fast/multicol/tall-image-behavior-rl-expected.txt: Added.

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

4 years agoRename two Cocoa-only .cpp files to .mm.
andersca@apple.com [Wed, 19 Nov 2014 23:03:03 +0000 (23:03 +0000)]
Rename two Cocoa-only .cpp files to .mm.

Rubber-stamped by Sam Weinig.

* Shared/APIWebArchive.mm: Renamed from Source/WebKit2/Shared/APIWebArchive.cpp.
* Shared/APIWebArchiveResource.mm: Renamed from Source/WebKit2/Shared/APIWebArchiveResource.cpp.
* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoData detected results with no menu items should not fall through to regular text
bdakin@apple.com [Wed, 19 Nov 2014 23:00:48 +0000 (23:00 +0000)]
Data detected results with no menu items should not fall through to regular text
action menus
https://bugs.webkit.org/show_bug.cgi?id=138887
-and corresponding-
rdar://problem/18971616

Reviewed by Tim Horton.

Source/WebKit/mac:

* WebView/WebActionMenuController.mm:
(-[WebActionMenuController _defaultMenuItems]):

Source/WebKit2:

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _defaultMenuItems]):

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

4 years agoTake Web Audio into account for the Page::isPlayingAudio() API.
adachan@apple.com [Wed, 19 Nov 2014 22:58:43 +0000 (22:58 +0000)]
Take Web Audio into account for the Page::isPlayingAudio() API.
https://bugs.webkit.org/show_bug.cgi?id=137464

Reviewed by Jer Noble.

Source/WebCore:

Make AudioContext a subclass of AudioProducer. It figures out whether there's
audio playing by checking whether its AudioDestinationNode is playing (and not
silent). It calls Document::updateIsPlayingAudio() whenever its audio playing
state has changed.

Test: webaudio/web-audio-is-playing.html

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::lazyInitialize):
Add itself to the Document's list of AudioProducers if it's not an offline
audio context.
(WebCore::AudioContext::uninitialize):
Remove itself from the Document's list of AudioProducers if it's not an offline
audio context.
(WebCore::AudioContext::stop):
Tell the document to update its audio playing state.
(WebCore::AudioContext::isPlayingAudio):
Return true if the audio context hasn't been stopped and its destination node is
playing audio.
(WebCore::AudioContext::pageMutedStateDidChange):
Add a FIXME for now.
(WebCore::AudioContext::isPlayingAudioDidChange):
Call Document::updateIsPlayingAudio().
* Modules/webaudio/AudioContext.h:

* Modules/webaudio/AudioDestinationNode.cpp:
(WebCore::AudioDestinationNode::AudioDestinationNode):
Initialize m_isSilent and m_isEffectivelyPlayingAudio.
(WebCore::AudioDestinationNode::render):
Call setIsSilent() with the appropriate value after rendering.
(WebCore::AudioDestinationNode::isPlayingDidChange):
Call updateIsEffectivelyPlayingAudio().
(WebCore::AudioDestinationNode::setIsSilent):
If m_isSilent has changed, call updateIsEffectivelyPlayingAudio().
(WebCore::AudioDestinationNode::updateIsEffectivelyPlayingAudio):
If m_isEffectivelyPlayingAudio has changed, call AudioContext::isPlayingAudioDidChange().
* Modules/webaudio/AudioDestinationNode.h:
(WebCore::AudioDestinationNode::isPlaying):
(WebCore::AudioDestinationNode::isPlayingAudio):

* Modules/webaudio/DefaultAudioDestinationNode.cpp:
(WebCore::DefaultAudioDestinationNode::isPlaying):
Return whether the AudioDestination is playing.
* Modules/webaudio/DefaultAudioDestinationNode.h:

* platform/audio/AudioIOCallback.h:
* platform/audio/ios/AudioDestinationIOS.cpp:
(WebCore::AudioDestinationIOS::start):
Call setIsPlaying() instead.
(WebCore::AudioDestinationIOS::stop):
Ditto.
(WebCore::AudioDestinationIOS::setIsPlaying):
If m_isPlaying has changed, call AudioIOCallback::isPlayingDidChange().
* platform/audio/ios/AudioDestinationIOS.h:

* platform/audio/mac/AudioDestinationMac.cpp:
(WebCore::AudioDestinationMac::start):
Call setIsPlaying() instead.
(WebCore::AudioDestinationMac::stop):
Ditto.
(WebCore::AudioDestinationMac::setIsPlaying):
If m_isPlaying has changed, call AudioIOCallback::isPlayingDidChange().
* platform/audio/mac/AudioDestinationMac.h:

* testing/Internals.cpp:
(WebCore::Internals::isPagePlayingAudio):
* testing/Internals.h:
* testing/Internals.idl:
Add internals.isPagePlayingAudio() for testing.

LayoutTests:

This test checks that Page::isPlayingAudio() returns false before an audio context is created
and before the oscillator node makes a sound. It then starts the oscillator node and checks
that Page::isPlayingAudio() later returns true.

* webaudio/web-audio-is-playing-expected.txt: Added.
* webaudio/web-audio-is-playing.html: Added.

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

4 years agoAttempt to fix the Apple Internal Mountain Lion build after <https://trac.webkit...
dbates@webkit.org [Wed, 19 Nov 2014 22:51:40 +0000 (22:51 +0000)]
Attempt to fix the Apple Internal Mountain Lion build after <https://trac.webkit.org/changeset/176347>
(https://bugs.webkit.org/show_bug.cgi?id=136863)

Only import header CFNSURLConnection.h when building for iOS or OS X Yosemite.

* platform/spi/cf/CFNetworkSPI.h:

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

4 years agoFix TilesAdded bitmask
antti@apple.com [Wed, 19 Nov 2014 22:40:00 +0000 (22:40 +0000)]
Fix TilesAdded bitmask
https://bugs.webkit.org/show_bug.cgi?id=138883

Reviewed by Simon Fraser.

Simon spotted this.

* platform/graphics/ca/GraphicsLayerCA.h:

    Use 1LLU << 29 instead of 1LLU < 29
    This worked before by pure luck as bit 0 is unused.

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

4 years ago[iOS] Make WebKit build with public iOS SDK
dbates@webkit.org [Wed, 19 Nov 2014 22:32:04 +0000 (22:32 +0000)]
[iOS] Make WebKit build with public iOS SDK
https://bugs.webkit.org/show_bug.cgi?id=136863

Reviewed by David Kilzer.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj: Add private headers CFNetworkSPI.h and
NS{CalendarDate, String, URLDownload}SPI.h.
* loader/cocoa/DiskCacheMonitorCocoa.mm: Move forward declaration of
CFNetwork data types and functions from here to file CFNetworkSPI.h and
include header CFNetworkSPI.h.
* platform/network/mac/ResourceHandleMac.mm: Substitute CFNetworkSPI.h for
CFURLRequestSPI.h as the content of the latter was incorporated into the former.
* platform/spi/cf/CFNetworkSPI.h: Added.
* platform/spi/cf/CFURLRequestSPI.h: Removed; incorporated its functionality
into CFNetworkSPI.h
* platform/spi/cocoa/NSCalendarDateSPI.h: Added.
* platform/spi/cocoa/NSStringSPI.h: Added.
* platform/spi/cocoa/NSURLDownloadSPI.h: Added.

Source/WebKit/ios:

* Misc/WebGeolocationCoreLocationProvider.mm:  Remove unnecessary include of header <CoreLocation/CoreLocationPriv.h>.
* Misc/WebNSStringExtrasIOS.m: Substitute header <WebCore/NSStringSPI.h> for <Foundation/NSString_NSURLExtras.h>.
* Misc/WebUIKitSupport.mm: Remove unnecessary include of header CoreFoundation/CFPriv.h.

Source/WebKit/mac:

* History/WebHistory.mm: Include header NSCalendarDateSPI.h.
* History/WebHistoryItemPrivate.h: Remove include of private header Foundation/NSCalendarDate.h.
* Misc/WebDownload.h: Forward declare NSURLDownload when building without header Foundation/NSURLDownload.h.
We use __has_include() instead of WTF_USE_APPLE_INTERNAL_SDK since this header
may be used by Apple internal clients that do not include wtf/Platform.h.
* Misc/WebDownload.mm: Include header NSURLDownloadSPI.h instead of including
private Foundation headers directly.
* Misc/WebNSURLExtras.mm: Remove unnecessary include of private Foundation header.
* WebCoreSupport/WebFrameNetworkingContext.mm: Include header CFNetworkSPI.h
instead of including private CFNetwork headers directly. Also fixed up style and
ordering of header include directives.
* WebView/WebView.mm: Include header CFNetworkSPI.h instead of including private
CFNetwork headers directly. Also sort the #import directives.
* WebView/WebViewPrivate.h: Define ENABLE_TOUCH_EVENTS if not otherwise defined
and added ENABLE_TOUCH_EVENTS-guard around -_touchEventRegions.

Source/WebKit2:

* NetworkProcess/cocoa/NetworkProcessCocoa.mm: Moved CFNetwork forward declarations
from this file to file CFNetworkSPI.h and included header CFNetworkSPI.h.
* NetworkProcess/mac/NetworkDiskCacheMonitor.mm: Ditto.
* NetworkProcess/mac/NetworkResourceLoaderMac.mm: Ditto.
* UIProcess/API/Cocoa/WKProcessPool.mm: Ditto.
* UIProcess/mac/WebContextMac.mm: Ditto.
* WebProcess/cocoa/WebProcessCocoa.mm: Ditto.

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

4 years agoAX: Screen braille input doesn't work on forms.
cfleizach@apple.com [Wed, 19 Nov 2014 22:12:19 +0000 (22:12 +0000)]
AX: Screen braille input doesn't work on forms.
https://bugs.webkit.org/show_bug.cgi?id=138804

Unreviewed build fix.

* DumpRenderTree/AccessibilityUIElement.cpp:
(AccessibilityUIElement::setValue):

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

4 years agoAdd APIs for customizing the user agent
andersca@apple.com [Wed, 19 Nov 2014 22:07:22 +0000 (22:07 +0000)]
Add APIs for customizing the user agent
https://bugs.webkit.org/show_bug.cgi?id=138881
rdar://problem/17233981

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
(-[WKWebView customUserAgent]):
(-[WKWebView setCustomUserAgent:]):
(-[WKWebView _customUserAgent]):
(-[WKWebView _setCustomUserAgent:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(LazyInitialized::set):
(-[WKWebViewConfiguration copyWithZone:]):
(defaultApplicationNameForUserAgent):
(-[WKWebViewConfiguration applicationNameForUserAgent]):
(-[WKWebViewConfiguration setApplicationNameForUserAgent:]):

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

4 years ago[WK2 UI-side compositing] Initialize RemoteLayerTreeTransaction properties which...
simon.fraser@apple.com [Wed, 19 Nov 2014 22:05:03 +0000 (22:05 +0000)]
[WK2 UI-side compositing] Initialize RemoteLayerTreeTransaction properties which are unset on Mac
https://bugs.webkit.org/show_bug.cgi?id=138877

Reviewed by Tim Horton.

These data members are unused on Mac, but still encoded, so initialize them with
reasonable values.

* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::RemoteLayerTreeTransaction):

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

4 years agoRefactor iOS selection gestures.
enrica@apple.com [Wed, 19 Nov 2014 21:57:10 +0000 (21:57 +0000)]
Refactor iOS selection gestures.
https://bugs.webkit.org/show_bug.cgi?id=138720
rdar://problem/18964359

Reviewed by Benjamin Poulain.

This is a first step towards refactoring the selection gestures code.
It introduces more general selection movement functions that can be used to build
the gestures.

* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(toWKTextGranularity):
(toWKSelectionDirection):
(-[WKContentView selectPositionAtPoint:completionHandler:]):
(-[WKContentView selectPositionAtBoundary:inDirection:fromPoint:completionHandler:]):
(-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]):
(-[WKContentView beginSelectionInDirection:completionHandler:]):
(-[WKContentView updateSelectionWithExtentPoint:completionHandler:]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
(WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
(WebKit::WebPageProxy::selectPositionAtPoint):
(WebKit::WebPageProxy::beginSelectionInDirection):
(WebKit::WebPageProxy::updateSelectionWithExtentPoint):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture):
(WebKit::WebPage::visiblePositionInFocusedNodeForPoint):
(WebKit::WebPage::selectPositionAtPoint):
(WebKit::WebPage::selectPositionAtBoundaryWithDirection):
(WebKit::WebPage::selectTextWithGranularityAtPoint):
(WebKit::WebPage::beginSelectionInDirection):
(WebKit::WebPage::updateSelectionWithExtentPoint):

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

4 years agoUnreviewed build fixes after r176329.
joepeck@webkit.org [Wed, 19 Nov 2014 21:39:33 +0000 (21:39 +0000)]
Unreviewed build fixes after r176329.

  - export all of the codegen python files as they are included by the main generator
  - update the imports of the main generator to match __init__.py
  - remove bundling the python scripts as framework resources, just have them PrivateHeaders

* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/scripts/generate-inspector-protocol-bindings.py:

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

4 years ago[WK2 UI-side Compositing] Fix the position and scroll indicator of the UI-side tiled...
simon.fraser@apple.com [Wed, 19 Nov 2014 21:31:11 +0000 (21:31 +0000)]
[WK2 UI-side Compositing] Fix the position and scroll indicator of the UI-side tiled scrolling indicator
https://bugs.webkit.org/show_bug.cgi?id=138876

Reviewed by Beth Dakin.

Fix the position of the tiled scrolling indicator in MiniBrowser by taking top
content offset into account.

On Mac, pass the current scroll position back to the UI process via the RemoteLayerTreeTransaction
so that we can use it to show the correctly scroll offset in the indicator. This is temporary until
Mac does UI-side scrolling.

* Shared/mac/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::scrollPosition):
(WebKit::RemoteLayerTreeTransaction::setScrollPosition):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode):
(WebKit::RemoteLayerTreeTransaction::decode):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
(WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willCommitLayerTree):

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

4 years agoAdd layout test for throttling of DOM timer changing the style of visible and invisib...
cdumez@apple.com [Wed, 19 Nov 2014 21:15:00 +0000 (21:15 +0000)]
Add layout test for throttling of DOM timer changing the style of visible and invisible elements
https://bugs.webkit.org/show_bug.cgi?id=138875

Reviewed by Simon Fraser.

Add a layout test to test that a repeating DOM timer changing the style
of both visible and invisible elements does not get throttled.

Also rename existing tests to use "display-none" instead of "invisible"
for clarity.

* fast/dom/nested-timer-display-none-element-throttling-expected.txt: Renamed from LayoutTests/fast/dom/nested-timer-invisible-element-throttling-expected.txt.
* fast/dom/nested-timer-display-none-element-throttling.html: Renamed from LayoutTests/fast/dom/nested-timer-invisible-element-throttling.html.
* fast/dom/repeating-timer-display-none-element-throttling-expected.txt: Renamed from LayoutTests/fast/dom/repeating-timer-invisible-element-throttling-expected.txt.
* fast/dom/repeating-timer-display-none-element-throttling.html: Renamed from LayoutTests/fast/dom/repeating-timer-invisible-element-throttling.html.
* fast/dom/repeating-timer-mixed-visible-display-none-elements-throttling-expected.txt: Added.
* fast/dom/repeating-timer-mixed-visible-display-none-elements-throttling.html: Added.

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

4 years agoGet rid of AccessibilityObject::setRoleValue()
benjamin@webkit.org [Wed, 19 Nov 2014 20:50:54 +0000 (20:50 +0000)]
Get rid of AccessibilityObject::setRoleValue()
https://bugs.webkit.org/show_bug.cgi?id=138861

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-11-19
Reviewed by Chris Fleizach.

* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::setRoleValue): Deleted.

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

4 years agoAdd layout test for DOM timer throttling and element moving into view after layout
cdumez@apple.com [Wed, 19 Nov 2014 20:46:36 +0000 (20:46 +0000)]
Add layout test for DOM timer throttling and element moving into view after layout
https://bugs.webkit.org/show_bug.cgi?id=138874

Reviewed by Simon Fraser.

Add a layout test to make sure we unthrottle a DOM timer changing the
style of an element outside viewport if the element ends up inside
the viewport after layout.

* fast/dom/timer-unthrottle-on-layout-expected.txt: Added.
* fast/dom/timer-unthrottle-on-layout.html: Added.

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

4 years agoWeb Inspector: standardize language-specific protocol generator file, class, and...
burg@cs.washington.edu [Wed, 19 Nov 2014 19:16:23 +0000 (19:16 +0000)]
Web Inspector: standardize language-specific protocol generator file, class, and method prefixes
https://bugs.webkit.org/show_bug.cgi?id=138237

Reviewed by Joseph Pecoraro.

Settle on cpp/objc/js file prefixes and Cpp/ObjC/JS class prefixes for generators.
Move C++-specific static methods into CppGenerator and add cpp_ prefixes where relevant.
Split the templates file into language-specific template files.

* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/scripts/codegen/__init__.py:
* inspector/scripts/codegen/cpp_generator.py: Copied from Source/JavaScriptCore/inspector/scripts/codegen/generator.py.
* inspector/scripts/codegen/cpp_generator_templates.py: Copied from Source/JavaScriptCore/inspector/scripts/codegen/generator_templates.py.
(CppGeneratorTemplates):
* inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_alternate_backend_dispatcher_header.py.
* inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_header.py.
* inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_dispatcher_implementation.py.
* inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_header.py.
* inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_frontend_dispatcher_implementation.py.
* inspector/scripts/codegen/generate_cpp_protocol_types_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_header.py.
* inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_protocol_types_implementation.py.
* inspector/scripts/codegen/generate_js_backend_commands.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_backend_commands.py.
* inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_header.py.
* inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_backend_dispatcher_implementation.py.
* inspector/scripts/codegen/generate_objc_configuration_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_header.py.
* inspector/scripts/codegen/generate_objc_configuration_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_configuration_implementation.py.
* inspector/scripts/codegen/generate_objc_conversion_helpers.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_conversion_helpers.py.
* inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_frontend_dispatcher_implementation.py.
* inspector/scripts/codegen/generate_objc_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_header.py.
* inspector/scripts/codegen/generate_objc_internal_header.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_internal_header.py.
* inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c_types_implementation.py.
* inspector/scripts/codegen/generator.py:
* inspector/scripts/codegen/generator_templates.py:
* inspector/scripts/codegen/objc_generator.py: Renamed from Source/JavaScriptCore/inspector/scripts/codegen/generate_objective_c.py.
* inspector/scripts/codegen/objc_generator_templates.py: Added.
* inspector/scripts/generate-inspector-protocol-bindings.py:

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

4 years agoVersioning.
bshafiei@apple.com [Wed, 19 Nov 2014 18:59:00 +0000 (18:59 +0000)]
Versioning.

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

4 years agoUpdate WebKit to build with LLVM TOT
commit-queue@webkit.org [Wed, 19 Nov 2014 18:46:17 +0000 (18:46 +0000)]
Update WebKit to build with LLVM TOT
https://bugs.webkit.org/show_bug.cgi?id=138519

Patch by Juergen Ributzka <juergen@apple.com> on 2014-11-19
Reviewed by Alexey Proskuryakov.

* Configurations/LLVMForJSC.xcconfig:
* llvm/LLVMAPIFunctions.h:
* llvm/library/LLVMExports.cpp:
(initializeAndGetJSCLLVMAPI):

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

4 years agoWeb Inspector: Debugger should not mutate variable when hovering mouse over ++n expre...
commit-queue@webkit.org [Wed, 19 Nov 2014 18:34:19 +0000 (18:34 +0000)]
Web Inspector: Debugger should not mutate variable when hovering mouse over ++n expression
https://bugs.webkit.org/show_bug.cgi?id=138839

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-11-19
Reviewed by Timothy Hatcher.

* UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
(WebInspector.CodeMirrorTokenTrackingController.prototype._processJavaScriptExpression):

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

4 years agoWeb Inspector: Improve basic JavaScript completion in inline <script>s
commit-queue@webkit.org [Wed, 19 Nov 2014 18:32:30 +0000 (18:32 +0000)]
Web Inspector: Improve basic JavaScript completion in inline <script>s
https://bugs.webkit.org/show_bug.cgi?id=138845

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-11-19
Reviewed by Timothy Hatcher.

* UserInterface/Controllers/CodeMirrorCompletionController.js:
(WebInspector.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions):
Fix up CodeMirror mode handling for JavaScript completion when inside of mixed mode
input (html). Also add completion for CodeMirror's localVars list.

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

4 years agoAdd layout test for DOM timers throttling and 0 height element with visible overflowi...
cdumez@apple.com [Wed, 19 Nov 2014 18:27:33 +0000 (18:27 +0000)]
Add layout test for DOM timers throttling and 0 height element with visible overflowing content
https://bugs.webkit.org/show_bug.cgi?id=138873

Reviewed by Simon Fraser.

Add a layout test for verify that a DOM timer changing the style of a 0
height element with visible overflowing content does not get throttled.
If the implementation did not properly use the overflow rect to
determine if the element is visible, this test would fail.

This covers the case of the top scrolling banner on huffingtonpost.com.

* fast/dom/repeating-timer-element-overflow-throttling-expected.txt: Added.
* fast/dom/repeating-timer-element-overflow-throttling.html: Added.

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

4 years agoMissing NULL-check in VideoTrack::setLanguage
philn@webkit.org [Wed, 19 Nov 2014 17:52:58 +0000 (17:52 +0000)]
Missing NULL-check in VideoTrack::setLanguage
https://bugs.webkit.org/show_bug.cgi?id=138867

Reviewed by Jer Noble.

* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::setLanguage): Prevent change event creation
on an empty video track list.

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

4 years agoAX: Safari fails to load a web page with VoiceOver
cfleizach@apple.com [Wed, 19 Nov 2014 17:36:29 +0000 (17:36 +0000)]
AX: Safari fails to load a web page with VoiceOver
https://bugs.webkit.org/show_bug.cgi?id=138849

Reviewed by Mario Sanchez Prada.

Source/WebCore:

Sometimes an inlineElementContinuation will continue to an inline RenderBlock, so we case this incorrectly and bad things happen.

Test: accessibility/inline-block-assertion.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::startOfContinuations):

LayoutTests:

* accessibility/inline-block-assertion-expected.txt: Added.
* accessibility/inline-block-assertion.html: Added.

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

4 years agoSimple line layout: RenderTreeAsText should use rangeForRenderer() when dumping simpl...
zalan@apple.com [Wed, 19 Nov 2014 17:26:31 +0000 (17:26 +0000)]
Simple line layout: RenderTreeAsText should use rangeForRenderer() when dumping simple line text.
https://bugs.webkit.org/show_bug.cgi?id=138847

Reviewed by Antti Koivisto.

This is in preparation to support multiple renderers for simple line layout.
Use rangeForRenderer() to get runs for a particular renderer as opposed to for the entire flow.

Not testable.

* rendering/RenderTreeAsText.cpp:
(WebCore::write):

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

4 years ago[WinCairo] Compile error when CSS_SELECTORS_LEVEL4 is not enabled.
commit-queue@webkit.org [Wed, 19 Nov 2014 17:23:14 +0000 (17:23 +0000)]
[WinCairo] Compile error when CSS_SELECTORS_LEVEL4 is not enabled.
https://bugs.webkit.org/show_bug.cgi?id=138870

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-11-19
Reviewed by Alex Christensen.

* css/CSSSelector.cpp:
(WebCore::simpleSelectorSpecificityInternal):

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

4 years agoAX: Screen braille input doesn't work on forms.
cfleizach@apple.com [Wed, 19 Nov 2014 15:47:16 +0000 (15:47 +0000)]
AX: Screen braille input doesn't work on forms.
https://bugs.webkit.org/show_bug.cgi?id=138804

Reviewed by Mario Sanchez Prada.

Source/WebCore:

Allow iOS to set values of text fields through the API.

Test: platform/ios-sim/accessibility/set-value.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilitySetValue:]):

Tools:

Add a method to setValue through the AX API in DRT.

* DumpRenderTree/AccessibilityUIElement.cpp:
(setValueCallback):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::setValue):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::setValue):

LayoutTests:

* platform/ios-sim: Copied from LayoutTests/platform/ios-sim.
* platform/ios-sim/accessibility/set-value-expected.txt: Added.
* platform/ios-sim/accessibility/set-value.html: Added.

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

4 years agoSimple line layout: Add renderer based rect collecting to RunResolver.
zalan@apple.com [Wed, 19 Nov 2014 15:40:35 +0000 (15:40 +0000)]
Simple line layout: Add renderer based rect collecting to RunResolver.
https://bugs.webkit.org/show_bug.cgi?id=138818

Reviewed by Antti Koivisto.

This is in preparation to multiple renderers support.
RunResolver should be able to collect rects for a particular renderer
that might overlap multiple runs. (or might just be a subset of a Run)

Covered by existing tests.

* rendering/SimpleLineLayoutFlowContents.cpp:
(WebCore::SimpleLineLayout::FlowContents::renderer): It operates on a single renderer currently.
(WebCore::SimpleLineLayout::FlowContents::resolveRendererPositions): It operates on a single renderer currently.
* rendering/SimpleLineLayoutFlowContents.h:
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::computeTextBoundingBox):
(WebCore::SimpleLineLayout::computeTextFirstRunLocation):
(WebCore::SimpleLineLayout::collectTextAbsoluteRects):
(WebCore::SimpleLineLayout::collectTextAbsoluteQuads):
(WebCore::SimpleLineLayout::showLineLayoutForFlow):
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::baselinePosition):
(WebCore::SimpleLineLayout::linePosition):
(WebCore::SimpleLineLayout::lineSize):
(WebCore::SimpleLineLayout::RunResolver::Run::rect):
(WebCore::SimpleLineLayout::RunResolver::Run::rectForTextRenderer):
(WebCore::SimpleLineLayout::RunResolver::Run::baseline):
(WebCore::SimpleLineLayout::RunResolver::Run::text):
(WebCore::SimpleLineLayout::RunResolver::Run::computeRect):
(WebCore::SimpleLineLayout::RunResolver::RunResolver):
* rendering/SimpleLineLayoutResolver.h:

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

4 years ago[GTK] Error in documentation of webkit_print_operation_get_page_setup()
commit-queue@webkit.org [Wed, 19 Nov 2014 14:24:10 +0000 (14:24 +0000)]
[GTK] Error in documentation of webkit_print_operation_get_page_setup()
https://bugs.webkit.org/show_bug.cgi?id=138868

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2014-11-19
Reviewed by Carlos Garcia Campos.

Fix copypaste error in documentation of
webkit_print_operation_get_page_setup().

* UIProcess/API/gtk/WebKitPrintOperation.cpp:

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

4 years agoRemove an unused file.
mrowe@apple.com [Wed, 19 Nov 2014 09:55:12 +0000 (09:55 +0000)]
Remove an unused file.

* version.plist: Removed.

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

4 years agoFix the detection of toolchain support for Cortex-A53 erratum 835769 workaround
commit-queue@webkit.org [Wed, 19 Nov 2014 09:06:30 +0000 (09:06 +0000)]
Fix the detection of toolchain support for Cortex-A53 erratum 835769 workaround
https://bugs.webkit.org/show_bug.cgi?id=138840

Patch by Akos Kiss <akiss@inf.u-szeged.hu> on 2014-11-19
Reviewed by Csaba Osztrogon√°c.

* Source/cmake/OptionsCommon.cmake:

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

4 years agoAdd selector checker for :lang pseudo class in Selectors level 4
commit-queue@webkit.org [Wed, 19 Nov 2014 08:57:13 +0000 (08:57 +0000)]
Add selector checker for :lang pseudo class in Selectors level 4
https://bugs.webkit.org/show_bug.cgi?id=138281

Patch by Dhi Aurrahman <diorahman@rockybars.com> on 2014-11-19
Reviewed by Benjamin Poulain.

Source/WebCore:

Add selector checker for :lang pseudo class in Selectors level 4.

The language tags matching is specified in [1,2].

[1] http://www.ietf.org/rfc/rfc4647.txt
[2] http://dev.w3.org/csswg/selectors4/#the-lang-pseudo

Tests: fast/selectors/lang-extended-filtering.html
       fast/selectors/lang-multiple.html

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* css/SelectorCheckerTestFunctions.h:
(WebCore::containslanguageSubtagMatchingRange):
(WebCore::matchesLangPseudoClass):
(WebCore::matchesLangPseudoClassDeprecated):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):

LayoutTests:

Add layout tests for :lang selector checker with multiple arguments and
related behaviors on extended filtering.

* fast/selectors/lang-extended-filtering-expected.txt: Added.
* fast/selectors/lang-extended-filtering.html: Added.
* fast/selectors/lang-multiple-expected.txt: Added.
* fast/selectors/lang-multiple.html: Added.

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

4 years agoRoll over WebInspectorUI's ChangeLog.
mrowe@apple.com [Wed, 19 Nov 2014 08:53:28 +0000 (08:53 +0000)]
Roll over WebInspectorUI's ChangeLog.

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

4 years agostart/stop method for AudioBufferSourceNodes and OscillatorNodes can take no args
philn@webkit.org [Wed, 19 Nov 2014 07:49:29 +0000 (07:49 +0000)]
start/stop method for AudioBufferSourceNodes and OscillatorNodes can take no args
https://bugs.webkit.org/show_bug.cgi?id=138739

Reviewed by Darin Adler.

Source/WebCore:

The patch is inspired by the following Blink revision by
<rtoy@google.com>:
<https://src.chromium.org/viewvc/blink?view=rev&revision=160845>

Test: webaudio/dom-exceptions.html

* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::start):
(WebCore::AudioBufferSourceNode::startPlaying):
(WebCore::AudioBufferSourceNode::noteGrainOn):
(WebCore::AudioBufferSourceNode::startGrain): Deleted.
* Modules/webaudio/AudioBufferSourceNode.h:
* Modules/webaudio/AudioBufferSourceNode.idl:
* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::start):
(WebCore::AudioScheduledSourceNode::stop):
* Modules/webaudio/AudioScheduledSourceNode.h:
* Modules/webaudio/OscillatorNode.idl:

LayoutTests:

* webaudio/dom-exceptions-expected.txt: Added.
* webaudio/dom-exceptions.html: Added.

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

4 years agoAad failing test expectations to some tests imported in r176144.
rniwa@webkit.org [Wed, 19 Nov 2014 06:45:29 +0000 (06:45 +0000)]
Aad failing test expectations to some tests imported in r176144.

* platform/win/TestExpectations:

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

4 years agoUse of uninitialized value in string eq in many http tests
ap@apple.com [Wed, 19 Nov 2014 05:41:15 +0000 (05:41 +0000)]
Use of uninitialized value in string eq in many http tests
https://bugs.webkit.org/show_bug.cgi?id=138852

Reviewed by Daniel Bates.

* http/tests/security/xssAuditor/resources/echo-intertag.pl: Don't use it uninitialized.

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

4 years ago[WK2] Remove the minimalUI code from the UIProcess
benjamin@webkit.org [Wed, 19 Nov 2014 05:13:54 +0000 (05:13 +0000)]
[WK2] Remove the minimalUI code from the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=138819

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-11-18
Reviewed by Sam Weinig.

It looks like the only interface we have to keep alive is
[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:minimumLayoutSizeForMinimalUI:maximumUnobscuredSizeOverride:].

Clean up everything else, it is a pile of useless code.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLoadForMainFrame]):
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _didRelaunchProcess]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:minimumLayoutSizeForMinimalUI:maximumUnobscuredSizeOverride:]):
(-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]):
(-[WKWebView _setUsesMinimalUI:]): Deleted.
(-[WKWebView _usesMinimalUI]): Deleted.
(activeMinimumLayoutSizeForMinimalUI): Deleted.
(-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/ios/WKViewIOS.mm:
(-[WKView _frameOrBoundsChanged]):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::setUsesMinimalUI): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::dynamicViewportSizeUpdate):
(WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSizeForMinimalUI): Deleted.
(WebKit::WebPageProxy::setUsesMinimalUI): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::viewportPropertiesDidChange):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::setViewportConfigurationMinimumLayoutSizeForMinimalUI): Deleted.

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

4 years agoAdd the initial implementation of dynamic specificity for :matches()
benjamin@webkit.org [Wed, 19 Nov 2014 05:12:53 +0000 (05:12 +0000)]
Add the initial implementation of dynamic specificity for :matches()
https://bugs.webkit.org/show_bug.cgi?id=138822

Reviewed by Andreas Kling.

Source/WebCore:

Previously we completely ignored the selector list of :matches() when computing
the specificity of the selector.

The spec (http://dev.w3.org/csswg/selectors4/#specificity) says:
"The specificity of a :matches() pseudo-class, however, is the specificity
 of the most specific complex selector that matched the given element."

This patch does just that.

In the CSS JIT, we only consider specificities that can be computed statically
for now, this should be extended later.
When the specificity is dynamic, we fall back to SelectorChecker. In that case,
we execute every selector of the selector list and we keep the maximum value
as the specificity for the whole :matches().

Tests: fast/css/matches-specificity-1.html
       fast/css/matches-specificity-2.html
       fast/css/matches-specificity-3.html
       fast/css/matches-specificity-4.html
       fast/css/matches-specificity-5.html
       fast/css/matches-specificity-6.html
       fast/css/matches-specificity-7.html
       fast/css/matches-specificity-8.html
       fast/css/matches-specificity-9.html
       fast/css/matches-specificity-10.html

* css/CSSSelector.cpp:
(WebCore::selectorSpecificity):
(WebCore::maxSpecificity):
(WebCore::CSSSelector::specificity):
(WebCore::simpleSelectorSpecificityInternal):
(WebCore::CSSSelector::simpleSelectorSpecificity):
:matches() itself should not have any specificity. The specificity of its components
is computed in SelectorChecker.

Since :matches() is no longer accounted as a class B specificity, I had to finish
the specificity of :not() or some test breaks.

* css/CSSSelector.h:
* css/PageRuleCollector.cpp:
(WebCore::comparePageRules):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
We can no longer shortcut the execution when context.pseudoElementEffective is false.
There is no guarantee that a following selector wouldn't match with a higher specificity.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
(WebCore::SelectorCompiler::constructFragments):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):

LayoutTests:

* fast/css/matches-specificity-1-expected.html: Added.
* fast/css/matches-specificity-1.html: Added.
* fast/css/matches-specificity-2-expected.html: Added.
* fast/css/matches-specificity-2.html: Added.
* fast/css/matches-specificity-3-expected.html: Added.
* fast/css/matches-specificity-3.html: Added.
* fast/css/matches-specificity-4-expected.html: Added.
* fast/css/matches-specificity-4.html: Added.
* fast/css/matches-specificity-5-expected.html: Added.
* fast/css/matches-specificity-5.html: Added.
* fast/css/matches-specificity-6-expected.html: Added.
* fast/css/matches-specificity-6.html: Added.
* fast/css/matches-specificity-7-expected.html: Added.
* fast/css/matches-specificity-7.html: Added.
* fast/css/matches-specificity-8-expected.html: Added.
* fast/css/matches-specificity-8.html: Added.
* fast/css/matches-specificity-9-expected.html: Added.
* fast/css/matches-specificity-9.html: Added.
* fast/css/matches-specificity-10-expected.html: Added.
* fast/css/matches-specificity-10.html: Added.

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

4 years agoUnreviewed. Revision to the build fix in r176304.
conrad_shultz@apple.com [Wed, 19 Nov 2014 05:08:41 +0000 (05:08 +0000)]
Unreviewed. Revision to the build fix in r176304.

The guarded method should simply be in the !TARGET_OS_IPHONE block.

* UIProcess/API/Cocoa/WKViewPrivate.h:

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

4 years agoiOS8 new "slow tap" heuristic fires mouse compat events despite preventDefault on...
benjamin@webkit.org [Wed, 19 Nov 2014 05:06:58 +0000 (05:06 +0000)]
iOS8 new "slow tap" heuristic fires mouse compat events despite preventDefault on touchend
https://bugs.webkit.org/show_bug.cgi?id=137069
rdar://problem/18481464

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-11-18
Reviewed by Simon Fraser.

On WebKit2, we let UIWebTouchEventsGestureRecognizer and _UIWebHighlightLongPressGestureRecognizer
run concurrently. This causes a race with an incorrect behavior:
1) If UIWebTouchEventsGestureRecognizer does not cancel the native gestures on start.
2) _UIWebHighlightLongPressGestureRecognizer starts after highlightDelay.
3) When the finger leaves the screen, both gestures end.
-> If the touch end sent to JavaScript in [3] ask the priority over native events, that no longer stops
   the _UIWebHighlightLongPressGestureRecognizer.

The two gesture recognizers can run in any order, there is no guarantee on which one runs first.
To solve the bug, I must make sure the _UIWebHighlightLongPressGestureRecognizer never trigger a click
if the page wants the event.

To solve the order problem, I use the fact that event recognition goes in two phases for
non cancelled events:
1) Update the gesture recognizers.
2) Trigger the actions.

I do not know the order of recognizers in [1], but I know both have run before [2] is executed.
I use that to stop _UIWebHighlightLongPressGestureRecognizer from ending with a click in the case of the bug:
1) When _UIWebHighlightLongPressGestureRecognizer starts, I set _highlightLongPressCanClick signaling
   the gesture can end normally. This is done on a timer and not direct input so I don't really have to worry
   about a race here.
2) When processing the touch event for UIWebTouchEventsGestureRecognizer, I reset the flag _highlightLongPressCanClick
   if the page wants the event.
3) When the actions of _UIWebHighlightLongPressGestureRecognizer are processed, the touch event
   has already been processed by the page and the flag has been cleared if needed.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _webTouchEvent:preventsNativeGestures:]):
(-[WKContentView _highlightLongPressRecognized:]):

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

4 years agoiOS build fix after r176299. This method is not defined in WKViewIOS.mm.
rniwa@webkit.org [Wed, 19 Nov 2014 04:31:51 +0000 (04:31 +0000)]
iOS build fix after r176299. This method is not defined in WKViewIOS.mm.

* UIProcess/API/Cocoa/WKViewPrivate.h:

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

4 years agoFeatureDefines.xcconfig: Switch from using PLATFORM_NAME to SDK selectors
ddkilzer@apple.com [Wed, 19 Nov 2014 02:42:49 +0000 (02:42 +0000)]
FeatureDefines.xcconfig: Switch from using PLATFORM_NAME to SDK selectors
<http://webkit.org/b/138813>

Reviewed by Mark Rowe.

* Configurations/FeatureDefines.xcconfig: Switch to using SDK
selectors.

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

4 years agoCrash when setting 'z-index' / 'flex-shrink' CSS properties to a calculated value
cdumez@apple.com [Wed, 19 Nov 2014 02:05:34 +0000 (02:05 +0000)]
Crash when setting 'z-index' / 'flex-shrink' CSS properties to a calculated value
https://bugs.webkit.org/show_bug.cgi?id=138783

Reviewed by Andreas Kling.

Source/WebCore:

Update operators converting CSSPrimitiveValue to integer / floating
point types to properly handle calculated values (e.g. 'calc(2 * 3)').
Previously, this was not working in release builds and we would hit an
ASSERT_NOT_REACHED() in debug builds.

Tests: fast/css/flex-shrink-calculated-value.html
       fast/css/z-index-calculated-value.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator unsigned short):
(WebCore::CSSPrimitiveValue::operator int):
(WebCore::CSSPrimitiveValue::operator unsigned):
(WebCore::CSSPrimitiveValue::operator float):

LayoutTests:

Add layout tests to check that settings 'z-index' / 'flex-shrink' CSS
properties to a calculated value does not crash and behaves as
expected.

* fast/css/flex-shrink-calculated-value-expected.txt: Added.
* fast/css/flex-shrink-calculated-value.html: Added.
* fast/css/z-index-calculated-value-expected.txt: Added.
* fast/css/z-index-calculated-value.html: Added.

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

4 years agoGive clients a way to cancel preview popovers
conrad_shultz@apple.com [Wed, 19 Nov 2014 01:43:14 +0000 (01:43 +0000)]
Give clients a way to cancel preview popovers
https://bugs.webkit.org/show_bug.cgi?id=138855

Reviewed by Tim Horton.

Promote -[WKView _dismissActionMenuPopovers] from internal to private.

* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView _dismissActionMenuPopovers]):
* UIProcess/API/mac/WKViewInternal.h:

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

4 years agoUnreviewed, rolling out r176263 and r176273.
mmaxfield@apple.com [Wed, 19 Nov 2014 01:19:43 +0000 (01:19 +0000)]
Unreviewed, rolling out r176263 and r176273.
https://bugs.webkit.org/show_bug.cgi?id=138854

Underlines are hideous. (Requested by litherum on #webkit).

Reverted changesets:

"Use underlining metrics from the font file"
https://bugs.webkit.org/show_bug.cgi?id=138762
http://trac.webkit.org/changeset/176263

"iOS build fix."
http://trac.webkit.org/changeset/176273

Patch by Commit Queue <commit-queue@webkit.org> on 2014-11-18# Please enter the commit message for your changes. Lines starting

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

4 years agoAdd a setting to toggle DOMTimer throttling support
cdumez@apple.com [Wed, 19 Nov 2014 00:56:33 +0000 (00:56 +0000)]
Add a setting to toggle DOMTimer throttling support
https://bugs.webkit.org/show_bug.cgi?id=138844
<rdar://problem/19020874>

Reviewed by Andreas Kling.

Add a setting to disable DOM timers throttling, in order to help
developers determine if a specific issue is caused by timer
throttling.

Source/WebCore:

* page/DOMTimer.cpp:
(WebCore::DOMTimerFireState::contextDocument):
(WebCore::DOMTimerFireState::scriptMadeUserObservableChanges):
(WebCore::DOMTimer::isDOMTimersThrottlingEnabled):
(WebCore::DOMTimer::updateThrottlingStateIfNecessary):
* page/DOMTimer.h:
* page/Settings.in:

Source/WebKit/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences domTimersThrottlingEnabled]):
(-[WebPreferences setDOMTimersThrottlingEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetDOMTimersThrottlingEnabled):
(WKPreferencesGetDOMTimersThrottlingEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

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

4 years agoREGRESSION: Invoking dictionary lookup on text in some search fields searches for
bdakin@apple.com [Wed, 19 Nov 2014 00:49:33 +0000 (00:49 +0000)]
REGRESSION: Invoking dictionary lookup on text in some search fields searches for
incorrect item
https://bugs.webkit.org/show_bug.cgi?id=138853
-and corresponding-
rdar://problem/18912505

Reviewed by Tim Horton.

Get the visible position based on the frame, not just the renderer.
* editing/mac/DictionaryLookup.mm:
(WebCore::rangeForDictionaryLookupAtHitTestResult):

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

4 years agoREGRESSION (r167210): Invalid cast in WebCore::RenderBlock::blockSelectionGaps
hyatt@apple.com [Wed, 19 Nov 2014 00:37:35 +0000 (00:37 +0000)]
REGRESSION (r167210): Invalid cast in WebCore::RenderBlock::blockSelectionGaps
https://bugs.webkit.org/show_bug.cgi?id=137590

Reviewed by Dean Jackson.

Source/WebCore:

Added fast/block/selection-block-gaps-crash.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::blockSelectionGaps):
Check that we really are a RenderBlock before recurring.

LayoutTests:

* fast/block/selection-block-gap-crash-expected.txt: Added.
* fast/block/selection-block-gap-crash.html: Added.

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

4 years agoAvoid synchronous style recalc in Document.activeElement
akling@apple.com [Wed, 19 Nov 2014 00:20:07 +0000 (00:20 +0000)]
Avoid synchronous style recalc in Document.activeElement
<https://webkit.org/b/138850>

Reviewed by Ryosuke Niwa.

Source/WebCore:

This subtly changes the behavior of <input autofocus>, which was caught by
a layout test. Auto-focus doesn't happen until the render tree is attached,
although it was possible to force it by accessing document.activeElement.

Now auto-focus is always lazy. This is consistent with other browser engines.

~1% progression on Speedometer locally.

* dom/Document.cpp:
(WebCore::Document::activeElement):

LayoutTests:

Tweak a test to run once the DOM is loaded instead of during parsing.

* fast/forms/autofocus-in-sandbox-with-allow-scripts.html:

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

4 years agoHave Vector::capacity() return an unsigned instead of a size_t
cdumez@apple.com [Wed, 19 Nov 2014 00:17:27 +0000 (00:17 +0000)]
Have Vector::capacity() return an unsigned instead of a size_t
https://bugs.webkit.org/show_bug.cgi?id=138842

Reviewed by Andreas Kling.

Source/WebCore:

Update the code base now that Vector::capacity() returns an unsigned
type instead of a size_t.

No new tests, no behavior change.

* editing/TextIterator.cpp:
(WebCore::SearchBuffer::append):
(WebCore::SearchBuffer::prependContext):
(WebCore::SearchBuffer::search):
(WebCore::SearchBuffer::length):
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::duplicateDataBufferIfNecessary):

Source/WTF:

Have Vector::capacity() return an unsigned instead of a size_t as
capacity is stored as an unsigned internally.

* wtf/Vector.h:
(WTF::Vector::capacity):
(WTF::OverflowHandler>::expandCapacity):
(WTF::OverflowHandler>::tryExpandCapacity):

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

4 years agoRemoved the custom allocator for ListHashSet nodes
ggaren@apple.com [Tue, 18 Nov 2014 23:06:00 +0000 (23:06 +0000)]
Removed the custom allocator for ListHashSet nodes
https://bugs.webkit.org/show_bug.cgi?id=138841

Reviewed by Andreas Kling.

Source/WebCore:

Uses of ListHashSet no longer need to declare an inline capacity,
since that was only used to specify the capacity of the custom allocator.

* dom/DOMNamedFlowCollection.h:
* dom/DocumentEventQueue.h:
* dom/DocumentStyleSheetCollection.h:
* dom/NamedFlowCollection.h:
* html/FormController.h:
* rendering/FloatingObjects.h:
* rendering/RenderBlock.h:

Source/WebKit2:

Uses of ListHashSet no longer need to declare an inline capacity,
since that was only used to specify the capacity of the custom allocator.

* UIProcess/Plugins/PluginInfoStore.cpp:
(WebKit::PluginInfoStore::loadPluginsIfNecessary):

Source/WTF:

bmalloc is fast, so we don't need a custom allocator.

The MallocBench test for linked list node allocation (list_allocate) is
4.09X faster in bmalloc than TCMalloc. Also, I wrote a stress test to
add/remove link elements, which modify a ListHashSet on insertion and
removal, and it was 1% faster / in the noise with bmalloc enabled.

* wtf/ListHashSet.h:
(WTF::ListHashSetNode::ListHashSetNode):
(WTF::ListHashSetTranslator::translate):
(WTF::U>::ListHashSet):
(WTF::=):
(WTF::U>::swap):
(WTF::U>::~ListHashSet):
(WTF::U>::size):
(WTF::U>::capacity):
(WTF::U>::isEmpty):
(WTF::U>::first):
(WTF::U>::removeFirst):
(WTF::U>::takeFirst):
(WTF::U>::last):
(WTF::U>::removeLast):
(WTF::U>::takeLast):
(WTF::U>::contains):
(WTF::U>::remove):
(WTF::U>::clear):
(WTF::U>::unlink):
(WTF::U>::unlinkAndDelete):
(WTF::U>::appendNode):
(WTF::U>::prependNode):
(WTF::U>::insertNodeBefore):
(WTF::U>::deleteAllNodes):
(WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator): Deleted.
(WTF::ListHashSetNodeAllocator::allocate): Deleted.
(WTF::ListHashSetNodeAllocator::deallocate): Deleted.
(WTF::ListHashSetNodeAllocator::pool): Deleted.
(WTF::ListHashSetNodeAllocator::pastPool): Deleted.
(WTF::ListHashSetNodeAllocator::inPool): Deleted.
(WTF::ListHashSetNode::operator new): Deleted.
(WTF::ListHashSetNode::destroy): Deleted.

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

4 years agoUnreviewed build fix after r176283.
eric.carlson@apple.com [Tue, 18 Nov 2014 22:57:43 +0000 (22:57 +0000)]
Unreviewed build fix after r176283.

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:

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

4 years agoAvoid re-encoding action menu image data
timothy_horton@apple.com [Tue, 18 Nov 2014 22:54:52 +0000 (22:54 +0000)]
Avoid re-encoding action menu image data
https://bugs.webkit.org/show_bug.cgi?id=138817
<rdar://problem/18840382>

Reviewed by Anders Carlsson.

* Shared/mac/ActionMenuHitTestResult.h:
* Shared/mac/ActionMenuHitTestResult.mm:
(WebKit::ActionMenuHitTestResult::encode):
(WebKit::ActionMenuHitTestResult::decode):
Store and encode a SharedMemory with the raw encoded image data,
instead of re-painting the image into a ShareableBitmap.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _hitTestResultImage]):
(-[WKActionMenuController _defaultMenuItemsForImage]):
(-[WKActionMenuController _copyImage:]):
(-[WKActionMenuController _addImageToPhotos:]):
(-[WKActionMenuController _defaultMenuItems]):
(-[WKActionMenuController _canAddMediaToPhotos]): Deleted.
Build a temporary filename from a UUID and the image's desired extension.
Use the Image's encoded data instead of re-encoding it with CGImageDestination.
Build an image menu only if we have an image, URL, data, and extension.

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):

* WebView/WebActionMenuController.mm:
(-[WebActionMenuController _defaultMenuItemsForImage:]):
(-[WebActionMenuController _addImageToPhotos:]):
Build a temporary filename from a UUID and the image's desired extension.
Use the Image's encoded data instead of re-encoding it with CGImageDestination.
Build an image menu only if we have an image, URL, data, and extension.

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

4 years agoREGRESSION(r152313): Inline-block element doesn't wrap properly
hyatt@apple.com [Tue, 18 Nov 2014 22:51:42 +0000 (22:51 +0000)]
REGRESSION(r152313): Inline-block element doesn't wrap properly
https://bugs.webkit.org/show_bug.cgi?id=138846 - <rdar://problem/18838703>

Reviewed by Simon Fraser.

Source/WebCore:

Added fast/inline-block/inline-block-empty-spans.html

* rendering/line/BreakingContextInlineHeaders.h:
(WebCore::BreakingContext::canBreakAtThisPosition):

LayoutTests:

* fast/inline-block/inline-block-empty-spans-expected.html: Added.
* fast/inline-block/inline-block-empty-spans.html: Added.

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

4 years agoMulticolumn layout with negative line spacing and orphans causes pieces of letters...
mmaxfield@apple.com [Tue, 18 Nov 2014 22:40:29 +0000 (22:40 +0000)]
Multicolumn layout with negative line spacing and orphans causes pieces of letters to be shown at the bottom of columns
https://bugs.webkit.org/show_bug.cgi?id=138204

Source/WebCore:

Reviewed by Dave Hyatt.

This code is responsible for pushing block elements to the next column if
the "orphans" CSS property is triggered. The mechanism by which this is
achieved is to push the block down such that the origin of the block is
at the origin of the next column. However, if there is negative line
spacing, the top portion of the text might actually be on top of the
origin of the block. Therefore, the block wasn't being pushed down enough
to entirely contain its text, so the top pieces were being drawn on the
previous column.

Test: fast/multicol/orphans-negative-line-spacing.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustLinePositionForPagination):

LayoutTests:

Patch by Myles C. Maxfield <litherum@gmail.com> on 2014-11-18
Reviewed by Dave Hyatt.

Create a layout where the "orphans" css property causes a block element to
be pushed to the next column.

* fast/multicol/orphans-negative-line-spacing-expected.html: Added.
* fast/multicol/orphans-negative-line-spacing.html: Added.

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

4 years ago[iOS] allow host application to opt-out of alternate fullscreen
eric.carlson@apple.com [Tue, 18 Nov 2014 22:10:09 +0000 (22:10 +0000)]
[iOS] allow host application to opt-out of alternate fullscreen
https://bugs.webkit.org/show_bug.cgi?id=138787

Reviewed by Sam Weinig.

"allowsAlternateFullscreen" doesn't need to be in the public WKWebView header.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]): allowsAlternateFullscreen -> _allowsAlternateFullscreen.

* UIProcess/API/Cocoa/WKWebViewConfiguration.h: Remove allowsAlternateFullscreen.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _allowsAlternateFullscreen]): New.
(-[WKWebViewConfiguration _setAllowsAlternateFullscreen:]): New.

* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Declare _allowsAlternateFullscreen.

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

4 years agoDOMTimers sometimes don't get unthrottled on scrolling
cdumez@apple.com [Tue, 18 Nov 2014 22:05:10 +0000 (22:05 +0000)]
DOMTimers sometimes don't get unthrottled on scrolling
https://bugs.webkit.org/show_bug.cgi?id=138838

Reviewed by Antti Koivisto.

Source/WebCore:

DOMTimers sometimes didn't get unthrottled on scrolling. This is
because we stopped listening for viewport changes every time the
timer fires, but we didn't listen for those changes again if we
decided the timer should stay throttled after the timer's action
was executed.

We should listen for viewport changes again after executing the
timer's action, if there are elements outside the viewport causing
the DOMTimer to be throttled, even if the throttleState hasn't
changed (i.e the timer stays throttled).

Test: fast/dom/timer-unthrottle-on-scroll.html

* page/DOMTimer.cpp:
(WebCore::DOMTimer::updateThrottlingStateIfNecessary):
(WebCore::DOMTimer::updateTimerIntervalIfNecessary):
(WebCore::DOMTimer::updateThrottlingStateAfterViewportChange):

LayoutTests:

Add a layout test to verify that DOMTimers get unthrottled on scroll if
the element whose style they are changing is inside the viewport after
the scroll.

* fast/dom/timer-unthrottle-on-scroll-expected.txt: Added.
* fast/dom/timer-unthrottle-on-scroll.html: Added.

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

4 years agoRemove the WinCairo buildbot
ossy@webkit.org [Tue, 18 Nov 2014 20:59:40 +0000 (20:59 +0000)]
Remove the WinCairo buildbot
https://bugs.webkit.org/show_bug.cgi?id=138805

Reviewed by Alex Christensen.

* BuildSlaveSupport/build.webkit.org-config/config.json:
* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(appendCustomBuildFlags):
* BuildSlaveSupport/test-result-archive:
(archiveTestResults):

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

4 years ago[iOS] Make WebCore build and link with public SDK
dbates@webkit.org [Tue, 18 Nov 2014 20:56:31 +0000 (20:56 +0000)]
[iOS] Make WebCore build and link with public SDK
https://bugs.webkit.org/show_bug.cgi?id=136487

Patch by Daniel Bates <dbates@webkit.org> on 2014-11-18
Reviewed by David Kilzer.

* bindings/objc/DOMInternal.mm: Include header NSMapTableSPI.h.
* bindings/objc/WebScriptObject.mm: Ditto; Also fix style nit, substitute
#import for #include when importing header WTFString.h.
* bridge/objc/objc_instance.mm: Include header NSMapTableSPI.h and remove
#import NSMapTable.h as the former will import the latter.
* platform/ios/PlatformEventFactoryIOS.mm: Include header wtf/CurrentTime.h
for the declaration of WTF::currentTime().
* platform/ios/wak/WebCoreThread.mm: Remove unnecessary include of header CoreFoundation/CFPriv.h.
* platform/spi/ios/AVKitSPI.h: Add more SPI.
* platform/spi/ios/MPAVRoutingControllerSPI.h: Ditto.

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

4 years agoUnreviewed. Updated the install instruction.
rniwa@webkit.org [Tue, 18 Nov 2014 20:12:53 +0000 (20:12 +0000)]
Unreviewed. Updated the install instruction.

* Install.md:

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

4 years agoSubclass CachedFont for SVG fonts
mmaxfield@apple.com [Tue, 18 Nov 2014 20:04:38 +0000 (20:04 +0000)]
Subclass CachedFont for SVG fonts
https://bugs.webkit.org/show_bug.cgi?id=138686

Reviewed by Simon Fraser.

Re-landing due to flakey bots.

Source/WebCore:

CachedFont had many #if ENABLE(SVG_FONTS) scattered throughout it.
Splitting out this SVG-specific code into a subclass of CachedFont
cleans up the design.

No new tests because there is no behavior change.

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::getFontData): There are two sections
in this function; one for SVG fonts and one for regular fonts.
I've moved these two sections into CachedFont and SVGCachedFont,
thereby simplifying this function.
(WebCore::CSSFontFaceSource::ensureFontData): Ditto.
(WebCore::CSSFontFaceSource::svgFontFaceElement): Moved to header.
(WebCore::CSSFontFaceSource::setSVGFontFaceElement): Ditto.
(WebCore::CSSFontFaceSource::isSVGFontFaceSource): Ditto.
* css/CSSFontFaceSource.h: Put functions that are simple enough to
be inlined here.
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::isSVGFontTarget): Convenience
function.
(WebCore::CSSFontFaceSrcValue::cachedFont): Pass through a boolean
from CSSFontSelector to CachedResourceHandle regarding if we should
be using SVGCachedFont instead of CachedFont.
* css/CSSFontFaceSrcValue.h: New convenience function.
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule): Pass through a boolean
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResourceType): Update for new
CachedResource type
(WebCore::cachedResourcesForFrame): Ditto.
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::CachedFont):
(WebCore::CachedFont::ensureCustomFontData): Taken from
CSSFontFaceSource::getFontData()
(WebCore::CachedFont::getFontData): Ditto.
(WebCore::CachedFont::platformDataFromCustomData): Ditto.
(WebCore::CachedFont::ensureSVGFontData): Moved to SVGCachedFont.
(WebCore::CachedFont::getSVGFontById): Ditto.
* loader/cache/CachedFont.h:
* loader/cache/CachedResource.cpp:
(WebCore::defaultPriorityForResourceType): Update for new enum
type.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource): Takes new boolean.
(WebCore::CachedResourceLoader::requestFont): Ditto.
(WebCore::CachedResourceLoader::checkInsecureContent): Update for
new enum type
(WebCore::CachedResourceLoader::canRequest): Ditto.
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedSVGFont.cpp: Added.
(WebCore::CachedSVGFont::CachedSVGFont): Moved from
CSSFontFaceSource::getFontData() and CachedFont
(WebCore::CachedSVGFont::getFontData): Ditto.
(WebCore::CachedSVGFont::platformDataFromCustomData): Ditto.
(WebCore::CachedSVGFont::ensureCustomFontData): Ditto.
(WebCore::CachedSVGFont::getSVGFontById): Ditto.
(WebCore::CachedSVGFont::firstFontFace): Ditto.
* loader/cache/CachedSVGFont.h: Subclass CachedFont.
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::getStatistics): Update for new enum.
* svg/SVGFontFaceUriElement.cpp:
(WebCore::isSVGFontTarget): Convenience function.
(WebCore::SVGFontFaceUriElement::loadFont): Update for new
boolean.

Source/WebKit2:

Update for enum type.

* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::maximumBufferingTime):

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

4 years agoUpdate the Vector API to deal with unsigned types instead of size_t
cdumez@apple.com [Tue, 18 Nov 2014 19:56:01 +0000 (19:56 +0000)]
Update the Vector API to deal with unsigned types instead of size_t
https://bugs.webkit.org/show_bug.cgi?id=138824

Reviewed by Andreas Kling.

Source/JavaScriptCore:

Update code base to fix build errors related to the typing changes
in the Vector API (size_t -> unsigned).

* bytecode/PreciseJumpTargets.cpp:
* replay/EncodedValue.h:

Source/WebCore:

Update code base to fix build errors related to the typing changes
in the Vector API (size_t -> unsigned).

No new tests, no behavior change.

* WebCore.exp.in:
* bindings/js/JSDOMBinding.h:
(WebCore::jsArray):
* bindings/js/JSWebGLRenderingContextCustom.cpp:
* cssjit/SelectorCompiler.cpp:
* html/HTMLFormElement.cpp:
(WebCore::removeFromVector):
* html/parser/HTMLParserIdioms.h:
* html/parser/XSSAuditor.cpp:

Source/WebKit2:

Update code base to fix build errors related to the typing changes
in the Vector API (size_t -> unsigned).

* Platform/IPC/ArgumentCoders.h:
* Platform/IPC/DataReference.h:

Source/WTF:

Update part of the Vector API to deal with unsigned types instead of
size_t. The Vector class is already using unsigned type for its
capacity and size data members. However, the Vector API was never
updated accordingly.

The rest of the Vector API will be ported in follow-up patches to
make the change smaller and more easily reviewable.

* wtf/Forward.h:
* wtf/Vector.h:
(WTF::VectorTypeOperations::compare):
(WTF::VectorBufferBase::allocateBuffer):
(WTF::VectorBufferBase::tryAllocateBuffer):
(WTF::VectorBufferBase::shouldReallocateBuffer):
(WTF::VectorBufferBase::reallocateBuffer):
(WTF::VectorBufferBase::capacity):
(WTF::VectorBufferBase::VectorBufferBase):
(WTF::VectorBuffer::VectorBuffer):
(WTF::VectorBuffer::allocateBuffer):
(WTF::VectorBuffer::tryAllocateBuffer):
(WTF::VectorBuffer::shouldReallocateBuffer):
(WTF::VectorBuffer::reallocateBuffer):
(WTF::VectorBuffer::swap):
(WTF::VectorBuffer::swapInlineBuffer):
(WTF::VectorBuffer::swapInlineBuffers):
(WTF::Vector::Vector):
(WTF::Vector::at):
(WTF::Vector::operator[]):
(WTF::OverflowHandler>::find):
(WTF::OverflowHandler>::reverseFind):
(WTF::OverflowHandler>::fill):
(WTF::OverflowHandler>::expandCapacity):
(WTF::OverflowHandler>::tryExpandCapacity):
(WTF::OverflowHandler>::resize):
(WTF::OverflowHandler>::resizeToFit):
(WTF::OverflowHandler>::shrink):
(WTF::OverflowHandler>::grow):
(WTF::OverflowHandler>::reserveCapacity):
(WTF::OverflowHandler>::tryReserveCapacity):
(WTF::OverflowHandler>::reserveInitialCapacity):
(WTF::OverflowHandler>::shrinkCapacity):
(WTF::OverflowHandler>::append):
(WTF::OverflowHandler>::tryAppend):
(WTF::OverflowHandler>::insert):
(WTF::OverflowHandler>::insertVector):
(WTF::OverflowHandler>::remove):
(WTF::OverflowHandler>::reverse):
(WTF::OverflowHandler>::checkConsistency):
* wtf/text/AtomicString.h:
* wtf/text/StringImpl.h:
(WTF::StringImpl::adopt):
(WTF::equalIgnoringNullity):
* wtf/text/StringView.h:
(WTF::append):
* wtf/text/WTFString.h:

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

4 years agoUnreviewed iOS build fix
mmaxfield@apple.com [Tue, 18 Nov 2014 19:32:51 +0000 (19:32 +0000)]
Unreviewed iOS build fix

* platform/graphics/ios/SimpleFontDataIOS.mm:
(WebCore::SimpleFontData::platformInit):

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

4 years agoiOS build fix.
mitz@apple.com [Tue, 18 Nov 2014 19:31:49 +0000 (19:31 +0000)]
iOS build fix.

* platform/graphics/ios/SimpleFontDataIOS.mm:
(WebCore::SimpleFontData::platformInit):

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

4 years ago[WinCairo] Compile errors when GStreamer is enabled.
commit-queue@webkit.org [Tue, 18 Nov 2014 19:10:21 +0000 (19:10 +0000)]
[WinCairo] Compile errors when GStreamer is enabled.
https://bugs.webkit.org/show_bug.cgi?id=137000

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-11-18
Reviewed by Philippe Normand.

MSVC does not allow the keyword default on move constructors and move assignment operators.

* wtf/gobject/GMainLoopSource.cpp:
(WTF::GMainLoopSource::cancel):
(WTF::GMainLoopSource::socketCallback):
* wtf/gobject/GMainLoopSource.h:
(WTF::GMainLoopSource::Context::operator=):

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

4 years agoUnreviewed, rolling out r176264.
commit-queue@webkit.org [Tue, 18 Nov 2014 18:52:38 +0000 (18:52 +0000)]
Unreviewed, rolling out r176264.
https://bugs.webkit.org/show_bug.cgi?id=138837

caused many test failures (Requested by litherum on #webkit).

Reverted changeset:

"Subclass CachedFont for SVG fonts"
https://bugs.webkit.org/show_bug.cgi?id=138686
http://trac.webkit.org/changeset/176264

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

4 years agoUnreviewed, rolling out r176207.
commit-queue@webkit.org [Tue, 18 Nov 2014 18:14:45 +0000 (18:14 +0000)]
Unreviewed, rolling out r176207.
https://bugs.webkit.org/show_bug.cgi?id=138836

Not ready yet (Requested by ap on #webkit).

Reverted changeset:

"Update WebKit to build with LLVM TOT"
https://bugs.webkit.org/show_bug.cgi?id=138519
http://trac.webkit.org/changeset/176207

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

4 years ago[iOS] Libdispatch, Dyld, IOKit, Mach, NSPointerFunctions, MobileGestalt
dbates@webkit.org [Tue, 18 Nov 2014 18:05:57 +0000 (18:05 +0000)]
[iOS] Libdispatch, Dyld, IOKit, Mach, NSPointerFunctions, MobileGestalt
SPI are not available in public SDK
https://bugs.webkit.org/show_bug.cgi?id=138802

Reviewed by David Kilzer.

Source/WebCore:

Add SPI wrapper headers {Dispatch, DynamicLinker, IOPMLib, MachVM, NSPointerFunctions, MobileGestalt}SPI.h
that forward declare applicable libdispatch, dyld, IOKit, mach, Foundation, MobileGestalt SPI
and use these headers instead of the including private headers corresponding to these libraries/frameworks.

* WebCore.xcodeproj/project.pbxproj: Add private headers MobileGestaltSPI.h and
MachVMSPI.h, and project headers DynamicLinkerSPI.h, NSPointerFunctionsSPI.h,
DispatchSPI.h and IOPMLibSPI.h. Also, sort files in Xcode project.
* bindings/objc/DOMInternal.mm: Include header NSPointerFunctionsSPI.h.
* bridge/objc/objc_instance.mm: Ditto; Also, sort #import directives.
* platform/cocoa/DisplaySleepDisablerCocoa.cpp: Substitute header IOPMLibSPI.h
for private header IOKit/pwr_mgt/IOPMLib.h.
* platform/cocoa/MemoryPressureHandlerCocoa.mm: Substitute header DispatchSPI.h
for private header dispatch/private.h.
* platform/graphics/ios/FontServicesIOS.mm: Substitute header DynamicLinkerSPI.h
for private header mach-o/dyld_priv.h.
* platform/ios/PlatformScreenIOS.mm: Substitute header MobileGestaltSPI.h for
private header MobileGestalt.h.
* platform/spi/cocoa/DispatchSPI.h: Added.
* platform/spi/cocoa/DynamicLinkerSPI.h: Added.
* platform/spi/cocoa/IOPMLibSPI.h: Added.
* platform/spi/cocoa/MachVMSPI.h: Added.
* platform/spi/cocoa/NSPointerFunctionsSPI.h: Added.
* platform/spi/ios/MobileGestaltSPI.h: Added.

Source/WebKit/mac:

Include headers DispatchSPI.h and MobileGestaltSPI.h instead of including
libdispatch and MobileGestalt headers directly.

* WebView/WebView.mm:

Source/WebKit2:

Include headers DispatchSPI.h and MachVMSPI.h.h instead of including
libdispatch and Mach headers directly.

* Platform/mac/SharedMemoryMac.cpp:
* UIProcess/ios/WebMemoryPressureHandlerIOS.mm:

Tools:

Include header MachVMSPI.h instead of including the private header mach/mach_vm.h.

* DumpRenderTree/mac/CheckedMalloc.cpp:

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

4 years agoSubclass CachedFont for SVG fonts
mmaxfield@apple.com [Tue, 18 Nov 2014 18:04:17 +0000 (18:04 +0000)]
Subclass CachedFont for SVG fonts
https://bugs.webkit.org/show_bug.cgi?id=138686

Reviewed by Simon Fraser.

Source/WebCore:

CachedFont had many #if ENABLE(SVG_FONTS) scattered throughout it.
Splitting out this SVG-specific code into a subclass of CachedFont
cleans up the design.

No new tests because there is no behavior change.

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::getFontData): There are two sections
in this function; one for SVG fonts and one for regular fonts.
I've moved these two sections into CachedFont and SVGCachedFont,
thereby simplifying this function.
(WebCore::CSSFontFaceSource::ensureFontData): Ditto.
(WebCore::CSSFontFaceSource::svgFontFaceElement): Moved to header.
(WebCore::CSSFontFaceSource::setSVGFontFaceElement): Ditto.
(WebCore::CSSFontFaceSource::isSVGFontFaceSource): Ditto.
* css/CSSFontFaceSource.h: Put functions that are simple enough to
be inlined here.
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::isSVGFontTarget): Convenience
function.
(WebCore::CSSFontFaceSrcValue::cachedFont): Pass through a boolean
from CSSFontSelector to CachedResourceHandle regarding if we should
be using SVGCachedFont instead of CachedFont.
* css/CSSFontFaceSrcValue.h: New convenience function.
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule): Pass through a boolean
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResourceType): Update for new
CachedResource type
(WebCore::cachedResourcesForFrame): Ditto.
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::CachedFont):
(WebCore::CachedFont::ensureCustomFontData): Taken from
CSSFontFaceSource::getFontData()
(WebCore::CachedFont::getFontData): Ditto.
(WebCore::CachedFont::platformDataFromCustomData): Ditto.
(WebCore::CachedFont::ensureSVGFontData): Moved to SVGCachedFont.
(WebCore::CachedFont::getSVGFontById): Ditto.
* loader/cache/CachedFont.h:
* loader/cache/CachedResource.cpp:
(WebCore::defaultPriorityForResourceType): Update for new enum
type.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource): Takes new boolean.
(WebCore::CachedResourceLoader::requestFont): Ditto.
(WebCore::CachedResourceLoader::checkInsecureContent): Update for
new enum type
(WebCore::CachedResourceLoader::canRequest): Ditto.
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedSVGFont.cpp: Added.
(WebCore::CachedSVGFont::CachedSVGFont): Moved from
CSSFontFaceSource::getFontData() and CachedFont
(WebCore::CachedSVGFont::getFontData): Ditto.
(WebCore::CachedSVGFont::platformDataFromCustomData): Ditto.
(WebCore::CachedSVGFont::ensureCustomFontData): Ditto.
(WebCore::CachedSVGFont::getSVGFontById): Ditto.
(WebCore::CachedSVGFont::firstFontFace): Ditto.
* loader/cache/CachedSVGFont.h: Subclass CachedFont.
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::getStatistics): Update for new enum.
* svg/SVGFontFaceUriElement.cpp:
(WebCore::isSVGFontTarget): Convenience function.
(WebCore::SVGFontFaceUriElement::loadFont): Update for new
boolean.

Source/WebKit2:

Update for enum type.

* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::maximumBufferingTime):

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

4 years agoUse underlining metrics from the font file
mmaxfield@apple.com [Tue, 18 Nov 2014 18:04:13 +0000 (18:04 +0000)]
Use underlining metrics from the font file
https://bugs.webkit.org/show_bug.cgi?id=138762

Patch by Myles C. Maxfield <litherum@gmail.com> on 2014-11-18
Reviewed by Dave Hyatt.

Source/WebCore:

Test: platform/mac/fast/css3-text/css3-text-decoration/text-decoration-thickness.html

* platform/graphics/FontMetrics.h: Adding variables for text decoration thickness and
underline position.
(WebCore::FontMetrics::FontMetrics):
(WebCore::FontMetrics::decorationThickness):
(WebCore::FontMetrics::setDecorationThickness):
(WebCore::FontMetrics::underlinePosition):
(WebCore::FontMetrics::setUnderlinePosition):
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::SimpleFontData::platformInit): Initialize new FontMetrics members.
* platform/graphics/ios/SimpleFontDataIOS.mm:
(WebCore::SimpleFontData::platformInit): Ditto.
* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::platformInit): Ditto.
* platform/graphics/win/SimpleFontDataCGWin.cpp:
(WebCore::SimpleFontData::platformInit): Ditto.
* platform/graphics/win/SimpleFontDataCairoWin.cpp:
(WebCore::SimpleFontData::platformInit): Ditto.
* platform/graphics/win/SimpleFontDataWin.cpp:
(WebCore::SimpleFontData::initGDIFont): Ditto.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintDecoration): Use FontMetrics data.
* style/InlineTextBoxStyle.cpp:
(WebCore::computeUnderlineOffset): Ditto.
(WebCore::visualOverflowForDecorations): Ditto.
* style/InlineTextBoxStyle.h:
(WebCore::textDecorationStrokeThickness): Deleted.
* svg/SVGFontData.cpp:
(WebCore::SVGFontData::initializeFontData): Initialize new FontMetrics members.

LayoutTests:

This patch makes underline placement platform-dependent.

* platform/mac/fast/css3-text/css3-text-decoration/text-decoration-thickness-expected.html: Renamed from LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thickness-expected.html.
* platform/mac/fast/css3-text/css3-text-decoration/text-decoration-thickness.html: Renamed from LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-thickness.html.

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