Move more CSS properties to the new StyleBuilder
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-11-17  Chris Dumez  <cdumez@apple.com>
2
3         Move more CSS properties to the new StyleBuilder
4         https://bugs.webkit.org/show_bug.cgi?id=138766
5
6         Reviewed by Darin Adler.
7
8         Move more CSS properties from DeprecatedStyleBuilder to the new
9         StyleBuilder:
10         line-height
11         word-spacing
12         -webkit-marquee-repetition
13         -webkit-text-underline-position
14
15         No new tests, no behavior change.
16
17         * css/CSSPropertyNames.in:
18         * css/DeprecatedStyleBuilder.cpp:
19         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
20         (WebCore::csstoLengthConversionDataWithTextZoomFactor): Deleted.
21         (WebCore::ApplyPropertyMarqueeRepetition::applyValue): Deleted.
22         (WebCore::ApplyPropertyMarqueeRepetition::createHandler): Deleted.
23         (WebCore::ApplyPropertyTextUnderlinePosition::applyValue): Deleted.
24         (WebCore::ApplyPropertyTextUnderlinePosition::createHandler): Deleted.
25         (WebCore::ApplyPropertyLineHeight::applyValue): Deleted.
26         (WebCore::ApplyPropertyLineHeight::createHandler): Deleted.
27         (WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyValue): Deleted.
28         (WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyInitialValue): Deleted.
29         (WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyInheritValue): Deleted.
30         (WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::createHandler): Deleted.
31         (WebCore::ApplyPropertyWordSpacing::applyValue): Deleted.
32         (WebCore::ApplyPropertyWordSpacing::createHandler): Deleted.
33         * css/StyleBuilderConverter.h:
34         (WebCore::StyleBuilderConverter::convertMarqueeRepetition):
35         (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
36         * css/StyleBuilderCustom.h:
37         (WebCore::StyleBuilderFunctions::csstoLengthConversionDataWithTextZoomFactor):
38         (WebCore::StyleBuilderFunctions::convertLineHeight):
39         (WebCore::StyleBuilderFunctions::applyValueWordSpacing):
40         (WebCore::StyleBuilderFunctions::applyInheritLineHeight):
41         (WebCore::StyleBuilderFunctions::applyInitialLineHeight):
42         (WebCore::StyleBuilderFunctions::applyValueLineHeight):
43
44 2014-11-16  Andreas Kling  <akling@apple.com>
45
46         Avoid synchronous style recalc when mutating a Node inside FrameSelection.
47         <https://webkit.org/b/138791>
48
49         Reviewed by Antti Koivisto.
50
51         We can safely clear the RenderView's selection without doing a synchronous
52         style recalc first.
53
54         This is a small progression on Speedometer locally.
55
56         * editing/FrameSelection.cpp:
57         (WebCore::DragCaretController::nodeWillBeRemoved):
58         (WebCore::FrameSelection::respondToNodeModification):
59         (WebCore::clearRenderViewSelection): Deleted.
60
61             Merged clearRenderViewSelection() into the call sites and removed
62             the now-unnecessary protection of the Document.
63
64 2014-11-17  Eric Carlson  <eric.carlson@apple.com>
65
66         [iOS] allow host application to opt-out of alternate fullscreen
67         https://bugs.webkit.org/show_bug.cgi?id=138787
68
69         Reviewed by Darin Adler.
70
71         * Modules/mediacontrols/MediaControlsHost.cpp:
72         (WebCore::MediaControlsHost::optimizedFullscreenSupported): Check mediaSession().allowsAlternateFullscreen.
73
74         * html/HTMLMediaElement.cpp:
75         (WebCore::HTMLMediaElement::enterFullscreenOptimized): Do nothing if
76             mediaSession().allowsAlternateFullscreen says it isn't allowed.
77
78         * html/HTMLMediaSession.cpp:
79         (WebCore::HTMLMediaSession::allowsAlternateFullscreen): New, check settings.
80         * html/HTMLMediaSession.h:
81
82         * page/Settings.cpp: Add allowsAlternateFullscreen.
83         * page/Settings.in: Ditto.
84
85 2014-11-16  Zan Dobersek  <zdobersek@igalia.com>
86
87         Replace RenderSVGResource::cast<T>() with downcast<T>()
88         https://bugs.webkit.org/show_bug.cgi?id=138290
89
90         Reviewed by Chris Dumez.
91
92         Add type traits for the RenderSVGResource hierarchy. This enables
93         using the typecasting framework in getRenderSVGResourceById() that
94         in return renders the RenderSVGResource::cast<>() template and all
95         the static s_resourceType member variables in the hierarchy removable.
96
97         * WebCore.order:
98         * rendering/svg/RenderSVGResource.h:
99         (WebCore::RenderSVGResource::cast): Deleted.
100         * rendering/svg/RenderSVGResourceClipper.h:
101         * rendering/svg/RenderSVGResourceContainer.h:
102         (WebCore::getRenderSVGResourceById):
103         * rendering/svg/RenderSVGResourceFilter.h:
104         (isType):
105         * rendering/svg/RenderSVGResourceLinearGradient.h:
106         * rendering/svg/RenderSVGResourceMarker.h:
107         * rendering/svg/RenderSVGResourceMasker.h:
108         * rendering/svg/RenderSVGResourcePattern.h:
109         * rendering/svg/RenderSVGResourceRadialGradient.h:
110         * rendering/svg/RenderSVGResourceSolidColor.h:
111
112 2014-11-16  Benjamin Poulain  <benjamin@webkit.org>
113
114         Implement :valid and :invalid matching for the fieldset element
115         https://bugs.webkit.org/show_bug.cgi?id=138769
116
117         Reviewed by Darin Adler.
118
119         In the latest HTML spec, the pseudo classes :valid and :invalid match
120         a fieldset element based on its descendants:
121             https://html.spec.whatwg.org/#selector-valid
122             https://html.spec.whatwg.org/#selector-invalid
123
124         This patch adds that behavior.
125
126         There are two key problems to solve with these pseudo classes on fieldset:
127         -Efficient matching.
128         -Style invalidation when any of the descendant changes.
129
130         To implement the style invalidation, I have modified HTMLFormControlElement
131         to notify its ancestor when its state changes.
132
133         The first change is making the state fully internal to HTMLFormControlElement,
134         we do not want subclass to be able to change the behavior and forget to update
135         the ancestors.
136
137         To achieve that encapsulation, the interface was changed a bit:
138         -Neither willValidate() nor isValidFormControlElement() inherit from Element.
139          Instead, willValidate() is the implementation of FormAssociatedElement's interface
140          and it is final. The method isValidFormControlElement() becomes completely internal
141          to HTMLFormControlElement.
142         -Since willValidate() should no longer be re-implemented by subclass, the elements
143          that were depending on it have been migrated to recalcWillValidate() to set
144          the initial state as needed.
145
146         With the validity state fully encapsulated in HTMLFormControlElement, all I need
147         is a way to communicate that information to HTMLFieldSetElement ancestors.
148         This is done in two cases:
149         -The validity state changes.
150         -The tree changes in a way that would make the input element not a descendant
151          of a HTMLFieldSetElement.
152
153         The invalidation is simply done by walking up the ancestors and adding the current
154         element to a "validity dependency list" on each HTMLFieldSetElement.
155
156         Tests: fast/css/pseudo-invalid-fieldset-invalidation-optimization.html
157                fast/css/pseudo-invalid-fieldset-style-sharing.html
158                fast/css/pseudo-invalid-fieldset.html
159                fast/css/pseudo-valid-fieldset-invalidation-optimization.html
160                fast/css/pseudo-valid-fieldset-style-sharing.html
161                fast/css/pseudo-valid-fieldset.html
162                fast/selectors/invalid-fieldset-style-update-1.html
163                fast/selectors/invalid-fieldset-style-update-2.html
164                fast/selectors/invalid-fieldset-style-update-3.html
165                fast/selectors/invalid-fieldset-style-update-4.html
166                fast/selectors/invalid-fieldset-style-update-5.html
167                fast/selectors/valid-fieldset-style-update-1.html
168                fast/selectors/valid-fieldset-style-update-2.html
169                fast/selectors/valid-fieldset-style-update-3.html
170                fast/selectors/valid-fieldset-style-update-4.html
171                fast/selectors/valid-fieldset-style-update-5.html
172
173         * css/SelectorCheckerTestFunctions.h:
174         (WebCore::isInRange):
175         (WebCore::isOutOfRange):
176         (WebCore::isInvalid):
177         (WebCore::isValid):
178         The hack "ContainsValidityStyleRules" is in the way of correct styling
179         of FieldSet and Form.
180         It is not the right way to get stylesheet properties anyway.
181
182         * css/StyleResolver.cpp:
183         (WebCore::StyleResolver::canShareStyleWithControl):
184         Make sure style sharing does not incorrectly share style for fieldset elements.
185
186         * dom/Document.cpp:
187         (WebCore::Document::Document):
188         * dom/Document.h:
189         (WebCore::Document::containsValidityStyleRules): Deleted.
190         (WebCore::Document::setContainsValidityStyleRules): Deleted.
191         * dom/Element.h:
192         (WebCore::Element::matchesValidPseudoClass):
193         (WebCore::Element::matchesInvalidPseudoClass):
194         (WebCore::Element::willValidate): Deleted.
195         (WebCore::Element::isValidFormControlElement): Deleted.
196         * html/FormAssociatedElement.cpp:
197         (WebCore::FormAssociatedElement::customError):
198         * html/FormAssociatedElement.h:
199
200         * html/HTMLFieldSetElement.cpp:
201         (WebCore::HTMLFieldSetElement::matchesValidPseudoClass):
202         (WebCore::HTMLFieldSetElement::matchesInvalidPseudoClass):
203         (WebCore::HTMLFieldSetElement::addInvalidDescendant):
204         (WebCore::HTMLFieldSetElement::removeInvalidDescendant):
205         Each HTMLFormControlElement that has constraint validation adds or removes
206         itself from its HTMLFieldSetElement ancestors.
207
208         It should be possible to just keep track of a count instead of a HashSet.
209         I decided to got with the HashSet to make the code more robust and easier
210         to debug. A few assertions ensure that the HashSet is actually used as a counter.
211
212         * html/HTMLFieldSetElement.h:
213         * html/HTMLFormControlElement.cpp:
214         (WebCore::addInvalidElementToAncestorFromInsertionPoint):
215         (WebCore::removeInvalidElementToAncestorFromInsertionPoint):
216
217         (WebCore::HTMLFormControlElement::insertedInto):
218         (WebCore::HTMLFormControlElement::removedFrom):
219         One tricky part of those two functions is that we cannot use
220         matchesValidPseudoClass() or matchesInvalidPseudoClass().
221
222         The reason is that HTMLFieldSetElement is a subclass of HTMLFormControlElement
223         and it has its own definition of what Valid and Invalid mean when matching selectors.
224
225         In HTMLFormControlElement, we must use the internal state,
226         willValidate() and isValidFormControlElement() must be used directly.
227
228         (WebCore::HTMLFormControlElement::matchesValidPseudoClass):
229         (WebCore::HTMLFormControlElement::matchesInvalidPseudoClass):
230         (WebCore::HTMLFormControlElement::willValidate):
231         (WebCore::addInvalidElementToAncestors):
232         (WebCore::removeInvalidElementFromAncestors):
233         (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
234         (WebCore::HTMLFormControlElement::setNeedsValidityCheck):
235         (WebCore::HTMLFormControlElement::isValidFormControlElement): Deleted.
236         * html/HTMLFormControlElement.h:
237         (WebCore::HTMLFormControlElement::isValidFormControlElement):
238         * html/HTMLKeygenElement.h:
239         * html/HTMLObjectElement.h:
240         * html/HTMLOutputElement.h:
241
242 2014-11-16  Zan Dobersek  <zdobersek@igalia.com>
243
244         [TexMap] Add typecasting support for GraphicsLayerTextureMapper
245         https://bugs.webkit.org/show_bug.cgi?id=138741
246
247         Reviewed by Martin Robinson.
248
249         Add type traits for the GraphicsLayerTextureMapper class.
250         This enables using typecasting functions instead of
251         toGraphicsLayerTextureMapper().
252
253         Remove toTextureMapperLayer() casting function which actually
254         returned the TextureMapperLayer object that belonged to the
255         passed-in GraphicsLayerTextureMapper. Instead, the GraphicsLayer
256         object is now downcasted and the TextureMapperLayer is accessed
257         by calling the GraphicsLayerTextureMapper::layer() method.
258
259         * platform/graphics/GraphicsLayer.h:
260         (WebCore::GraphicsLayer::isGraphicsLayerTextureMapper):
261         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
262         (WebCore::toTextureMapperLayerVector):
263         (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
264         (WebCore::toTextureMapperLayer): Deleted.
265         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
266         (WebCore::toGraphicsLayerTextureMapper): Deleted.
267
268 2014-11-16  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
269
270         Move WebCore/loader to std::unique_ptr
271         https://bugs.webkit.org/show_bug.cgi?id=138646
272
273         Reviewed by Chris Dumez.
274
275         Replace OwnPtr with std::unique_ptr<> and std::make_unique<>.
276         However this patch leaves ResourceRequest::adopt() because this need
277         to be handled by different patch.
278
279         No new tests, no behavior changes.
280
281         * loader/DocumentThreadableLoader.cpp:
282         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
283         (WebCore::DocumentThreadableLoader::preflightSuccess):
284         * loader/DocumentThreadableLoader.h:
285         * loader/SubresourceLoader.cpp:
286         (WebCore::SubresourceLoader::SubresourceLoader):
287         (WebCore::SubresourceLoader::didReceiveResponse):
288         (WebCore::SubresourceLoader::notifyDone):
289         * loader/SubresourceLoader.h:
290         * loader/TextTrackLoader.h:
291         * loader/appcache/ApplicationCacheHost.h:
292         * loader/appcache/ApplicationCacheStorage.cpp:
293         (WebCore::ApplicationCacheStorage::storeCopyOfCache):
294         * loader/archive/cf/LegacyWebArchive.cpp:
295         (WebCore::LegacyWebArchive::create):
296         * loader/cache/CachedResourceLoader.cpp:
297         (WebCore::CachedResourceLoader::requestPreload):
298         (WebCore::CachedResourceLoader::clearPreloads):
299         (WebCore::CachedResourceLoader::printPreloadStats):
300         * loader/cache/CachedResourceLoader.h:
301         * loader/icon/IconDatabase.cpp:
302         (WebCore::IconDatabase::deleteAllPreparedStatements):
303         (WebCore::readySQLiteStatement):
304         * loader/icon/IconDatabase.h:
305         * loader/icon/IconRecord.h:
306
307 2014-11-16  Chris Dumez  <cdumez@apple.com>
308
309         Crash when setting 'order' CSS property to a calculated value
310         https://bugs.webkit.org/show_bug.cgi?id=138780
311
312         Reviewed by Darin Adler.
313
314         CSS Calculated values were not handled by the CSS parser for 'order'
315         CSS property. As a result, using calculated values wouldn't work in
316         release builds and would hit an assertion in debug builds.
317
318         This patch updates the CSS parser to directly convert the
319         CSS Calculated value into a simple integer CSSPrimitiveValue for
320         'order' property. We could have marked CSS Calculated values as
321         valid in the CSS Parser instead but this would have brought issues:
322         - The calculated value needs to be adjusted to INT_MIN + 2 if it is less
323           than that. This would force us to calculate the expression anyway.
324         - The StyleBuilder would need updating to properly handle CSS Calculated
325           values for 'order'.
326
327         Test: fast/css/order-calculated-value.html
328
329         * css/CSSParser.cpp:
330         (WebCore::CSSParser::parseValue):
331
332 2014-11-16  Chris Dumez  <cdumez@apple.com>
333
334         Assertion hit when setting a very large value to 'border-width' / 'font-size' CSS properties
335         https://bugs.webkit.org/show_bug.cgi?id=138770
336
337         Reviewed by Darin Adler.
338
339         When setting a very large value to a CSS property, it is represented internally as
340         infinity. r166114 already tried to deal with this by adding an std::isinf() check
341         in CSSValuePool::createValue() and returning an identifier CSSPrimitiveValue with
342         CSSValueInvalid value in such case. The issue is that doing leads to the
343         StyleBuilder getting a CSSValueInvalid CSSPrimitive value as input, which is not
344         handled and leads to assertions.
345
346         This patch updates the CSSParser to detect cases where the double value is
347         infinity earlier (in CSSParser::validUnit() and parseSimpleLengthValue()), so
348         that we mark the value as invalid and actually drop it. As a result,
349         CSSPrimitiveValues with CSSValueInvalid value no longer make their way to the
350         StyleBuilder.
351
352         Test: fast/css/style-builder-infinite-value.html
353               fast/css/infinite-floating-value.html
354
355         * css/CSSParser.cpp:
356         (WebCore::parseSimpleLengthValue):
357         (WebCore::CSSParser::validUnit):
358         * css/CSSValuePool.cpp:
359         (WebCore::CSSValuePool::createValue):
360
361 2014-11-16  Shivakumar JM  <shiva.jm@samsung.com>
362
363         Attribute text in HTMLAnchorElement should behave as per specification.
364         https://bugs.webkit.org/show_bug.cgi?id=138557
365
366         Reviewed by Darin Adler.
367
368         attribute text in HTMLAnchorElement should not be readonly as per specification
369         http://www.w3.org/TR/html/text-level-semantics.html#dom-a-text. It should behave as textContent attribute. 
370         Also This matches the behavior of Chrome 38 and FireFox.
371
372         Test: fast/dom/HTMLAnchorElement/anchor-text-attribute.html
373
374         * html/HTMLAnchorElement.cpp:
375         (WebCore::HTMLAnchorElement::text):
376         (WebCore::HTMLAnchorElement::setText):
377         * html/HTMLAnchorElement.h:
378         * html/HTMLAnchorElement.idl:
379
380 2014-11-16  Chris Dumez  <cdumez@apple.com>
381
382         Move 'vertical-align' CSS property to the new StyleBuilder
383         https://bugs.webkit.org/show_bug.cgi?id=138764
384
385         Reviewed by Darin Adler.
386
387         Move 'vertical-align' CSS property from DeprecatedStyleBuilder to the
388         new StyleBuilder by using custom code.
389
390         No new tests, no behavior change.
391
392         * css/CSSPropertyNames.in:
393         * css/DeprecatedStyleBuilder.cpp:
394         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
395         (WebCore::ApplyPropertyVerticalAlign::applyValue): Deleted.
396         (WebCore::ApplyPropertyVerticalAlign::createHandler): Deleted.
397         * css/StyleBuilderCustom.h:
398         (WebCore::StyleBuilderFunctions::applyValueVerticalAlign):
399
400 2014-11-16  Tim Horton  <timothy_horton@apple.com>
401
402         Use TextIndicator instead of the built in Lookup highlight
403         https://bugs.webkit.org/show_bug.cgi?id=138775
404         <rdar://problem/18953982>
405
406         Follow-up to r176164.
407
408         * platform/spi/mac/LookupSPI.h:
409         (WebCore::canDisableLookupIndicator): Deleted.
410         Remove canDisableLookupIndicator.
411
412 2014-11-16  Chris Dumez  <cdumez@apple.com>
413
414         Crash when setting '-webkit-line-clamp' CSS property to a calculated value
415         https://bugs.webkit.org/show_bug.cgi?id=138777
416
417         Reviewed by Benjamin Poulain.
418
419         CSS Calculated values were not handled when converting a CSSPrimitiveValue
420         to a LineClampValue. As a result, we would hit an ASSERT_NOT_REACHED()
421         assertion. To address this issue, this patch updates the code to use
422         primitiveType() / getValue<>() instead of m_primitiveUnitType /
423         m_value.num, as those getter function properly handle CSS Calculated
424         values.
425
426         Test: fast/css/webkit-line-clamp-calculated-value.html
427
428         * css/CSSPrimitiveValueMappings.h:
429         (WebCore::CSSPrimitiveValue::operator LineClampValue):
430
431 2014-11-16  Tim Horton  <timothy_horton@apple.com>
432
433         Use TextIndicator instead of the built in Lookup highlight
434         https://bugs.webkit.org/show_bug.cgi?id=138775
435         <rdar://problem/18953982>
436
437         Reviewed by Anders Carlsson.
438
439         * WebCore.exp.in:
440         * platform/mac/WebCoreSystemInterface.h:
441         * platform/mac/WebCoreSystemInterface.mm:
442         Remove a WKSI import/export that we don't need anymore.
443         
444         * platform/spi/mac/LookupSPI.h: Added.
445         (WebCore::canDisableLookupIndicator):
446         Add Lookup SPI header.
447         Add a 'canDisableLookupIndicator', which must be called in any translation
448         unit that wants to use either of the soft-linked constants related to
449         that functionality, before calling the get* function.
450
451         * WebCore.xcodeproj/project.pbxproj:
452         * editing/mac/DictionaryLookup.mm:
453         (WebCore::rangeForDictionaryLookupForSelection):
454         (WebCore::rangeForDictionaryLookupAtHitTestResult):
455         Adopt the Lookup SPI header.
456
457 2014-11-16  Joanmarie Diggs  <jdiggs@igalia.com>
458
459         AX: [ATK] REGRESSION(r166288): Accessible values are no longer accessible via AT-SPI2
460         https://bugs.webkit.org/show_bug.cgi?id=138776
461
462         Reviewed by Chris Fleizach.
463
464         r166288 used #if...#else instead of #if...#endif, thus disabling the old
465         AtkValue support. Unfortunately AT-SPI2 doesn't yet have support for the
466         new AtkValue API. Thus r166288 broke access to value-holding elements for
467         AT-SPI2 assistive technologies. Replacing #else with #endif fixes things.
468
469         No new tests because catching this regression would require AT-SPI2.
470
471         * accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
472         (webkitAccessibleValueGetMinimumIncrement):
473         (webkitAccessibleValueInterfaceInit):
474
475 2014-11-16  Joanmarie Diggs  <jdiggs@igalia.com>
476
477         AX: [ATK] Expose the blockquote element using ATK_ROLE_BLOCK_QUOTE
478         https://bugs.webkit.org/show_bug.cgi?id=138771
479
480         Reviewed by Chris Fleizach.
481
482         Add BlockquoteRole and assigns it to blockquote elements. Make
483         corresponding changes to platform role mappings: ATK_ROLE_BLOCK_QUOTE
484         for GTK and EFL; AXGroup (which was being used already) for the Mac.
485
486         No new tests are required. Instead, updated the existing expectations
487         to reflect the new mapping.
488
489         * accessibility/AccessibilityNodeObject.cpp:
490         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
491         * accessibility/AccessibilityObject.cpp:
492         (WebCore::AccessibilityObject::isBlockquote):
493         * accessibility/AccessibilityObject.h:
494         * accessibility/AccessibilityRenderObject.cpp:
495         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
496         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
497         (atkRole):
498         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
499         (createAccessibilityRoleMap):
500
501 2014-11-16  Chris Dumez  <cdumez@apple.com>
502
503         Crash when setting 'alt' CSS property to inherit or initial
504         https://bugs.webkit.org/show_bug.cgi?id=138774
505         <rdar://problem/18995409>
506
507         Reviewed by Chris Fleizach.
508
509         The StyleResolver was not handling 'inherit' or 'initial' values for
510         'alt' CSS property. As a result, the code was assuming the CSSValue
511         was a CSSPrimitiveValue (although it could be a CSSInitialValue or
512         a CSSInheritValue). In such case, the code would dereference a null
513         pointer because primitiveValue is initialized using:
514         CSSPrimitiveValue* primitiveValue = is<CSSPrimitiveValue>(*value)
515             ? downcast<CSSPrimitiveValue>(value)
516             : nullptr;
517
518         Test: fast/css/alt-inherit-initial.html
519
520         * css/StyleResolver.cpp:
521         (WebCore::StyleResolver::applyProperty):
522
523 2014-11-15  Joanmarie Diggs  <jdiggs@igalia.com>
524
525         AX: [ATK] Lists with selectable children should have ATK_ROLE_LIST_BOX
526         https://bugs.webkit.org/show_bug.cgi?id=127060
527
528         Reviewed by Chris Fleizach.
529
530         Corrected the mapping from ATK_ROLE_LIST to ATK_ROLE_LIST_BOX.
531
532         No new tests. Instead, updated the expectations of roles-exposed.html to
533         reflect the corrected mapping.
534
535         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
536         (atkRole):
537
538 2014-11-15  Joanmarie Diggs  <jdiggs@igalia.com>
539
540         AX: [ATK] Video and audio elements should be exposed using ATK's video and audio roles.
541         https://bugs.webkit.org/show_bug.cgi?id=138767
542
543         Reviewed by Chris Fleizach.
544
545         Map AudioRole and VideoRole to ATK_ROLE_AUDIO and ATK_ROLE_VIDEO
546         respectively, falling back on the existing mapping to ATK_ROLE_EMBEDDED
547         in environments which have an older version of ATK.
548
549         No new tests are required. Instead, existing expectations were updated
550         to reflect the new mapping.
551
552         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
553         (atkRole):
554
555 2014-11-15  Joanmarie Diggs  <jdiggs@igalia.com>
556
557         AX: [ATK] Expose the footer element as ATK_ROLE_FOOTER
558         https://bugs.webkit.org/show_bug.cgi?id=138773
559
560         Reviewed by Chris Fleizach.
561
562         Map FooterRole to ATK_ROLE_FOOTER.
563
564         No new tests. Unskipped a test that verifies this mapping.
565
566         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
567         (atkRole):
568
569 2014-11-14  Dean Jackson  <dino@apple.com>
570
571         Rename WebKitCSSKeyframe(s)Rule into CSSKeyframe(s)Rule
572         https://bugs.webkit.org/show_bug.cgi?id=138763
573         <rdar://problem/18991569>
574
575         Reviewed by Simon Fraser.
576
577         Globally rename WebKitCSSKeyframeRule and WebKitCSSKeyframesRule to
578         CSSKeyframeRule and CSSKeyframesRule respectively.
579
580         This *may* break some existing content, but is compatible with
581         what Blink and Firefox are doing. To minimize breakage, I kept an
582         alias for the old constant values on CSSRule: WEBKIT_KEYFRAMES_RULE
583         and WEBKIT_KEYFRAME_RULE.
584
585         Covered by existing tests.
586
587         * CMakeLists.txt:
588         * DerivedSources.cpp:
589         * DerivedSources.make:
590         * WebCore.vcxproj/WebCore.vcxproj:
591         * WebCore.vcxproj/WebCore.vcxproj.filters:
592         * WebCore.xcodeproj/project.pbxproj:
593         * bindings/js/JSCSSRuleCustom.cpp:
594         (WebCore::toJS):
595         * bindings/objc/DOMCSS.mm:
596         (kitClass):
597         * css/CSSGrammar.y.includes:
598         * css/CSSKeyframeRule.cpp: Renamed from Source/WebCore/css/WebKitCSSKeyframeRule.cpp.
599         (WebCore::StyleKeyframe::StyleKeyframe):
600         (WebCore::StyleKeyframe::~StyleKeyframe):
601         (WebCore::StyleKeyframe::mutableProperties):
602         (WebCore::StyleKeyframe::parseKeyString):
603         (WebCore::StyleKeyframe::cssText):
604         (WebCore::CSSKeyframeRule::CSSKeyframeRule):
605         (WebCore::CSSKeyframeRule::~CSSKeyframeRule):
606         (WebCore::CSSKeyframeRule::style):
607         (WebCore::CSSKeyframeRule::reattach):
608         * css/CSSKeyframeRule.h: Renamed from Source/WebCore/css/WebKitCSSKeyframeRule.h.
609         (WebCore::StyleKeyframe::create):
610         (WebCore::StyleKeyframe::keyText):
611         (WebCore::StyleKeyframe::setKeyText):
612         (WebCore::StyleKeyframe::getKeys):
613         (WebCore::StyleKeyframe::properties):
614         * css/CSSKeyframeRule.idl: Renamed from Source/WebCore/css/WebKitCSSKeyframeRule.idl.
615         * css/CSSKeyframesRule.cpp: Renamed from Source/WebCore/css/WebKitCSSKeyframesRule.cpp.
616         (WebCore::StyleRuleKeyframes::StyleRuleKeyframes):
617         (WebCore::StyleRuleKeyframes::~StyleRuleKeyframes):
618         (WebCore::StyleRuleKeyframes::parserAppendKeyframe):
619         (WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
620         (WebCore::StyleRuleKeyframes::wrapperRemoveKeyframe):
621         (WebCore::StyleRuleKeyframes::findKeyframeIndex):
622         (WebCore::CSSKeyframesRule::CSSKeyframesRule):
623         (WebCore::CSSKeyframesRule::~CSSKeyframesRule):
624         (WebCore::CSSKeyframesRule::setName):
625         (WebCore::CSSKeyframesRule::appendRule):
626         (WebCore::CSSKeyframesRule::insertRule):
627         (WebCore::CSSKeyframesRule::deleteRule):
628         (WebCore::CSSKeyframesRule::findRule):
629         (WebCore::CSSKeyframesRule::cssText):
630         (WebCore::CSSKeyframesRule::length):
631         (WebCore::CSSKeyframesRule::item):
632         (WebCore::CSSKeyframesRule::cssRules):
633         (WebCore::CSSKeyframesRule::reattach):
634         * css/CSSKeyframesRule.h: Renamed from Source/WebCore/css/WebKitCSSKeyframesRule.h.
635         (WebCore::StyleRuleKeyframes::create):
636         (WebCore::StyleRuleKeyframes::keyframes):
637         (WebCore::StyleRuleKeyframes::name):
638         (WebCore::StyleRuleKeyframes::setName):
639         (WebCore::StyleRuleKeyframes::copy):
640         * css/CSSKeyframesRule.idl: Renamed from Source/WebCore/css/WebKitCSSKeyframesRule.idl.
641         * css/CSSParser.cpp:
642         * css/CSSRule.h:
643         * css/CSSRule.idl:
644         * css/CSSStyleSheet.cpp:
645         * css/RuleSet.cpp:
646         * css/StyleResolver.cpp:
647         * css/StyleRule.cpp:
648         (WebCore::StyleRuleBase::createCSSOMWrapper):
649         * inspector/InspectorStyleSheet.cpp:
650         (WebCore::asCSSRuleList):
651
652 2014-11-15  David Kilzer  <ddkilzer@apple.com>
653
654         REGRESSION (r176137): iOS build broke after moving DataDetectors scanning code to WebCore
655
656         This regressed with the following commit:
657
658             Move DataDetectors scanning code to WebCore
659             https://bugs.webkit.org/show_bug.cgi?id=138731
660             <rdar://problem/18877535>
661
662         This fixes the following build failures:
663
664             In file included from WebCore/editing/mac/DataDetection.mm:29:
665             WebCore/platform/spi/mac/DataDetectorsSPI.h:66:11: error: unknown type name 'NSRect'
666             @property NSRect highlightFrame;
667                       ^
668             WebCore/editing/mac/DataDetection.mm:42:28: error: use of undeclared identifier 'DataDetection'
669             RetainPtr<DDActionContext> DataDetection::detectItemAroundHitTestResult(const HitTestResult& hitTestResult, FloatRect& detectedDataBoundingBox, RefPtr<Range>& detectedDataRange)
670                                        ^
671             2 errors generated.
672
673         * WebCore.exp.in:
674         (DataDetection::detectItemAroundHitTestResult): Move symbol from
675         shared section to Mac-only section.
676         * editing/mac/DataDetection.mm: Add PLATFORM(MAC) check around
677         the entire implementation since it it unused on iOS.
678         * platform/spi/mac/DataDetectorsSPI.h: Expand PLATFORM(MAC)
679         check around DDActionContext class declarations.
680
681 2014-11-14  Benjamin Poulain  <benjamin@webkit.org>
682
683         Compute the selector specificity as we match simple selectors
684         https://bugs.webkit.org/show_bug.cgi?id=138718
685
686         Reviewed by Andreas Kling.
687
688         This is an other tiny step toward dynamic specificity. Instead of computing
689         the entire specificity at the end, compute it dynamically as we are matching
690         each individual simple selector.
691
692         * css/CSSSelector.cpp:
693         (WebCore::CSSSelector::specificity):
694         (WebCore::CSSSelector::simpleSelectorSpecificity):
695         (WebCore::CSSSelector::addSpecificities):
696         (WebCore::CSSSelector::specificityForPage):
697         (WebCore::CSSSelector::specificityForOneSelector): Deleted.
698         * css/CSSSelector.h:
699         * css/SelectorChecker.cpp:
700         (WebCore::SelectorChecker::match):
701         (WebCore::SelectorChecker::matchRecursively):
702         (WebCore::SelectorChecker::checkOne):
703         (WebCore::SelectorChecker::matchSelectorList):
704         * css/SelectorChecker.h:
705
706 2014-11-14  Andreas Kling  <akling@apple.com>
707
708         [mac] Only images that are actually purgeable should be advertised as such.
709         <https://webkit.org/b/138759>
710         <rdar://problem/13205438>
711
712         Reviewed by Tim Horton.
713
714         Instead of saying that all images on >=Yosemite are purgeable, have BitmapImage
715         forward the question to CGImage for the correct answer.
716
717         The memory may be marked non-volatile by frameworks underneath WebKit at any
718         given time, but that's not something we need to worry about.
719
720         * platform/graphics/BitmapImage.cpp:
721         (WebCore::BitmapImage::decodedDataIsPurgeable):
722         * platform/graphics/BitmapImage.h:
723         * platform/graphics/cg/BitmapImageCG.cpp:
724         (WebCore::BitmapImage::decodedDataIsPurgeable):
725         * platform/graphics/cg/ImageSourceCG.cpp:
726         (WebCore::ImageSource::createFrameAtIndex):
727         * platform/spi/cg/CoreGraphicsSPI.h:
728
729 2014-11-14  Zalan Bujtas  <zalan@apple.com>
730
731         Remove computeTextPaintStyle's RenderText dependency.
732         https://bugs.webkit.org/show_bug.cgi?id=138754
733
734         Reviewed by Simon Fraser.
735
736         So that we can compute text paint style across renderers in simple line layout.
737
738         No change in functionality.
739
740         * rendering/InlineTextBox.cpp:
741         (WebCore::InlineTextBox::paint):
742         * rendering/SimpleLineLayoutFunctions.cpp:
743         (WebCore::SimpleLineLayout::paintFlow):
744         * rendering/TextPaintStyle.cpp:
745         (WebCore::computeTextPaintStyle):
746         * rendering/TextPaintStyle.h:
747
748 2014-11-14  Myles C. Maxfield  <mmaxfield@apple.com>
749
750         Get rid of WebFontCache
751         https://bugs.webkit.org/show_bug.cgi?id=134752
752
753         Reviewed by Dave Hyatt.
754
755         No new tests because there is no behavior change.
756
757         * Configurations/WebCore.xcconfig:
758         * PlatformMac.cmake:
759         * WebCore.exp.in:
760         * WebCore.order:
761         * WebCore.xcodeproj/project.pbxproj:
762         * platform/graphics/mac/FontCacheMac.mm:
763         (WebCore::acceptableChoice):
764         (WebCore::betterChoice):
765         (WebCore::toTraitsMask):
766         (WebCore::desiredFamilyToAvailableFamilyDictionary):
767         (WebCore::rememberDesiredFamilyToAvailableFamilyMapping):
768         (WebCore::fontWithFamily):
769         (WebCore::invalidateFontCache):
770         (WebCore::FontCache::getTraitsInFamily):
771         (WebCore::FontCache::createFontPlatformData):
772         * platform/mac/WebFontCache.h: Removed.
773         * platform/mac/WebFontCache.mm: Removed.
774
775 2014-11-14  Daniel Bates  <dabates@apple.com>
776
777         [iOS] NSFileManager and QuickLook SPI not available in public SDK
778         https://bugs.webkit.org/show_bug.cgi?id=138742
779
780         Reviewed by Pratik Solanki.
781
782         Add a SPI wrapper headers {NSFileManager, QuickLook}SPI.h that forward declares
783         NSFileManager and QuickLook SPI, respectively, and use these header instead of
784         including private headers of Foundation and QuickLook directly.
785
786         * WebCore.xcodeproj/project.pbxproj: Add project and private header QuickLookSPI.h
787         and NSFileManagerSPI.h, respectively.
788         * platform/network/ios/QuickLook.mm: Include headers QuickLookSPI.h and NSFileManagerSPI.h
789         instead of including headers of QuickLook and Foundation directly. 
790         * platform/spi/cocoa/NSFileManagerSPI.h: Added.
791         * platform/spi/ios/QuickLookSPI.h: Added.
792
793 2014-11-14  Daniel Bates  <dabates@apple.com>
794
795         [iOS] CoreGraphics SPI not available in public SDK
796         https://bugs.webkit.org/show_bug.cgi?id=138709
797
798         Reviewed by David Kilzer.
799
800         Add a SPI wrapper header called CoreGraphicsSPI.h that forward declares
801         CoreGraphics SPI and use this header instead of including private headers
802         of CoreGraphics directly.
803
804         * WebCore.xcodeproj/project.pbxproj: Add WebCore private header CoreGraphicsSPI.h. Also remove header
805         CGFontUnicodeSupportSPI.h as its functionality has been incorporated into header CoreGraphicsSPI.h.
806         * WebCore.vcxproj/WebCore.vcxproj: Add WebCore private header CoreGraphicsSPI.h.
807         * WebCore.vcxproj/WebCore.vcxproj.filters: Add directories platform/spi and platform/spi/cg.
808         * WebCore.vcxproj/WebCoreCG.props: Add include directory platform/spi/cg.
809         * WebCore.vcxproj/copyForwardingHeaders.cmd: Copy WebCore headers from directory platform/spi/cg. This
810         is necessary because WebCore/platform/graphics/SimpleFontData.h includes CoreGraphicsSPI.h. And
811         WebCore/platform/graphics/SimpleFontData.h is compiled for the Apple Windows port.
812         * platform/graphics/SimpleFontData.h: Move CGFontRenderingStyle declaration and associated enum
813         from this file to file CoreGraphicsSPI.h and include header CoreGraphicsSPI.h. 
814         * platform/graphics/cg/BitmapImageCG.cpp: Remove unnecessary #include of header CGContextPrivate.h.
815         * platform/graphics/cg/ColorCG.cpp: Include header CoreGraphicsSPI.h instead of including headers
816         of CoreGraphics directly.
817         * platform/graphics/cg/GraphicsContextCG.cpp: Move forward declarations of CoreGraphics functions
818         from this file to file CoreGraphicsSPI.h and include header CoreGraphicsSPI.h. Also sort the list
819         of #include directives.
820         * platform/graphics/cg/ImageSourceCG.cpp: Include header CoreGraphicsSPI.h instead of including
821         headers of CoreGraphics directly.
822         * platform/graphics/cg/PDFDocumentImage.cpp: Ditto.
823         * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Ditto.
824         * platform/graphics/ios/FontCacheIOS.mm: Include header CoreGraphicsSPI.h instead of including
825         header <CoreGraphics/CGFontUnicodeSupport.h> directly.
826         * platform/graphics/ios/FontServicesIOS.mm: Include header CoreGraphicsSPI.h instead of including
827         headers of CoreGraphics directly.
828         * platform/graphics/ios/SimpleFontDataIOS.mm: Ditto.
829         * platform/graphics/mac/FontMac.mm: Move forward declarations of CoreGraphics functions from this
830         file to file CoreGraphicsSPI.h and include header CoreGraphicsSPI.h.
831         * platform/graphics/mac/GlyphPageTreeNodeMac.cpp: Substitute header CoreGraphicsSPI.h for CGFontUnicodeSupportSPI.h
832         and remove #include of headers CGFontUnicodeSupport.h (it will be included by CoreGraphicsSPI.h).
833         * platform/graphics/mac/SimpleFontDataMac.mm: Move forward declarations of CoreGraphics functions
834         from this file to file CoreGraphicsSPI.h and include header CoreGraphicsSPI.h.
835         * platform/ios/LegacyTileGrid.mm: Include header CoreGraphicsSPI.h instead of including headers of
836         CoreGraphics directly.
837         * platform/ios/wak/WKGraphics.h: Remove #include of header CoreGraphicsPrivate.h and forward declare
838         CGFontAntialiasingStyle Additionally, declare WKCompositeOperation as an alias of int and use this
839         data type instead of CGCompositeOperation (SPI). This approach lets us keep the definition of
840         CGCompositeOperation in file CoreGraphicsSPI.h, where all the other definitions/forward declarations
841         of CoreGraphics data types reside, as opposed to defining it in this file.
842         * platform/ios/wak/WKGraphics.mm:
843         (WKRectFillUsingOperation): Cast data type WKCompositeOperation to CGCompositeOperation and added
844         compile-time assert to ensure that the size of WKCompositeOperation is identical to the size of CGCompositeOperation.
845         * platform/graphics/cg/ImageSourceCG.cpp: Move CGImageCachingFlags declaration, associated enum, and
846         forward declaration of CGImageSetCachingFlags() from this file to file CoreGraphicsSPI.h and include
847         header CoreGraphicsSPI.h.
848         (WebCore::ImageSource::createFrameAtIndex): Fix incorrect comment.
849         * platform/spi/cocoa/CGFontUnicodeSupportSPI.h: Removed; moved its functionality into header CoreGraphicsSPI.h.
850         * platform/spi/cg/CoreGraphicsSPI.h: Added.
851         (CGFloatMin):
852         * rendering/RenderThemeIOS.mm: Substitute header CoreGraphics.h for CGPathPrivate.h as we no longer
853         make use of any functionality from CGPathPrivate.h in this file. The functionality we used from
854         CGPathPrivate.h, including CGPathAddRoundedRect(), has been moved to the public API header, CGPath.h,
855         which is included from header CoreGraphics.h.
856
857 2014-11-14  Dean Jackson  <dino@apple.com>
858
859         [Media] Timeline scrubber not updating as the video plays
860         https://bugs.webkit.org/show_bug.cgi?id=138717
861         <rdar://problem/18957509>
862
863         Reviewed by Jer Noble.
864
865         There is some confusing logic that determines
866         whether or not the controls are hidden, and a
867         slight error caused timelines to not advance unless
868         they were explicitly showing.
869
870         The fix was to be a bit more liberal in deciding
871         when the controls are showing, but still cautious
872         enough to stop up causing repaints when things
873         are hidden.
874
875         Test: media/media-controls-timeline-updates.html
876
877         * Modules/mediacontrols/mediaControlsApple.js:
878         (Controller.prototype.controlsAreHidden): We only need
879         to check if we're an audio element or explicitly
880         hidden.
881         (Controller.prototype.showControls): Explicitly call
882         updateTime.
883
884 2014-11-14  Tim Horton  <timothy_horton@apple.com>
885
886         Move DataDetectors scanning code to WebCore
887         https://bugs.webkit.org/show_bug.cgi?id=138731
888         <rdar://problem/18877535>
889
890         Reviewed by Anders Carlsson.
891
892         * WebCore.exp.in:
893         Export our new function.
894
895         * WebCore.xcodeproj/project.pbxproj:
896         Add DataDetection.{mm, h}
897         Adjust the project so that editing/mac actually points to editing/mac instead of editing/
898
899         * editing/mac/DictionaryLookup.h:
900         * editing/mac/DictionaryLookup.mm:
901         Swap to PLATFORM(MAC) instead of !PLATFORM(IOS).
902         Move DictionaryLookup.{mm, h} to editing/mac, where they were in the project but not on disk.
903
904         * editing/mac/DataDetection.h: Added.
905         * editing/mac/DataDetection.mm: Added.
906         (WebCore::DataDetection::detectItemAroundHitTestResult):
907         Moved from WebKit2.
908
909 2014-11-14  Dan Bernstein  <mitz@apple.com>
910
911         <rdar://problem/18978497> Wrong (off-by-1) navigation snapshots shown after a mix of gesture and button back/forward navigation
912         https://bugs.webkit.org/show_bug.cgi?id=138753
913
914         Reviewed by Tim Horton.
915
916         Removed a FrameLoaderClient function that no one overrides anymore.
917
918         * loader/FrameLoaderClient.h:
919         (WebCore::FrameLoaderClient::willChangeCurrentHistoryItem): Deleted.
920         * loader/HistoryController.cpp:
921         (WebCore::HistoryController::setCurrentItem): Removed call to willChangeCurrentHistoryItem.
922         (WebCore::HistoryController::replaceCurrentItem): Ditto.
923
924 2014-11-14  Jeremy Jones  <jeremyj@apple.com>
925
926         Do proper teardown for optimized fullscreen
927         https://bugs.webkit.org/show_bug.cgi?id=138648
928
929         Reviewed by Eric Carlson.
930
931         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
932         (WebVideoFullscreenInterfaceAVKit::invalidate): must do corresponding teardown based on mode.
933
934 2014-11-11  David Hyatt  <hyatt@apple.com>
935
936         Table rows repaint entire table when their background color changes.
937         https://bugs.webkit.org/show_bug.cgi?id=26662
938
939         Reviewed by Simon Fraser.
940
941         Added fast/repaint/table-row-repaint.html
942
943         * rendering/RenderTableCell.h:
944         * rendering/RenderTableRow.cpp:
945         (WebCore::RenderTableRow::clippedOverflowRectForRepaint):
946         Improve table row's function to unite with the cell rects that can possibly
947         have the the row's background color painted behind them.
948
949 2014-11-14  Zalan Bujtas  <zalan@apple.com>
950
951         Simple line layout: Move simple line layout RunResolver and LineResolver implementation to SimpleLineLayoutResolver.cpp
952         https://bugs.webkit.org/show_bug.cgi?id=138704
953
954         Reviewed by Antti Koivisto.
955
956         No change in functionality.
957
958         * CMakeLists.txt:
959         * WebCore.vcxproj/WebCore.vcxproj:
960         * WebCore.vcxproj/WebCore.vcxproj.filters:
961         * WebCore.xcodeproj/project.pbxproj:
962         * rendering/SimpleLineLayoutResolver.cpp: Added.
963         (WebCore::SimpleLineLayout::RunResolver::Run::Run):
964         (WebCore::SimpleLineLayout::RunResolver::Run::rect):
965         (WebCore::SimpleLineLayout::RunResolver::Run::baseline):
966         (WebCore::SimpleLineLayout::RunResolver::Run::text):
967         (WebCore::SimpleLineLayout::RunResolver::Iterator::Iterator):
968         (WebCore::SimpleLineLayout::RunResolver::Iterator::advance):
969         (WebCore::SimpleLineLayout::RunResolver::Iterator::advanceLines):
970         (WebCore::SimpleLineLayout::RunResolver::RunResolver):
971         (WebCore::SimpleLineLayout::RunResolver::lineIndexForHeight):
972         (WebCore::SimpleLineLayout::RunResolver::rangeForRect):
973         (WebCore::SimpleLineLayout::LineResolver::Iterator::Iterator):
974         (WebCore::SimpleLineLayout::LineResolver::Iterator::operator*):
975         (WebCore::SimpleLineLayout::LineResolver::LineResolver):
976         * rendering/SimpleLineLayoutResolver.h:
977         (WebCore::SimpleLineLayout::RunResolver::Run::Run): Deleted.
978         (WebCore::SimpleLineLayout::RunResolver::Run::rect): Deleted.
979         (WebCore::SimpleLineLayout::RunResolver::Run::baseline): Deleted.
980         (WebCore::SimpleLineLayout::RunResolver::Run::text): Deleted.
981         (WebCore::SimpleLineLayout::RunResolver::Iterator::Iterator): Deleted.
982         (WebCore::SimpleLineLayout::RunResolver::Iterator::advance): Deleted.
983         (WebCore::SimpleLineLayout::RunResolver::Iterator::advanceLines): Deleted.
984         (WebCore::SimpleLineLayout::RunResolver::RunResolver): Deleted.
985         (WebCore::SimpleLineLayout::RunResolver::lineIndexForHeight): Deleted.
986         (WebCore::SimpleLineLayout::RunResolver::rangeForRect): Deleted.
987         (WebCore::SimpleLineLayout::LineResolver::Iterator::Iterator): Deleted.
988         (WebCore::SimpleLineLayout::LineResolver::Iterator::operator*): Deleted.
989         (WebCore::SimpleLineLayout::LineResolver::LineResolver): Deleted.
990
991 2014-11-14  Andrzej Badowski  <a.badowski@samsung.com>
992
993         AX: Improve AccessibilityTableCell isColumnHeaderCell function.
994         https://bugs.webkit.org/show_bug.cgi?id=138423
995
996         Reviewed by Chris Fleizach.
997
998         <th> cell in the zero row should be column header.
999
1000         New tests are not necessary.
1001
1002         * accessibility/AccessibilityTableCell.cpp:
1003         (WebCore::AccessibilityTableCell::isColumnHeaderCell):
1004
1005 2014-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1006
1007         [SOUP] Use GMainLoopSource for request timeout in ResourceHandle
1008         https://bugs.webkit.org/show_bug.cgi?id=138695
1009
1010         Reviewed by Sergio Villar Senin.
1011
1012         We are currently using soup_timeout_add() that simply creates a
1013         GSource and attaches it to the given context. Using
1014         GMainLoopSource we simplify the code and fix any potential problem
1015         of converting the double value into milliseconds.
1016
1017         * platform/network/ResourceHandleInternal.h:
1018         * platform/network/soup/ResourceHandleSoup.cpp:
1019         (WebCore::cleanupSoupRequestOperation):
1020         (WebCore::ResourceHandle::sendPendingRequest):
1021         (WebCore::ResourceHandle::platformSetDefersLoading):
1022         (WebCore::requestTimeoutCallback): Deleted.
1023
1024 2014-11-13  Tim Horton  <timothy_horton@apple.com>
1025
1026         [mac] Keep around more decoded image data, since it's purgeable
1027         https://bugs.webkit.org/show_bug.cgi?id=125273
1028         <rdar://problem/13205438>
1029
1030         Reviewed by Simon Fraser.
1031
1032         No new tests, just an optimization.
1033
1034         Instead of throwing away decoded image data eagerly, allow the operating
1035         system to manage the memory via the standard purgeability mechanism,
1036         where it can.
1037
1038         This improves the performance on some pathological cases (extremely large
1039         animated GIFs) by up to 8x.
1040
1041         * loader/cache/MemoryCache.cpp:
1042         (WebCore::MemoryCache::pruneLiveResourcesToSize):
1043         Don't prune live resources' decoded data if it is purgeable.
1044
1045         * platform/graphics/BitmapImage.cpp:
1046         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
1047         Don't eagerly throw away decoded image data if it's purgeable.
1048
1049         * loader/cache/CachedImage.h:
1050         * loader/cache/CachedResource.h:
1051         (WebCore::CachedResource::decodedDataIsPurgeable):
1052         * platform/graphics/BitmapImage.h:
1053         * platform/graphics/Image.h:
1054         (WebCore::Image::decodedDataIsPurgeable):
1055
1056 2014-11-13  Myles C. Maxfield  <litherum@gmail.com>
1057
1058         Addressing post-review comment
1059         https://bugs.webkit.org/show_bug.cgi?id=138633
1060
1061         * platform/spi/cg/CoreGraphicsSPI.h:
1062
1063 2014-11-13  Myles C. Maxfield  <mmaxfield@apple.com>
1064
1065         Move FontMac and FontCacheMac off of WKSI
1066         https://bugs.webkit.org/show_bug.cgi?id=138633
1067
1068         Reviewed by Simon Fraser.
1069
1070         No new tests because there is no behavior change.
1071
1072         * WebCore.exp.in:
1073         * WebCore.order:
1074         * WebCore.vcxproj/WebCoreCG.props:
1075         * WebCore.xcodeproj/project.pbxproj:
1076         * platform/graphics/ios/FontCacheIOS.mm:
1077         (WebCore::FontCache::platformInit):
1078         * platform/graphics/mac/FontCacheMac.mm:
1079         (WebCore::FontCache::platformInit):
1080         (WebCore::FontCache::systemFallbackForCharacters):
1081         * platform/graphics/mac/FontMac.mm:
1082         (WebCore::isIntegral):
1083         (WebCore::setCGFontRenderingMode):
1084         (WebCore::Font::drawGlyphs):
1085         * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
1086         * platform/graphics/win/FontCacheWin.cpp:
1087         (WebCore::FontCache::platformInit):
1088         * platform/ios/WebCoreSystemInterfaceIOS.mm:
1089         * platform/mac/WebCoreSystemInterface.h:
1090         * platform/mac/WebCoreSystemInterface.mm:
1091         * platform/spi/cocoa/CoreGraphicsSPI.h: Copied from Source/WebCore/platform/spi/cocoa/CGFontUnicodeSupportSPI.h.
1092         * platform/spi/cocoa/CoreTextSPI.h:
1093         * platform/spi/mac/NSFontSPI.h: Renamed from Source/WebCore/platform/spi/cocoa/CGFontUnicodeSupportSPI.h.
1094
1095 2014-11-13  Chris Dumez  <cdumez@apple.com>
1096
1097         Move 'image-resolution' CSS property to the new StyleBuilder
1098         https://bugs.webkit.org/show_bug.cgi?id=138715
1099
1100         Reviewed by Andreas Kling.
1101
1102         Move 'image-resolution' CSS property from DeprecatedStyleBuilder to
1103         the new StyleBuilder by using custom code.
1104
1105         No new tests, no behavior change.
1106
1107         * css/CSSPropertyNames.in:
1108         * css/DeprecatedStyleBuilder.cpp:
1109         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
1110         (WebCore::ApplyPropertyImageResolution::applyInheritValue): Deleted.
1111         (WebCore::ApplyPropertyImageResolution::applyInitialValue): Deleted.
1112         (WebCore::ApplyPropertyImageResolution::applyValue): Deleted.
1113         (WebCore::ApplyPropertyImageResolution::createHandler): Deleted.
1114         * css/StyleBuilderCustom.h:
1115         (WebCore::StyleBuilderFunctions::applyInheritImageResolution):
1116         (WebCore::StyleBuilderFunctions::applyInitialImageResolution):
1117         (WebCore::StyleBuilderFunctions::applyValueImageResolution):
1118
1119 2014-11-13  Commit Queue  <commit-queue@webkit.org>
1120
1121         Unreviewed, rolling out r176106.
1122         https://bugs.webkit.org/show_bug.cgi?id=138719
1123
1124         needs build love (Requested by kling on #webkit).
1125
1126         Reverted changeset:
1127
1128         "[mac] Keep around more decoded image data, since it's
1129         purgeable"
1130         https://bugs.webkit.org/show_bug.cgi?id=125273
1131         http://trac.webkit.org/changeset/176106
1132
1133 2014-11-13  Eric Carlson  <eric.carlson@apple.com>
1134
1135         Context menus should not offer the "Download video" option for videos that cannot 
1136         be downloaded
1137         https://bugs.webkit.org/show_bug.cgi?id=138530
1138         -and corresponding-
1139         rdar://problem/18919130
1140
1141         Reviewed by Tim Horton.
1142
1143         * html/HTMLMediaElement.cpp:
1144         (WebCore::HTMLMediaElement::parseAttribute):
1145         * html/HTMLMediaElement.h:
1146         * page/ContextMenuController.cpp:
1147         (WebCore::ContextMenuController::populate):
1148         * platform/graphics/MediaPlayer.cpp:
1149         (WebCore::MediaPlayer::canSaveMediaData):
1150         (WebCore::MediaPlayer::supportsSave): Deleted.
1151         * platform/graphics/MediaPlayer.h:
1152         * platform/graphics/MediaPlayerPrivate.h:
1153         (WebCore::MediaPlayerPrivateInterface::supportsFullscreen):
1154         (WebCore::MediaPlayerPrivateInterface::canSaveMediaData):
1155         (WebCore::MediaPlayerPrivateInterface::supportsSave): Deleted.
1156         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1157         (WebCore::MediaPlayerPrivateAVFoundation::resolvedURL):
1158         (WebCore::MediaPlayerPrivateAVFoundation::canSaveMediaData):
1159         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1160         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1161         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1162         (WebCore::MediaPlayerPrivateAVFoundationObjC::resolvedURL):
1163         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1164         (WebCore::MediaPlayerPrivateGStreamer::canSaveMediaData):
1165         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1166         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
1167         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1168         (WebCore::MediaPlayerPrivateQTKit::canSaveMediaData):
1169         * rendering/HitTestResult.cpp:
1170         (WebCore::HitTestResult::isDownloadableMedia):
1171
1172 2014-11-02  Tim Horton  <timothy_horton@apple.com>
1173
1174         [mac] Keep around more decoded image data, since it's purgeable
1175         <https://webkit.org/b/125273>
1176         <rdar://problem/13205438>
1177
1178         Reviewed by Simon Fraser and Andreas Kling.
1179
1180         No new tests, just an optimization.
1181
1182         Instead of throwing away decoded image data eagerly, allow the operating
1183         system to manage the memory via the standard purgeability mechanism,
1184         where it can.
1185
1186         This improves the performance on some pathological cases (extremely large
1187         animated GIFs) by up to 8x.
1188
1189         * loader/cache/MemoryCache.cpp:
1190         (WebCore::MemoryCache::pruneLiveResourcesToSize):
1191         Don't prune live resources' decoded data if it is purgeable.
1192
1193         * platform/graphics/BitmapImage.cpp:
1194         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
1195         Don't eagerly throw away decoded image data if it's purgeable.
1196
1197         * loader/cache/CachedImage.h:
1198         * loader/cache/CachedResource.h:
1199         (WebCore::CachedResource::decodedDataIsPurgeable):
1200         * platform/graphics/BitmapImage.h:
1201         * platform/graphics/Image.h:
1202         (WebCore::Image::decodedDataIsPurgeable):
1203
1204 2014-11-13  Daniel Bates  <dabates@apple.com>
1205
1206         [iOS] NSGeometry data types are not available in the public SDK
1207         https://bugs.webkit.org/show_bug.cgi?id=137536
1208
1209         Reviewed by David Kilzer.
1210
1211         Towards building iOS WebKit with the public iOS SDK, define NSGeometry
1212         data types and functions in terms of CGGeometry data types and functions
1213         because the former is SPI on iOS.
1214
1215         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Include
1216         header WAKAppKitStubs.h when building for iOS. Otherwise, include header NSGeometry.h.
1217         * platform/graphics/ca/mac/PlatformCALayerMac.mm: Remove import of private header NSGeometry.h.
1218         We will use the NSGeometry data types defined in WAKAppKitStubs.h, which is implicitly imported
1219         by header WAKWindow.h.
1220         * platform/graphics/mac/MediaPlayerProxy.h: Substitute WAKAppKitStubs.h for NSGeometry.h.
1221         * platform/ios/PlatformEventFactoryIOS.mm: Ditto. Also fix up style issues with #import directives.
1222         * platform/ios/WebEvent.mm: Ditto.
1223         * platform/ios/wak/WAKAppKitStubs.h: Define typedefs and macros that map NSGeometry data types
1224         and functions to the analogous CGGeometry data types and functions. Also, remove #ifdef __OBJC__-
1225         guard as the existing content in WAKAppKitStubs.h assumes that this file will only be included
1226         in an Objective-C/Objective-C++ file.
1227         * platform/ios/wak/WAKView.h: Import header WAKAppKitStubs.h instead of defining macros for some
1228         NSGeometry data types.
1229
1230 2014-11-13  Simon Fraser  <simon.fraser@apple.com>
1231
1232         [WK2] Fire a layout milestone on session restore based on render tree size
1233         https://bugs.webkit.org/show_bug.cgi?id=138711
1234         rdar://problem/16033854
1235
1236         Reviewed by Anders Carlsson.
1237
1238         New layout milestone for session restore based on render tree size. Only used
1239         in WK2 at present.
1240
1241         * page/LayoutMilestones.h:
1242
1243 2014-11-13  Dan Bernstein  <mitz@apple.com>
1244
1245         Policy client not called for navigations through the page cache
1246         https://bugs.webkit.org/show_bug.cgi?id=138703
1247
1248         Reviewed by Alexey Proskuryakov.
1249
1250         Test added to TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm.
1251
1252         * loader/FrameLoader.cpp:
1253         (WebCore::FrameLoader::loadDifferentDocumentItem): When using a cached page, which already
1254         has a document loader, set the document loader’s triggering action (so that the policy
1255         client sees that this is a back/forward navigation) and clear its last checked request (so
1256         that the policy client gets called).
1257
1258 2014-11-13  Joanmarie Diggs  <jdiggs@igalia.com>
1259
1260         AX: [ATK] Do not return ATK_ROLE_UNKNOWN for null or otherwise invalid accessible objects
1261         https://bugs.webkit.org/show_bug.cgi?id=137867
1262
1263         Reviewed by Chris Fleizach.
1264
1265         Return ATK_ROLE_INVALID for null or otherwise invalid accessible objects.
1266
1267         Test: platform/gtk/accessibility/detached-object-role.html
1268
1269         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1270         (webkitAccessibleGetRole):
1271
1272 2014-11-13  Eric Carlson  <eric.carlson@apple.com>
1273
1274         [iOS] update optimized fullscreen media controls artwork
1275         https://bugs.webkit.org/show_bug.cgi?id=138705
1276
1277         Reviewed by Dean Jackson.
1278
1279         * Modules/mediacontrols/MediaControlsHost.cpp:
1280         (WebCore::MediaControlsHost::mediaUIImageData): Remove one button.
1281         * Modules/mediacontrols/MediaControlsHost.idl:
1282
1283         * Modules/mediacontrols/mediaControlsApple.js:
1284         (Controller.prototype.controlsAreHidden): Add parentheses to fix the logic.
1285
1286         * Modules/mediacontrols/mediaControlsiOS.js:
1287         (ControllerIOS.prototype.shouldHaveStartPlaybackButton): The big play button should not be
1288             visible during playback.
1289         (ControllerIOS.prototype.createControls): No longer necessary to insert style dynamically,
1290         (ControllerIOS.prototype.setPlaying): Call the base class first so "isPlaying" is set before
1291             calling updateControls, which calls shouldHaveStartPlaybackButton.
1292
1293         * platform/ios/WebCoreSystemInterfaceIOS.h: Update constants.
1294
1295         * rendering/RenderThemeIOS.mm:
1296         (WebCore::RenderThemeIOS::mediaControlsStyleSheet): Add button style to the media controls sheet.
1297
1298 2014-11-13  Benjamin Poulain  <bpoulain@apple.com>
1299
1300         Implement the matching for :nth-last-child(An+B of selector-list)
1301         https://bugs.webkit.org/show_bug.cgi?id=138650
1302
1303         Reviewed by Andreas Kling.
1304
1305         Matching is trivial based on the existing CSS4 infrastructure.
1306
1307         The tricky part is style invalidation. In the cases of the old :nth-last-child()
1308         and :nth-last-of-type(), we were using the flag ChildrenAffectedByBackwardPositionalRules.
1309
1310         The problem with ChildrenAffectedByBackwardPositionalRules is that it only invalidate
1311         subtrees when nodes are being added or removed. It is a valuable optimization by itself
1312         since tree updates are less common than property updates.
1313
1314         For the case of property updates, I have added the new flag "ChildrenAffectedByPropertyBasedBackwardPositionalRules".
1315         It pretty much work the same way but invalidates subtree on style recalc.
1316
1317         Tests: fast/css/nth-child-and-nth-last-child.html
1318                fast/css/nth-last-child-of-classname.html
1319                fast/css/nth-last-child-of-complex-selector.html
1320                fast/css/nth-last-child-of-compound-selector.html
1321                fast/css/nth-last-child-of-style-sharing-1.html
1322                fast/css/nth-last-child-of-style-sharing-2.html
1323                fast/css/nth-last-child-of-style-update-optimization.html
1324                fast/css/nth-last-child-of-tagname.html
1325                fast/selectors/nth-last-child-of-class-style-update.html
1326
1327         * css/SelectorChecker.cpp:
1328         (WebCore::SelectorChecker::checkOne):
1329         * dom/Element.cpp:
1330         (WebCore::Element::setChildrenAffectedByPropertyBasedBackwardPositionalRules):
1331         (WebCore::Element::hasFlagsSetDuringStylingOfChildren):
1332         (WebCore::Element::rareDataChildrenAffectedByPropertyBasedBackwardPositionalRules):
1333         * dom/Element.h:
1334         (WebCore::Element::childrenAffectedByPropertyBasedBackwardPositionalRules):
1335         * dom/ElementRareData.h:
1336         (WebCore::ElementRareData::childrenAffectedByPropertyBasedBackwardPositionalRules):
1337         (WebCore::ElementRareData::setChildrenAffectedByPropertyBasedBackwardPositionalRules):
1338         (WebCore::ElementRareData::ElementRareData):
1339         (WebCore::ElementRareData::resetDynamicRestyleObservations):
1340         * dom/Node.cpp:
1341         (WebCore::Node::updateAncestorsForStyleRecalc):
1342         (WebCore::Node::setNeedsStyleRecalc):
1343         (WebCore::markAncestorsWithChildNeedsStyleRecalc): Deleted.
1344         * dom/Node.h:
1345         Unlike the other marking steps, ChildrenAffectedByPropertyBasedBackwardPositionalRules can only really
1346         affect one level (because we don't have a parent-selectors). It is quite easy to mark large
1347         trees with ChildrenAffectedByPropertyBasedBackwardPositionalRules by using a selector list that is a bit
1348         too generic. When that happen, we must be careful not invalidating everything, just the affected subtree.
1349
1350 2014-11-12  Jon Honeycutt  <jhoneycutt@apple.com>
1351
1352         REGRESSION (r172826): Password field placeholder text is missing if
1353         placeholder attribute precedes type attribute
1354
1355         <https://bugs.webkit.org/show_bug.cgi?id=138682>
1356         <rdar://problem/18574213> 
1357
1358         When the placeholder attribute is encountered, a shadow tree is created
1359         to include the placeholder element. When the type attribute is
1360         encountered, the previous shadow tree is destroyed, and a new shadow
1361         tree is created. TextFieldInputType::createShadowSubtree() did not
1362         handle creating the placeholder element. 
1363
1364         This regressed in r172826 because prior to r172826, the placeholder
1365         element would be recreated when
1366         HTMLTextFormControlElement::updatePlaceholderVisibility() was called.
1367         In r172826, updatePlaceholderVisibility() was changed to only show or
1368         hide the placeholder element if it exists.
1369
1370         Reviewed by Benjamin Poulain.
1371
1372         * html/TextFieldInputType.cpp:
1373         (WebCore::TextFieldInputType::createShadowSubtree):
1374         Call updatePlaceholderVisibility() to insert the placeholder element
1375         (after the inner text element has been inserted, as it appears before
1376         it in the shadow DOM).
1377
1378 2014-11-13  Joanmarie Diggs  <jdiggs@igalia.com>
1379
1380         AX: [ATK] Accessible focus events are emitted when the selection is changed in non-focused combo boxes
1381         https://bugs.webkit.org/show_bug.cgi?id=137866
1382
1383         Reviewed by Mario Sanchez Prada.
1384
1385         Check that the AccessibilityMenuList is really focused before notifying
1386         the platform that it is focused. Likewise, only notify the platform of
1387         an AccessibilityMenuListOption focus gain if the AccessibilityMenuList
1388         containing that option is expanded.
1389
1390         Test: platform/gtk/accessibility/menu-list-unfocused-notifications.html
1391
1392         * accessibility/atk/AXObjectCacheAtk.cpp:
1393         (WebCore::notifyChildrenSelectionChange):
1394         (WebCore::AXObjectCache::postPlatformNotification):
1395
1396 2014-11-13  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1397
1398         [EFL] Unexpected crashes in layout test after r175953
1399         https://bugs.webkit.org/show_bug.cgi?id=138652
1400
1401         Reviewed by Csaba Osztrogonác.
1402
1403         In r175953, it set reusableNodeIndex value with m_partCache's size(). It causes
1404         out of bound index crash because the reusableNodeIndex is Vector object.
1405
1406         No new test. This patch is to fix broken tests related to widgets on EFL port.
1407
1408         * platform/efl/RenderThemeEfl.cpp:
1409         (WebCore::RenderThemeEfl::getThemePartFromCache): Need to set reusableNodeIndex with "size() - 1".
1410
1411 2014-11-13  Chris Dumez  <cdumez@apple.com>
1412
1413         Lazily create HTMLInputElement's inputType and shadow subtree
1414         https://bugs.webkit.org/show_bug.cgi?id=138524
1415
1416         Reviewed by Ryosuke Niwa.
1417
1418         When an HTMLInputElement was created by the parser, we would first call
1419         HTMLInputElement::create(), then call Element::parserSetAttributes() on
1420         the constructed input. With the previous implementation, this was a bit
1421         inefficient because HTMLInputElement::create() would construct a
1422         TextInputType inputType (as this is the default) as well as its
1423         corresponding shadow subtree. Then, parserSetAttributes() would often
1424         set the |type| attribute and would need to destroy this input type as
1425         well as its subtree if the new |type| is not 'text', to create a new
1426         inputType / shadow subtree of the right type. The profiler showed that
1427         this was fairly expensive.
1428
1429         To improve this, this patch delays the inputType / shadow subtree
1430         creation when the HTMLInputElement is constructed by the parser, until
1431         the attributes are actually set by the parser. This way, we directly
1432         create an inputType / shadow subtree of the right type.
1433
1434         I see a 1.4% speed up on speedometer (73.95 -> 75.0).
1435
1436         Test: fast/dom/HTMLInputElement/border-attribute-crash.html
1437
1438         * dom/Element.cpp:
1439         (WebCore::Element::parserSetAttributes):
1440         (WebCore::Element::parserDidSetAttributes):
1441         * dom/Element.h:
1442         * html/HTMLInputElement.cpp:
1443         (WebCore::HTMLInputElement::HTMLInputElement):
1444         (WebCore::HTMLInputElement::create):
1445         (WebCore::HTMLInputElement::updateType):
1446         (WebCore::HTMLInputElement::runPostTypeUpdateTasks):
1447         (WebCore::HTMLInputElement::initializeInputType):
1448         (WebCore::HTMLInputElement::parseAttribute):
1449         (WebCore::HTMLInputElement::parserDidSetAttributes):
1450         (WebCore::HTMLInputElement::finishParsingChildren):
1451         * html/HTMLInputElement.h:
1452
1453 2014-11-12  Chris Dumez  <cdumez@apple.com>
1454
1455         Have DOMTimer deal with more ScriptExecutionContext references
1456         https://bugs.webkit.org/show_bug.cgi?id=138679
1457
1458         Reviewed by Andreas Kling.
1459
1460         Have DOMTimer deal with more ScriptExecutionContext references instead
1461         of pointers, to make it clear the script execution context cannot be
1462         null.
1463
1464         No new tests, no behavior change.
1465
1466         * bindings/js/ScheduledAction.cpp:
1467         (WebCore::ScheduledAction::execute):
1468         (WebCore::ScheduledAction::executeFunctionInContext):
1469         * bindings/js/ScheduledAction.h:
1470         * dom/DocumentEventQueue.cpp:
1471         * page/DOMTimer.cpp:
1472         (WebCore::DOMTimerFireState::DOMTimerFireState):
1473         (WebCore::NestedTimersMap::instanceForContext):
1474         (WebCore::DOMTimer::DOMTimer):
1475         (WebCore::DOMTimer::install):
1476         (WebCore::DOMTimer::removeById):
1477         (WebCore::DOMTimer::fired):
1478         * page/DOMTimer.h:
1479         * page/DOMWindow.cpp:
1480         (WebCore::DOMWindow::setTimeout):
1481         (WebCore::DOMWindow::clearTimeout):
1482         (WebCore::DOMWindow::setInterval):
1483         (WebCore::DOMWindow::clearInterval):
1484         * page/SuspendableTimer.cpp:
1485         (WebCore::SuspendableTimer::SuspendableTimer):
1486         * page/SuspendableTimer.h:
1487         * workers/WorkerGlobalScope.cpp:
1488         (WebCore::WorkerGlobalScope::setTimeout):
1489         (WebCore::WorkerGlobalScope::clearTimeout):
1490         (WebCore::WorkerGlobalScope::setInterval):
1491         (WebCore::WorkerGlobalScope::clearInterval):
1492
1493 2014-11-12  Dean Jackson  <dino@apple.com>
1494
1495         Support unprefixed animation property names
1496         https://bugs.webkit.org/show_bug.cgi?id=138678
1497         <rdar://problem/18943059>
1498
1499         Reviewed by Simon Fraser.
1500
1501         Step 1 of 3 in unprefixing CSS animations: handling the
1502         property names and values.
1503
1504         Unlike other unprefixing, where we use an alias that
1505         effectively removes the prefixed values from the code,
1506         for animations we need to keep the old values around so that
1507         existing content will not break (e.g. computed style).
1508
1509         During testing I noticed that we didn't handle the
1510         (relatively) new animation-direction values of
1511         "reverse" and "alternate-reverse" when querying
1512         computed style.
1513
1514         Tests: animations/unprefixed-properties.html
1515                animations/unprefixed-shorthand.html
1516
1517         * css/CSSComputedStyleDeclaration.cpp:
1518         (WebCore::ComputedStyleExtractor::propertyValue): Handle the unprefixed
1519         values, but also get animation direction to produce the correct
1520         results when "reverse" and "alternate-reverse" is specified.
1521
1522         * css/CSSParser.cpp: Handle the new values. If necessary, pass a flag
1523         around indicating whether it is prefixed or unprefixed.
1524         (WebCore::CSSParser::parseValue):
1525         (WebCore::CSSParser::parseAnimationShorthand): Use the flag to decide
1526         which of the forms we're going to check.
1527         (WebCore::CSSParser::parseAnimationProperty):
1528         * css/CSSParser.h:
1529
1530         * css/CSSProperty.h:
1531         (WebCore::prefixingVariantForPropertyId): Add prefixing/unprefixing variants for
1532         all the animation values, and clean up the code a bit.
1533
1534         * css/CSSPropertyNames.in: Add new properties.
1535
1536         * css/DeprecatedStyleBuilder.cpp:
1537         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder): We need handlers for the
1538         unprefixed forms. This should move to the new StyleBuilder soon.
1539
1540         * css/StyleProperties.cpp: Handle new values.
1541         (WebCore::StyleProperties::getPropertyValue):
1542         (WebCore::StyleProperties::asText):
1543
1544         * css/StylePropertyShorthand.cpp:
1545         (WebCore::animationShorthand):
1546         (WebCore::animationShorthandForParsing): Decide which list of properties to use.
1547         (WebCore::shorthandForProperty):
1548         (WebCore::matchingShorthandsForLonghand):
1549         (WebCore::webkitAnimationShorthandForParsing): Deleted.
1550         * css/StylePropertyShorthand.h:
1551
1552         * css/StyleResolver.cpp: Since the new properties come before "background" in
1553         alphabetical order, they are earlier in the CSSPropertyNames.in file, and thus
1554         we need to update the call sites that think CSSPropertyBackground is the first
1555         property.
1556         (WebCore::StyleResolver::styleForKeyframe): Replace CSSPropertyBackground with CSSPropertyAnimation.
1557         (WebCore::StyleResolver::styleForPage):
1558         (WebCore::StyleResolver::applyMatchedProperties):
1559         (WebCore::StyleResolver::applyProperty):
1560
1561 2014-11-12  Beth Dakin  <bdakin@apple.com>
1562
1563         Speculative build fix.
1564
1565         * WebCore.exp.in:
1566
1567 2014-11-12  Timothy Horton  <timothy_horton@apple.com>
1568
1569         Fix the iOS build.
1570
1571         * platform/spi/mac/DataDetectorsSPI.h:
1572         It's likely that more of this file should be compiled out on iOS,
1573         but this is all we need to build.
1574
1575 2014-11-12  Beth Dakin  <bdakin@apple.com>
1576
1577         WK1: Support default actions for images
1578         https://bugs.webkit.org/show_bug.cgi?id=138668
1579         -and corresponding-
1580         rdar://problem/18785434
1581
1582         Reviewed by Tim Horton.
1583
1584         Symbol needed for copying image.
1585         * WebCore.exp.in:
1586
1587 2014-11-05  Ada Chan  <adachan@apple.com>
1588
1589         Implement new plug-in API for muting plug-ins
1590         https://bugs.webkit.org/show_bug.cgi?id=138105
1591
1592         Reviewed by Anders Carlsson.
1593
1594         Add the new NPNVmuteAudioBool NPNVariable.
1595
1596         Test: platform/mac-wk2/plugins/muted-state.html
1597
1598         * plugins/npapi.h:
1599
1600 2014-11-12  Tim Horton  <timothy_horton@apple.com>
1601
1602         Need to show the text indicator when Data Detectors shows a popover
1603         https://bugs.webkit.org/show_bug.cgi?id=138664
1604         <rdar://problem/18869900>
1605
1606         Reviewed by Beth Dakin.
1607
1608         * platform/spi/mac/DataDetectorsSPI.h:
1609         Add new DataDetectors SPI.
1610
1611 2014-11-12  Chris Dumez  <cdumez@apple.com>
1612
1613         Minor improvements to RenderListItem
1614         https://bugs.webkit.org/show_bug.cgi?id=138601
1615
1616         Reviewed by Darin Adler.
1617
1618         Make several minor improvements to RenderListItem and clean up the
1619         code a bit.
1620
1621         No new tests, no behavior change.
1622
1623         * rendering/RenderListItem.cpp:
1624         (WebCore::isHTMLListElement):
1625         - Rename isList to isHTMLListElement() for clarity as it checks
1626           for HTMLOListElement and HTMLUListElement types
1627         - Inline the function as it is short.
1628         - Use is<HTML*Element>() for type checking
1629         - Update the argument to take a Node& instead of an Element*. This
1630           is because the argument is expected to the non-null. Also using
1631           looser typing here allows us to use this utility function is one
1632           more place, without impacting performance as
1633           hasTagName(HTMLQualifiedName) is defined on Node.
1634
1635         (WebCore::enclosingList):
1636         - Pass the argument as a reference instead of a pointer as it is
1637           expected to be non-null.
1638         - Initialize firstNode before the loop to avoid the if (!firstNode)
1639           check for every iteration.
1640
1641         (WebCore::nextListItem):
1642         - Take an Element as second argument instead of a RenderListItem*
1643           and provide convenience overloads so that we don't need to do
1644           null checks just because some calls sites call this function
1645           with 2 arguments and others with 1 argument. This way, we avoid
1646           unnecessary null checks as most call sites already do such
1647           checks (or have references).
1648         - Transform the while loop into a for loop for clarity.
1649         - Don't traverse an Element's subtree if the Element does not have
1650           a renderer as it is impossible of any of its descendant to have
1651           a renderer (and we are looking for a specific type of renderer).
1652
1653         (WebCore::previousListItem):
1654         - Pass the item argument as a reference instead of a pointer as it
1655           is expected to be non-null.
1656         - Reduce the scope of the |current| so that it is now declared
1657           inside the loop.
1658
1659         (WebCore::RenderListItem::updateItemValuesForOrderedList):
1660         (WebCore::RenderListItem::itemCountForOrderedList):
1661         - Pass argument as a reference instead of a pointer as it was expected
1662           to be non-null (There was an assertion in place to make sure of it).
1663
1664         (WebCore::RenderListItem::calcValue):
1665         - Use is<HTMLOListElement>() instead of hasTagName().
1666
1667         (WebCore::getParentOfFirstLineBox):
1668         - Rename variables to stop using abbreviations.
1669         - Pass arguments as references instead of pointers as they are expected
1670           to be non-null.
1671         - Remove the firstChild null check before the loop as it does not
1672           change behavior. The loop will abort early if firstChild is null
1673           and we will end up returning nullptr as well.
1674         - Use is<>() more for type checking.
1675         - Reuse the isHTMLListElement() utility function instead of duplicating
1676           its code inside this function.
1677
1678         (WebCore::firstNonMarkerChild):
1679         - Pass argument as a reference as it is expected to be non-null.
1680         - Rename variable from result to child for clarity, as we are traversing
1681           the children.
1682
1683         (WebCore::RenderListItem::markerTextWithSuffix):
1684         - Use String appending instead of StringBuilder as it simplifies the
1685           code a lot and should not impact performance in this case.
1686
1687         (WebCore::RenderListItem::explicitValueChanged):
1688         - Restructure the code a bit to do the |listNode| null check before the
1689           loop, now that nextListItem() takes a reference in argument. This is
1690           the only call site where we didn't already know that listNode is
1691           non-null.
1692
1693         (WebCore::previousOrNextItem):
1694         - Mark this function as inline as it is short and called repeatedly.
1695
1696 2014-11-12  Chris Dumez  <cdumez@apple.com>
1697
1698         Speed up HTMLTextFormControlElement::setInnerTextValue() a bit
1699         https://bugs.webkit.org/show_bug.cgi?id=138619
1700
1701         Reviewed by Darin Adler.
1702
1703         Speed up HTMLTextFormControlElement::setInnerTextValue() a bit by:
1704         - Not doing a virtual isTextFormControl() call. Relying on innerTextElement()
1705           not returning null is sufficient.
1706         - Caching the result of innerTextElement() instead of repeatedly calling that
1707           virtual function.
1708         - De-virtualizing setFormControlValueMatchesRenderer() /
1709           formControlValueMatchesRenderer() as these are never overridden.
1710         - Moving the code constructing the innerTextValue from a
1711           TextControlInnerTextElement from innerTextValue() to a new
1712           innerTextValueFrom(TextControlInnerTextElement&) function and call this new
1713           function from setInnerTextValue() to avoid calling innerTextElement() again
1714           and making sure it is non-null
1715         - Do the tree traversal from innerTextElement's firstChild instead of from
1716           innerTextElement. The innerTextElement is a TextControlInnerTextElement.
1717           Therefore, it cannot be an HTMLBRElement or a Text node.
1718
1719         No new tests, no behavior change.
1720
1721         * html/HTMLFormControlElement.h:
1722         (WebCore::HTMLFormControlElement::formControlValueMatchesRenderer):
1723         (WebCore::HTMLFormControlElement::setFormControlValueMatchesRenderer):
1724         * html/HTMLTextFormControlElement.cpp:
1725         (WebCore::stripTrailingNewline):
1726         (WebCore::innerTextValueFrom):
1727         (WebCore::HTMLTextFormControlElement::setInnerTextValue):
1728         (WebCore::HTMLTextFormControlElement::innerTextValue):
1729         (WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks):
1730         (WebCore::finishText): Deleted.
1731
1732 2014-11-12  Jer Noble  <jer.noble@apple.com>
1733
1734         [Mac] media/track/audio-track.html is flakey
1735         https://bugs.webkit.org/show_bug.cgi?id=138394
1736
1737         Reviewed by Alexey Proskuryakov.
1738
1739         The above test fails if the HTMLMediaElement's "canplaythrough" event fires before the AudioTrackList's
1740         "addtrack" event fires. This can happen because each object keeps its own GenericEventQueue, which
1741         empties when that individual queue's timer fires. So events can be enqueued in the following order:
1742         1, A, 2, B, 3, C; but fired in a different order: 1, 2, 3, A, B, C.
1743
1744         Make events enqueued in GenericEventQueues globally ordered, so that events are fired in the order
1745         which they are enqueued, regardless of which object owns the queue. Use a static queue of
1746         GenericEventQueues to manage which GenericEventQueue fires and in what order.
1747
1748         GenericEventQueues will use a WeakPtrFactory to cancel pending events. Revoking a GenericEventQueue's
1749         weak pointers means those queue's entries will be skipped the next time the meta-queue is processed.
1750
1751         * dom/GenericEventQueue.cpp:
1752         (WebCore::GenericEventQueue::GenericEventQueue): Create a WeakPtrFactory instead of a Timer.
1753         (WebCore::GenericEventQueue::enqueueEvent): Enqueue this queue with the MetaQueue.
1754         (WebCore::GenericEventQueue::sharedTimer): Lazily-initializing accessor.
1755         (WebCore::GenericEventQueue::sharedTimerFired):  Ask each queue to dispatch one event.
1756         (WebCore::GenericEventQueue::pendingQueues): Lazily-initializing accessor.
1757         (WebCore::GenericEventQueue::dispatchOneEvent): Renamed from timerFired.
1758         (WebCore::GenericEventQueue::close): Revoke all WeakPtrs.
1759         (WebCore::GenericEventQueue::cancelAllEvents): Ditto.
1760         (WebCore::GenericEventQueue::hasPendingEvents): Use !isEmpty().
1761         (WebCore::GenericEventQueue::timerFired): Deleted.
1762         * dom/GenericEventQueue.h:
1763
1764 2014-11-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1765
1766         [GTK] Expose user script messages to GObject DOM bindings
1767         https://bugs.webkit.org/show_bug.cgi?id=138411
1768
1769         Reviewed by Philippe Normand.
1770
1771         * PlatformGTK.cmake: Add WebKitDOMCustomUnstable.h to the list of
1772         installed headers and make a symlink for it in the DerivedSources dir.
1773         * bindings/gobject/WebKitDOMCustomUnstable.h: Added.
1774         * bindings/gobject/WebKitDOMCustom.cpp:
1775         (webkit_dom_dom_window_get_webkit_namespace):
1776         (webkit_dom_user_message_handlers_namespace_get_handler):
1777         * bindings/scripts/CodeGeneratorGObject.pm:
1778         (HasUnstableCustomAPI): Helper function to check if the given
1779         class has custom unstable API.
1780         (WriteData): Include WebKitDOMCustomUnstable.h header if the class
1781         has API defined there.
1782
1783 2014-11-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1784
1785         [GTK] Fix how SerializedScriptValue is exposed to GObject DOM bindings
1786         https://bugs.webkit.org/show_bug.cgi?id=138409
1787
1788         Reviewed by Philippe Normand.
1789
1790         It's currently exposed as a WebKitDOMSerializedScriptValue class
1791         that doesn't really exist. It should be handled as a string, that
1792         is used to create a SerializedScriptValue when coming from the
1793         API, and converted to a string again when returned to the API.
1794
1795         * bindings/scripts/CodeGeneratorGObject.pm:
1796         (GetGlibTypeName): Return gchar* as glib type of SerializedScriptValue.
1797         (IsGDOMClassType): Don't consider SerializedScriptValue as a GDOM class.
1798         (GenerateFunction): Handle SerializedScriptValue parameters and
1799         return values specially.
1800         * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
1801         (webkit_dom_test_callback_callback_with_serialized_script_value_param):
1802         * bindings/scripts/test/GObject/WebKitDOMTestCallback.h:
1803         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1804         (webkit_dom_test_obj_serialized_value):
1805         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1806         * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
1807         (webkit_dom_test_serialized_script_value_interface_class_init):
1808         (webkit_dom_test_serialized_script_value_interface_get_value):
1809         (webkit_dom_test_serialized_script_value_interface_set_value):
1810         (webkit_dom_test_serialized_script_value_interface_get_readonly_value):
1811         (webkit_dom_test_serialized_script_value_interface_get_cached_value):
1812         (webkit_dom_test_serialized_script_value_interface_set_cached_value):
1813         (webkit_dom_test_serialized_script_value_interface_get_cached_readonly_value):
1814         * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h:
1815         * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp:
1816         (webkit_dom_test_typedefs_class_init):
1817         (webkit_dom_test_typedefs_get_immutable_serialized_script_value):
1818         (webkit_dom_test_typedefs_set_immutable_serialized_script_value):
1819         * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.h:
1820
1821 2014-11-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1822
1823         [GTK] Move RedirectedXCompositeWindow from platform to WebKit2 layer
1824         https://bugs.webkit.org/show_bug.cgi?id=138093
1825
1826         Reviewed by Martin Robinson.
1827
1828         Remove RedirectedXCompositeWindow.
1829
1830         * PlatformGTK.cmake:
1831
1832 2014-09-01  Philippe Normand  <pnormand@igalia.com>
1833
1834         [WK2] UserMediaClient support
1835         https://bugs.webkit.org/show_bug.cgi?id=123158
1836
1837         Reviewed by Benjamin Poulain.
1838
1839         Added document and frame accessors, needed by the
1840         UserMediaRequestManager of the WebProcess. Also added two methods
1841         used by the permission request manager to know if access to audio
1842         or video devices is requested.
1843
1844         Tests: fast/mediastream/error.html
1845                fast/mediastream/success.html
1846                fast/mediastream/delayed-permission-allowed.html
1847                fast/mediastream/delayed-permission-denied.html
1848                http/tests/media/media-stream/disconnected-frame-already.html
1849                http/tests/media/media-stream/disconnected-frame-permission-denied.html
1850                http/tests/media/media-stream/disconnected-frame.html
1851
1852         * Modules/mediastream/UserMediaRequest.cpp:
1853         (WebCore::UserMediaRequest::document):
1854         (WebCore::UserMediaRequest::frame):
1855         * Modules/mediastream/UserMediaRequest.h:
1856         (WebCore::UserMediaRequest::requiresAudio):
1857         (WebCore::UserMediaRequest::requiresVideo):
1858
1859 2014-11-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1860
1861         [EFL] Clean up OwnPtr in RenderThemeEfl
1862         https://bugs.webkit.org/show_bug.cgi?id=138642
1863
1864         Reviewed by Zoltan Herczeg.
1865
1866         No new tests, no behavior change.
1867
1868         * platform/efl/RenderThemeEfl.cpp:
1869         (WebCore::RenderThemeEfl::applyEdjeRTLState): Clean up all remaining OwnPtr. 
1870
1871 2014-11-11  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1872
1873         Move Modules/websockets to std::unique_ptr
1874         https://bugs.webkit.org/show_bug.cgi?id=138649
1875
1876         Reviewed by Chris Dumez.
1877
1878         Remove create() factory function and use std::make_unique<>, std::unique_ptr<>
1879         instead of OwnPtr, PassOwnPtr.
1880         However didReceiveBinaryData() is still using PassOwnPtr. It should be replaced
1881         with std::unique_ptr<>
1882
1883         No new tests, no behavior.
1884
1885         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
1886         * Modules/websockets/WebSocket.cpp:
1887         * Modules/websockets/WebSocketChannel.cpp:
1888         (WebCore::WebSocketChannel::connect):
1889         (WebCore::WebSocketChannel::didFail):
1890         (WebCore::WebSocketChannel::processFrame):
1891         (WebCore::WebSocketChannel::enqueueTextFrame):
1892         (WebCore::WebSocketChannel::enqueueRawFrame):
1893         (WebCore::WebSocketChannel::enqueueBlobFrame):
1894         (WebCore::WebSocketChannel::processOutgoingFrameQueue):
1895         (WebCore::WebSocketChannel::sendFrame):
1896         * Modules/websockets/WebSocketChannel.h:
1897         * Modules/websockets/WebSocketDeflateFramer.cpp:
1898         (WebCore::WebSocketDeflateFramer::createExtensionProcessor):
1899         (WebCore::WebSocketDeflateFramer::enableDeflate):
1900         (WebCore::WebSocketDeflateFramer::deflate):
1901         (WebCore::WebSocketDeflateFramer::inflate):
1902         (WebCore::WebSocketExtensionDeflateFrame::create): Deleted.
1903         * Modules/websockets/WebSocketDeflateFramer.h:
1904         (WebCore::DeflateResultHolder::create): Deleted.
1905         (WebCore::InflateResultHolder::create): Deleted.
1906         * Modules/websockets/WebSocketDeflater.cpp:
1907         (WebCore::WebSocketDeflater::WebSocketDeflater):
1908         (WebCore::WebSocketInflater::WebSocketInflater):
1909         (WebCore::WebSocketDeflater::create): Deleted.
1910         (WebCore::WebSocketInflater::create): Deleted.
1911         * Modules/websockets/WebSocketDeflater.h:
1912         * Modules/websockets/WebSocketExtensionDispatcher.cpp:
1913         (WebCore::WebSocketExtensionDispatcher::addProcessor):
1914         * Modules/websockets/WebSocketExtensionDispatcher.h:
1915         * Modules/websockets/WebSocketHandshake.cpp:
1916         (WebCore::WebSocketHandshake::addExtensionProcessor):
1917         * Modules/websockets/WebSocketHandshake.h:
1918
1919 2014-11-11  Chris Dumez  <cdumez@apple.com>
1920
1921         Unreviewed iOS build fix after r176001.
1922
1923         Export an additional symbol.
1924
1925         * WebCore.exp.in:
1926
1927 2014-11-11  Jer Noble  <jer.noble@apple.com>
1928
1929         [Mac] Add diagnostic logging for per-media-engine load failures
1930         https://bugs.webkit.org/show_bug.cgi?id=138647
1931
1932         Reviewed by Eric Carlson.
1933
1934         Add diagnostic logging fired whenever a media engine fails to load media,
1935         even if another engine subsequentially succeeds. Add a mechanism for retrieving
1936         the platform-specific error code from a given engine.
1937
1938         * html/HTMLMediaElement.cpp:
1939         (WebCore::HTMLMediaElement::parseAttribute):
1940         * html/HTMLMediaElement.h:
1941         * page/DiagnosticLoggingKeys.cpp:
1942         (WebCore::DiagnosticLoggingKeys::engineFailedToLoadKey):
1943         * page/DiagnosticLoggingKeys.h:
1944         * platform/graphics/MediaPlayer.cpp:
1945         (WebCore::MediaPlayer::networkStateChanged):
1946         (WebCore::MediaPlayer::platformErrorCode):
1947         * platform/graphics/MediaPlayer.h:
1948         (WebCore::MediaPlayerClient::mediaPlayerEngineFailedToLoad):
1949         * platform/graphics/MediaPlayerPrivate.h:
1950         (WebCore::MediaPlayerPrivateInterface::platformErrorCode):
1951         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1952         (WebCore::MediaPlayerPrivateAVFoundation::platformErrorCode):
1953         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1954         (WebCore::MediaPlayerPrivateAVFoundationCF::assetErrorCode):
1955         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1956         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1957         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1958         (WebCore::MediaPlayerPrivateAVFoundationObjC::assetErrorCode):
1959         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
1960         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1961         (WebCore::MediaPlayerPrivateQTKit::platformErrorCode):
1962
1963 2014-11-11  Chris Dumez  <cdumez@apple.com>
1964
1965         Mark more virtual functions in HTMLInputElement as final
1966         https://bugs.webkit.org/show_bug.cgi?id=138644
1967
1968         Reviewed by Andreas Kling.
1969
1970         Mark more virtual functions in HTMLInputElement as final to help the
1971         compiler optimize better.
1972
1973         No new tests, no behavior change.
1974
1975         * html/HTMLInputElement.h:
1976
1977 2014-11-11  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1978
1979         Remove IncrementalSweeper::create()
1980         https://bugs.webkit.org/show_bug.cgi?id=138243
1981
1982         Reviewed by Filip Pizlo.
1983
1984         As a step to use std::unique_ptr<> and std::make_unique<>, this patch removes
1985         IncrementalSweeper::create(), then set constructor of IncrementalSweeper to public.
1986         Now we begins to use std::make_unique<> to create IncrementalSweeper instance.
1987
1988         No new tests, no behavior changes.
1989
1990         * bindings/js/JSDOMWindowBase.cpp:
1991         (WebCore::JSDOMWindowBase::commonVM):
1992         * platform/ios/WebSafeIncrementalSweeperIOS.h:
1993
1994 2014-11-11  Chris Dumez  <cdumez@apple.com>
1995
1996         Move 'border-image-*' / '-webkit-mask-box-image-*' CSS properties to the new StyleBuilder
1997         https://bugs.webkit.org/show_bug.cgi?id=138594
1998
1999         Reviewed by Antti Koivisto.
2000
2001         Move 'border-image-*' / '-webkit-mask-box-image-*' CSS properties from
2002         DeprecatedStyleBuilder to the new StyleBuilder using custom code.
2003
2004         No new tests, no behavior change.
2005
2006         * css/CSSPropertyNames.in:
2007         * css/DeprecatedStyleBuilder.cpp:
2008         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
2009         (WebCore::ApplyPropertyBorderImageModifier::getValue): Deleted.
2010         (WebCore::ApplyPropertyBorderImageModifier::setValue): Deleted.
2011         (WebCore::ApplyPropertyBorderImageModifier::applyInheritValue): Deleted.
2012         (WebCore::ApplyPropertyBorderImageModifier::applyInitialValue): Deleted.
2013         (WebCore::ApplyPropertyBorderImageModifier::applyValue): Deleted.
2014         (WebCore::ApplyPropertyBorderImageModifier::createHandler): Deleted.
2015         * css/StyleBuilderCustom.h:
2016         (WebCore::StyleBuilderFunctions::ApplyPropertyBorderImageModifier::applyInheritValue):
2017         (WebCore::StyleBuilderFunctions::ApplyPropertyBorderImageModifier::applyInitialValue):
2018         (WebCore::StyleBuilderFunctions::ApplyPropertyBorderImageModifier::applyValue):
2019         (WebCore::StyleBuilderFunctions::ApplyPropertyBorderImageModifier::getValue):
2020         (WebCore::StyleBuilderFunctions::ApplyPropertyBorderImageModifier::setValue):
2021
2022 2014-11-11  David Kilzer  <ddkilzer@apple.com>
2023
2024         Modernize $buildingForIPhone in CodeGeneratorObjC.pm
2025         <http://webkit.org/b/138640>
2026
2027         Reviewed by Daniel Bates.
2028
2029         Mac OS X is the only platform that supports NSColor, so rename
2030         $buildingForIPhone to $shouldUseCGColor (which is actually what
2031         the variable represents) and define it in terms of the "macosx"
2032         platform name.
2033
2034         * bindings/scripts/CodeGeneratorObjC.pm:
2035         ($buildingForIPhone): Rename to $shouldUseCGColor.
2036         ($shouldUseCGColor): False if PLATFORM_NAME is not defined,
2037         which is the case on older Xcodes when building for Mac OS X, or
2038         if PLATFORM_NAME is equal to "macosx".  True otherwise.
2039         (GetClassName): Switch to use new variable name.
2040         (AddIncludesForType): Ditto.
2041         (GenerateHeader): Remove dead code.  The
2042         $buildingForTigerOrEarlier variable was accidentally
2043         re-introduced in r161638, but was originally removed in r127032!
2044         (GenerateImplementation): Switch to use new variable name.
2045
2046 2014-11-11  Tim Horton  <timothy_horton@apple.com>
2047
2048         Add support for mailto: link action menus
2049         https://bugs.webkit.org/show_bug.cgi?id=138641
2050         <rdar://problem/18741567>
2051
2052         Reviewed by Beth Dakin.
2053
2054         * WebCore.exp.in:
2055         Add an export.
2056
2057         * platform/spi/mac/DataDetectorsSPI.h:
2058         Add some DataDetectors SPI.
2059
2060 2014-11-11  Eric Carlson  <eric.carlson@apple.com>
2061
2062         [iOS] video is sometimes allowed to play from the background
2063         https://bugs.webkit.org/show_bug.cgi?id=138522
2064
2065         Rubber-stamped by Jer Noble.
2066
2067         * platform/audio/MediaSession.cpp:
2068         (WebCore::MediaSession::updateClientDataBuffering): Call MediaSessionManager::sessionCanLoadMedia.
2069
2070 2014-11-11  Eric Carlson  <eric.carlson@apple.com>
2071
2072         [iOS] a page with video in optimized fullscreen is visible
2073         https://bugs.webkit.org/show_bug.cgi?id=138632
2074
2075         Reviewed by Anders Carlsson.
2076
2077         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2078         (WebCore::WebVideoFullscreenInterfaceAVKit::mode): Expose fullscreen mode.
2079
2080 2014-11-11  Myles C. Maxfield  <mmaxfield@apple.com>
2081
2082         Mountain Lion build fix
2083         https://bugs.webkit.org/show_bug.cgi?id=138631
2084
2085         Reviewed by Simon Fraser.
2086
2087         * platform/spi/cocoa/CoreTextSPI.h:
2088
2089 2014-11-11  Eric Carlson  <eric.carlson@apple.com>
2090
2091         [iOS] cleanup wireless route monitoring
2092         https://bugs.webkit.org/show_bug.cgi?id=138614
2093
2094         Reviewed by Jer Noble.
2095
2096         * html/HTMLMediaElement.cpp:
2097         (WebCore::HTMLMediaElement::clearMediaPlayer): Add logging.
2098         (WebCore::HTMLMediaElement::removeEventListener): Ditto.
2099         (WebCore::HTMLMediaElement::createMediaPlayer): Ditto.
2100
2101         * platform/audio/ios/MediaSessionManagerIOS.mm:
2102         (WebCore::MediaSessionManageriOS::resetRestrictions): Add logging.
2103         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring): Ditto.
2104         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Ditto.
2105         (-[WebMediaSessionHelper initWithCallback:]): Ditto.
2106         (-[WebMediaSessionHelper dealloc]): Always deallocate volume view and routing controller
2107             on the main thread.
2108         (-[WebMediaSessionHelper clearCallback]): Add logging.
2109         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]): Ditto.
2110         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Always call routing controller on
2111             the main thread.
2112         (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]): Ditto.
2113         (-[WebMediaSessionHelper interruption:]): Add logging.
2114         (-[WebMediaSessionHelper applicationWillEnterForeground:]): Ditto.
2115         (-[WebMediaSessionHelper applicationDidBecomeActive:]): Ditto.
2116         (-[WebMediaSessionHelper applicationWillResignActive:]): Ditto.
2117         (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]): Ditto.
2118
2119 2014-11-11  Myles C. Maxfield  <mmaxfield@apple.com>
2120
2121         Unreviewd iOS build fix
2122
2123         * platform/spi/cocoa/CoreTextSPI.h:
2124
2125 2014-11-11  David Kilzer  <ddkilzer@apple.com>
2126
2127         Protect Document in ProcessingInstruction::setXSLStyleSheet()
2128         <http://webkit.org/b/138621>
2129
2130         Reviewed by Andreas Kling.
2131
2132         The patch is inspired by the following Blink revision by
2133         <tasak@google.com>:
2134         <https://src.chromium.org/viewvc/blink?view=rev&revision=182309>
2135
2136         * dom/ProcessingInstruction.cpp:
2137         (WebCore::ProcessingInstruction::setXSLStyleSheet):
2138
2139 2014-11-11  Myles C. Maxfield  <mmaxfield@apple.com>
2140
2141         Finish moving CTFontGetVerticalGlyphsForCharacters and CTLineCreateWithUniCharProvider out from WKSI
2142         https://bugs.webkit.org/show_bug.cgi?id=138623
2143
2144         Reviewed by Geoff Garen.
2145
2146         No new tests because there is no behavior change.
2147
2148         * WebCore.exp.in:
2149         * WebCore.order:
2150         * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
2151         (WebCore::GlyphPage::fill):
2152         * platform/graphics/mac/SimpleFontDataMac.mm:
2153         (WebCore::SimpleFontData::canRenderCombiningCharacterSequence):
2154         * platform/ios/WebCoreSystemInterfaceIOS.mm:
2155         * platform/mac/WebCoreSystemInterface.h:
2156         * platform/mac/WebCoreSystemInterface.mm:
2157         * platform/spi/cocoa/CoreTextSPI.h:
2158
2159 2014-11-11  Myles C. Maxfield  <mmaxfield@apple.com>
2160
2161         Unreviewed Mountain Lion build fix
2162
2163         * platform/spi/cocoa/CoreTextSPI.h:
2164
2165 2014-11-11  Commit Queue  <commit-queue@webkit.org>
2166
2167         Unreviewed, rolling out r175852.
2168         https://bugs.webkit.org/show_bug.cgi?id=138626
2169
2170         Broke PLT by introducing a crash. (Requested by rniwa on
2171         #webkit).
2172
2173         Reverted changeset:
2174
2175         "Lazily create HTMLInputElement's inputType and shadow
2176         subtree"
2177         https://bugs.webkit.org/show_bug.cgi?id=138524
2178         http://trac.webkit.org/changeset/175852
2179
2180 2014-11-11  Chris Dumez  <cdumez@apple.com>
2181
2182         Regression(r175947): Caused assertions in debug builds
2183         https://bugs.webkit.org/show_bug.cgi?id=138620
2184
2185         Reviewed by Benjamin Poulain.
2186
2187         In HTMLCollection::traverseForward(), traversedCount was incremented 1
2188         time too many when hitting the end of the collection (i.e. element
2189         becomes null). Doing a partial revert.
2190
2191         No new tests, already covered by existing tests.
2192
2193         * html/HTMLCollection.cpp:
2194         (WebCore::HTMLCollection::traverseForward):
2195
2196 2014-11-11  Tim Horton  <timothy_horton@apple.com>
2197
2198         DataDetectors' menu items aren't presented in the telephone number menu
2199         https://bugs.webkit.org/show_bug.cgi?id=138602
2200         <rdar://problem/18866308>
2201
2202         Reviewed by Beth Dakin.
2203
2204         * English.lproj/Localizable.strings:
2205         Remove a now-unused localized string.
2206
2207 2014-11-11  Daniel Bates  <dabates@apple.com>
2208
2209         [Frame Flattening] ASSERT(transaction->view == &view()) fails in RenderBlock::removeFromUpdateScrollInfoAfterLayoutTransaction()
2210         https://bugs.webkit.org/show_bug.cgi?id=138615
2211         <rdar://problem/18928487>
2212
2213         Reviewed by David Hyatt.
2214
2215         Fixes an issue where we always expected that the RenderView associated with the RenderBlock called in
2216         RenderBlock::removeFromUpdateScrollInfoAfterLayoutTransaction() is the same as the RenderView associated with
2217         the top transaction in the UpdateScrollInfoAfterLayoutTransaction stack regardless of frame flattening. This
2218         expectation is only true when frame flattening is disabled.
2219
2220         Test: fast/frames/flattening/iframe-flattening-inside-flexbox-with-delayed-scroll-update.html
2221
2222         * rendering/RenderBlock.cpp:
2223         (WebCore::RenderBlock::removeFromUpdateScrollInfoAfterLayoutTransaction):
2224
2225 2014-11-11  Tim Horton  <timothy_horton@apple.com>
2226
2227         Adopt DDActionContext menu type SPI
2228         https://bugs.webkit.org/show_bug.cgi?id=138603
2229         <rdar://problem/18867627>
2230
2231         Reviewed by Anders Carlsson.
2232
2233         * platform/spi/mac/DataDetectorsSPI.h:
2234         Add the new SPI.
2235
2236 2014-11-11  Tim Horton  <timothy_horton@apple.com>
2237
2238         Data Detectors popovers should be dismissed upon scrolling
2239         https://bugs.webkit.org/show_bug.cgi?id=138600
2240         <rdar://problem/18932770>
2241
2242         Reviewed by Beth Dakin.
2243
2244         * platform/spi/mac/DataDetectorsSPI.h:
2245         Adjust the SPI header.
2246
2247 2014-11-11  Tim Horton  <timothy_horton@apple.com>
2248
2249         Localize strings for action menus
2250         https://bugs.webkit.org/show_bug.cgi?id=138591
2251         <rdar://problem/18815343>
2252
2253         Reviewed by Dan Bates.
2254
2255         * English.lproj/Localizable.strings:
2256         Add a bunch of localizable strings.
2257
2258 2014-11-11  Myles C. Maxfield  <mmaxfield@apple.com>
2259
2260         Cleanup from r175379
2261         https://bugs.webkit.org/show_bug.cgi?id=138616
2262
2263         Reviewed by Simon Fraser.
2264
2265         No new tests because there is no behavior change.
2266
2267         * WebCore.exp.in:
2268         * platform/ios/WebCoreSystemInterfaceIOS.mm:
2269         * platform/mac/WebCoreSystemInterface.h:
2270         * platform/mac/WebCoreSystemInterface.mm:
2271
2272 2014-11-11  Myles C. Maxfield  <mmaxfield@apple.com>
2273
2274         Move CTFontTransformGlyphs out from WKSI
2275         https://bugs.webkit.org/show_bug.cgi?id=138599
2276
2277         Reviewed by Simon Fraser.
2278
2279         No new tests because there is no behavior change.
2280
2281         * WebCore.exp.in:
2282         * WebCore.order:
2283         * platform/graphics/SimpleFontData.cpp:
2284         (WebCore::SimpleFontData::applyTransforms):
2285         * platform/graphics/SimpleFontData.h:
2286         * platform/ios/WebCoreSystemInterfaceIOS.mm:
2287         * platform/mac/WebCoreSystemInterface.h:
2288         * platform/mac/WebCoreSystemInterface.mm:
2289         * platform/spi/cocoa/CoreTextSPI.h:
2290
2291 2014-11-11  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2292
2293         Use std::unique_ptr<>|std::make_unique_ptr in RenderThemeEfl::ThemePartCacheEntry::create()
2294         https://bugs.webkit.org/show_bug.cgi?id=138558
2295
2296         Reviewed by Anders Carlsson.
2297
2298         This patch removes PassOwnPtr and OwnPtr in RenderThemeEfl::ThemePartCacheEntry::create().
2299         It would be good if we also remove create() factory function though, in this case, it is
2300         a little hard to remove it since the create() factory function does many works to create
2301         a ThemePartCacheEntry instance. Thus this patch just replaces PassOwnPtr|OwnPtr with
2302         std::unique_ptr<> and std::make_unique<> in RenderThemeEfl::ThemePartCacheEntry::create().
2303
2304         Besides the theme entries have been maintained by Eina_List*. Unfortunately it doesn't support
2305         std::unique_ptr<> yet. Thus the Eina_List* should be replaced with Vector<std::unique_ptr<>>
2306         so that m_partCache has ownship of all EFL theme entries. This patch tries to keep original
2307         cache algorithm based on Vector class.
2308
2309         No new tests, no behavior changes.
2310
2311         * platform/efl/RenderThemeEfl.cpp:
2312         (WebCore::RenderThemeEfl::ThemePartCacheEntry::create):
2313         (WebCore::RenderThemeEfl::getThemePartFromCache):
2314         * platform/efl/RenderThemeEfl.h:
2315
2316 2014-11-09  Darin Adler  <darin@apple.com>
2317
2318         Minor tweaks to HTMLCollection
2319         https://bugs.webkit.org/show_bug.cgi?id=138556
2320
2321         Reviewed by Chris Dumez.
2322
2323         * accessibility/AccessibilityRenderObject.cpp:
2324         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
2325         Update for namedElements function that now returns a Vector; also use
2326         a new style for loop to iterate it.
2327
2328         * bindings/js/JSHTMLAllCollectionCustom.cpp: Removed some unneeded includes.
2329         (WebCore::namedItems): Updated name to match WebKit coding style, and also
2330         updated to use the return value from namedItems, which now returns a Vector.
2331         (WebCore::callHTMLAllCollection): Updated for namedItems name change.
2332         Also removed explicit Node* type from result of namedItemWithIndex, since that
2333         function now returns a more specific type.
2334         (WebCore::JSHTMLAllCollection::nameGetter): Update for namedItems name change.
2335         (WebCore::JSHTMLAllCollection::item): Ditto.
2336         (WebCore::JSHTMLAllCollection::namedItem): Ditto.
2337
2338         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp: Removed some unneeded includes.
2339         (WebCore::namedItems): Updated name to match WebKit coding style, and also
2340         updated to use the return value from namedItems, which now returns a Vector.
2341         (WebCore::JSHTMLFormControlsCollection::nameGetter): Update for namedItems name change.
2342         (WebCore::JSHTMLFormControlsCollection::namedItem): Ditto.
2343
2344         * bindings/js/JSHTMLFormElementCustom.cpp:
2345         (WebCore::JSHTMLFormElement::nameGetter): Updated to use the return value from
2346         namedItems, which now returns a Vector.
2347
2348         * html/HTMLAllCollection.cpp:
2349         (WebCore::HTMLAllCollection::HTMLAllCollection): Marked the constructor inline,
2350         since it's only used in one place, the create function.
2351         (WebCore::HTMLAllCollection::~HTMLAllCollection): Deleted. No need to have an
2352         explicit destructor since there's nothing special to implement, and includers of
2353         the header file have everything they ened to compile the compiler-generated one.
2354         (WebCore::HTMLAllCollection::namedItemWithIndex): Changed return type to Element.
2355
2356         * html/HTMLAllCollection.h: Removed unneeded explicit declaration of destructor.
2357         Chagned return type of namedItemWithIndex to Element.
2358
2359         * html/HTMLCollection.cpp:
2360         (WebCore::HTMLCollection::rootTypeFromCollectionType): Marked this inline. Also
2361         changed this to be a static member function so it can use the RootType enum, which
2362         is now private to the class.
2363         (WebCore::isMatchingHTMLElement): Marked this function static so it will get
2364         internal linkage.
2365         (WebCore::isMatchingElement): Ditto.
2366         (WebCore::previousElement): Marked this function inline since it's called in only
2367         one place. Changed argument type to a reference since it can never be null.
2368         (WebCore::HTMLCollection::iterateForPreviousElement): Changed argument name and
2369         also updated for above changes.
2370         (WebCore::firstMatchingElement): Marked this function static so it will get
2371         internal linkage.
2372         (WebCore::nextMatchingElement): Ditto. Changed argument type to a reference
2373         since it can never be null.
2374         (WebCore::HTMLCollection::item): Changed return type to Element.
2375         (WebCore::nameShouldBeVisibleInDocumentAll): Added an overload that takes an
2376         Element. This streamlines the code below that calls it so it fits on one line.
2377         (WebCore::firstMatchingChildElement): Marked this function static so it will get
2378         internal linkage.
2379         (WebCore::nextMatchingSiblingElement): Ditto. Changed argument type to a reference
2380         since it can never be null.
2381         (WebCore::HTMLCollection::usesCustomForwardOnlyTraversal): Moved here from the
2382         header since, although it's marked inline, it's only used inside this file.
2383         (WebCore::HTMLCollection::traverseForward): Restructured the code a little bit
2384         to make the function smaller and possibly easier to read. This does add one
2385         redundant null check, but it seems OK to do that.
2386         (WebCore::HTMLCollection::collectionTraverseBackward): Tweaked foramtting a bit.
2387         (WebCore::HTMLCollection::namedItem): Changed return type to Element. Tightened
2388         the code that calls nameShouldBeVisibleInDocumentAll so it fits better on one line.
2389         Changed code that handles m_shouldOnlyIncludeDirectChildren to use a nested if
2390         instead of an && since it makes the code a little easier to read.
2391         (WebCore::HTMLCollection::updateNamedElementCache): Tweaked code a little bit,
2392         using shorter variable names, and using references instead of pointers. Also removed
2393         the call to didPopulate, since setNamedItemCache now takes care of that.
2394         (WebCore::HTMLCollection::namedItems): Changed to return a Vector instead of
2395         appending to an existing one. Also use reserveInitialCapacity and uncheckedAppend
2396         for better performance. Added a FIXME, because there seems to be something wrong
2397         here about this being non-virtual. Made other small tweaks to streamline the code.
2398         (WebCore::HTMLCollection::customElementAfter): Moved this here from the header.
2399         There is no reason to need to inline this.
2400
2401         * html/HTMLCollection.h: Removed unneeded includes. Moved function bodies out
2402         of the class definitions so the class definitions are easier to read. Made some
2403         functions that were formerly public or protected be private instead. Added a call
2404         to didPopulate to setNamedItemCache so the callers don't have to do it.
2405
2406         * html/HTMLFormControlsCollection.cpp:
2407         (WebCore::HTMLFormControlsCollection::namedItem): Changed return value to Element.
2408         Tweaked coding style a little bit.
2409         (WebCore::HTMLFormControlsCollection::updateNamedElementCache): Rearranged to
2410         simplify a bit. Don't build the foundInputElements set when the owner is not a
2411         form element, since we don't use the set in that case. Use shorter variable names,
2412         and modern for loops. Also removed the call to didPopulate, since setNamedItemCache
2413         now takes care of that.
2414
2415         * html/HTMLFormControlsCollection.h: Removed some uneeded forward declarations.
2416         Updated return type for namedItem, and also made the override private.
2417
2418         * html/HTMLFormElement.cpp:
2419         (WebCore::HTMLFormElement::namedElements): Changed to return a Vector and updated
2420         function name accordingly.
2421         * html/HTMLFormElement.h: Ditto.
2422
2423         * html/HTMLNameCollection.h: Removed a stray blank line.
2424
2425         * html/HTMLSelectElement.cpp:
2426         (WebCore::HTMLSelectElement::namedItem): Changed return value to Element.
2427         (WebCore::HTMLSelectElement::item): Ditto.
2428         * html/HTMLSelectElement.h: Ditto.
2429
2430         * page/scrolling/AxisScrollSnapOffsets.cpp:
2431         (WebCore::appendChildSnapOffsets): Rewrote loop as a for loop rather than a while
2432         loop. Removed unwanted use of children()->collectionBegin() to get the first element
2433         child of an HTMLElement. This function uses a mix of DOM and rendering functions that
2434         is probably incorrect, but I did not tackle fixing that at this time.
2435
2436 2014-11-11  Dan Bernstein  <mitz@apple.com>
2437
2438         [Mac] WebCore includes unused cursor image resources
2439         https://bugs.webkit.org/show_bug.cgi?id=138605
2440
2441         Reviewed by Anders Carlsson.
2442
2443         * Resources/aliasCursor.png: Removed.
2444         * Resources/cellCursor.png: Removed.
2445         * Resources/contextMenuCursor.png: Removed.
2446         * Resources/copyCursor.png: Removed.
2447         * Resources/eastResizeCursor.png: Removed.
2448         * Resources/eastWestResizeCursor.png: Removed.
2449         * Resources/helpCursor.png: Removed.
2450         * Resources/linkCursor.png: Removed.
2451         * Resources/moveCursor.png: Removed.
2452         * Resources/noDropCursor.png: Removed.
2453         * Resources/noneCursor.png: Removed.
2454         * Resources/northEastResizeCursor.png: Removed.
2455         * Resources/northEastSouthWestResizeCursor.png: Removed.
2456         * Resources/northResizeCursor.png: Removed.
2457         * Resources/northSouthResizeCursor.png: Removed.
2458         * Resources/northWestResizeCursor.png: Removed.
2459         * Resources/northWestSouthEastResizeCursor.png: Removed.
2460         * Resources/progressCursor.png: Removed.
2461         * Resources/southEastResizeCursor.png: Removed.
2462         * Resources/southResizeCursor.png: Removed.
2463         * Resources/southWestResizeCursor.png: Removed.
2464         * Resources/verticalTextCursor.png: Removed.
2465         * Resources/waitCursor.png: Removed.
2466         * Resources/westResizeCursor.png: Removed.
2467         * Resources/zoomInCursor.png: Removed.
2468         * Resources/zoomOutCursor.png: Removed.
2469
2470         * WebCore.xcodeproj/project.pbxproj: Removed references to the above files.
2471
2472         * platform/mac/CursorMac.mm:
2473         (WebCore::Cursor::ensurePlatformCursor): For Help, Cell, ZoomIn and ZoomOut, don’t check
2474         for a nil return value from wkCursor(), which can’t occur in any supported configuration.
2475         For None, create a cursor with an empty NSImage instead of loading a transparent image from
2476         the file system.
2477         (WebCore::createNamedCursor): Deleted.
2478
2479 2014-11-11  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2480
2481         Unreviewed, rolling out r175844.
2482
2483         Win debug build has broken since r175844.
2484
2485         Reverted changeset:
2486
2487         "Use std::unique_ptr<> and std::make_unique<> in WebCore"
2488         https://bugs.webkit.org/show_bug.cgi?id=138560
2489         http://trac.webkit.org/changeset/175844
2490
2491 2014-11-11  Philippe Normand  <pnormand@igalia.com>
2492
2493         Qt/Chromium remnants in MediaPlayer
2494         https://bugs.webkit.org/show_bug.cgi?id=138611
2495
2496         Reviewed by Jer Noble.
2497
2498         * platform/graphics/MediaPlayer.h: Remove unused Qt/Chromium stuff.
2499
2500 2014-11-11  Chris Dumez  <cdumez@apple.com>
2501
2502         Move '-webkit-marquee-speed' CSS property to the new StyleBuilder
2503         https://bugs.webkit.org/show_bug.cgi?id=138595
2504
2505         Reviewed by Antti Koivisto.
2506
2507         Move '-webkit-marquee-speed' CSS property from DeprecatedStyleBuilder
2508         to the new StyleBuilder by adding a new MarqueeSpeed Converter.
2509
2510         No new tests, no behavior change.
2511
2512         * css/CSSPropertyNames.in:
2513         * css/DeprecatedStyleBuilder.cpp:
2514         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
2515         (WebCore::ApplyPropertyMarqueeSpeed::applyValue): Deleted.
2516         (WebCore::ApplyPropertyMarqueeSpeed::createHandler): Deleted.
2517         * css/StyleBuilderConverter.h:
2518         (WebCore::StyleBuilderConverter::convertMarqueeSpeed):
2519
2520 2014-10-07  Sergio Villar Senin  <svillar@igalia.com>
2521
2522         [CSS Grid Layout] Limit the size of explicit/implicit grid
2523         https://bugs.webkit.org/show_bug.cgi?id=136217
2524
2525         Reviewed by Andreas Kling.
2526
2527         A recent change in the specs allow us to set a limit (maximum
2528         size) for both the explicit and implicit grids so we can protect
2529         ourselves from absurdly huge grid specifications. It was decided
2530         to use the recommended limit which is 1 million.
2531
2532         This means that we can remove the old limitation for the number of
2533         repetitions in repeat(). Instead we now clamp the number of
2534         repetitions to the maximum value that allow us to have the maximum
2535         number of whole repetitions without exceeding the track number
2536         limit.
2537
2538         * WebCore.xcodeproj/project.pbxproj:
2539         * css/CSSParser.cpp:
2540         (WebCore::CSSParser::parseGridTrackRepeatFunction): Replaced the
2541         old limit by the new one.
2542         * rendering/RenderGrid.cpp:
2543         (WebCore::RenderGrid::placeItemsOnGrid): Use the amount of tracks
2544         provided by GridResolvedPosition.
2545         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Ditto.
2546         * rendering/style/GridCoordinate.h:
2547         (WebCore::GridSpan::GridSpan):
2548         * rendering/style/GridResolvedPosition.cpp:
2549         (WebCore::GridResolvedPosition::explicitGridColumnCount): Bring
2550         the static function back to life.
2551         (WebCore::GridResolvedPosition::explicitGridRowCount): Ditto.
2552         (WebCore::explicitGridSizeForSide):
2553         * rendering/style/GridResolvedPosition.h:
2554
2555 2014-11-11  Yusuke Suzuki  <utatane.tea@gmail.com>
2556
2557         CSS4 Selectors: Add multiple pseudo elements support to :matches
2558         https://bugs.webkit.org/show_bug.cgi?id=138214
2559
2560         Reviewed by Benjamin Poulain.
2561
2562         In this patch, we implement (multiple) pseudo elements support to :matches.
2563         Currently, we implemented it in css/SelectorChecker and there's no CSS JIT implementation.
2564
2565         And we change the semantics of pseudo element selector behavior.
2566         Previously when pseudo element selector appeared in the non-rightmost
2567         fragment, it was ignored. This patch changes it to unmatched.
2568
2569         * css/SelectorChecker.cpp:
2570         (WebCore::SelectorChecker::CheckingContextWithStatus::CheckingContextWithStatus):
2571         (WebCore::SelectorChecker::match):
2572         (WebCore::hasScrollbarPseudoElement):
2573         (WebCore::SelectorChecker::matchRecursively):
2574         (WebCore::SelectorChecker::checkOne):
2575         (WebCore::SelectorChecker::matchSelectorList):
2576         * css/SelectorChecker.h:
2577         (WebCore::SelectorChecker::MatchResult::matches):
2578         (WebCore::SelectorChecker::MatchResult::updateWithMatchType):
2579         (WebCore::SelectorChecker::MatchResult::fails):
2580         * cssjit/SelectorCompiler.cpp:
2581         (WebCore::SelectorCompiler::addPseudoClassType):
2582         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
2583         (WebCore::SelectorCompiler::constructFragments):
2584         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasPseudoElement):
2585         * rendering/style/RenderStyle.h:
2586         (WebCore::RenderStyle::setHasPseudoStyles):
2587         * rendering/style/RenderStyleConstants.h:
2588         (WebCore::PseudoIdSet::PseudoIdSet):
2589         (WebCore::PseudoIdSet::fromMask):
2590         (WebCore::PseudoIdSet::has):
2591         (WebCore::PseudoIdSet::add):
2592         (WebCore::PseudoIdSet::merge):
2593         (WebCore::PseudoIdSet::operator &):
2594         (WebCore::PseudoIdSet::operator |):
2595         (WebCore::PseudoIdSet::operator bool):
2596         (WebCore::PseudoIdSet::data):
2597
2598 2014-11-10  Chris Dumez  <cdumez@apple.com>
2599
2600         Lazily create HTMLInputElement's inputType and shadow subtree
2601         https://bugs.webkit.org/show_bug.cgi?id=138524
2602
2603         Reviewed by Ryosuke Niwa.
2604
2605         When an HTMLInputElement was created by the parser, we would first call
2606         HTMLInputElement::create(), then call Element::parserSetAttributes() on
2607         the constructed input. With the previous implementation, this was a bit
2608         inefficient because HTMLInputElement::create() would construct a
2609         TextInputType inputType (as this is the default) as well as its
2610         corresponding shadow subtree. Then, parserSetAttributes() would often
2611         set the |type| attribute and would need to destroy this input type as
2612         well as its subtree if the new |type| is not 'text', to create a new
2613         inputType / shadow subtree of the right type. The profiler showed that
2614         this was fairly expensive.
2615
2616         To improve this, this patch delays the inputType / shadow subtree
2617         creation when the HTMLInputElement is constructed by the parser, until
2618         the attributes are actually set by the parser. This way, we directly
2619         create an inputType / shadow subtree of the right type.
2620
2621         I see a 1.4% speed up on speedometer (73.95 -> 75.0).
2622
2623         No new tests, no behavior change.
2624
2625         * dom/Element.cpp:
2626         (WebCore::Element::parserSetAttributes):
2627         (WebCore::Element::parserDidFinishParsingAttributes):
2628         * dom/Element.h:
2629         * html/HTMLInputElement.cpp:
2630         (WebCore::HTMLInputElement::HTMLInputElement):
2631         (WebCore::HTMLInputElement::create):
2632         (WebCore::HTMLInputElement::updateType):
2633         (WebCore::HTMLInputElement::runPostTypeUpdateTasks):
2634         (WebCore::HTMLInputElement::ensureInputType):
2635         (WebCore::HTMLInputElement::parseAttribute):
2636         (WebCore::HTMLInputElement::parserDidFinishParsingAttributes):
2637         * html/HTMLInputElement.h:
2638
2639 2014-11-10  Benjamin Poulain  <bpoulain@apple.com>
2640
2641         Add parsing support for the extended :nth-last-child(An+B of selector-list) defined
2642         https://bugs.webkit.org/show_bug.cgi?id=138520
2643
2644         Reviewed by Andreas Kling.
2645
2646         Add parsing for :nth-last-child(An+B of selector-list). The selector is defined
2647         in CSS Selectors Level 4: http://dev.w3.org/csswg/selectors4/#the-nth-last-child-pseudo
2648
2649         Tests: fast/css/parsing-css-nth-last-child-of-1.html
2650                fast/css/parsing-css-nth-last-child-of-2.html
2651                fast/css/parsing-css-nth-last-child-of-3.html
2652                fast/css/parsing-css-nth-last-child-of-4.html
2653
2654         * css/CSSGrammar.y.in:
2655         * css/CSSParser.cpp:
2656         (WebCore::CSSParser::detectFunctionTypeToken):
2657         * css/CSSSelector.cpp:
2658         (WebCore::CSSSelector::selectorText):
2659
2660 2014-11-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
2661
2662         SVG foreign objects do not inherit the container coordinates system if they are repainted.
2663         https://bugs.webkit.org/show_bug.cgi?id=138481.
2664
2665         Reviewed by Simon Fraser.
2666
2667         If a foreign object is included in an SVG, it should inherit the coordinates system
2668         of the container if it is repainted. The foreign object is actually redrawn in the
2669         CSS coordinates system regardless of the transformation that may be applied to the
2670         container.
2671
2672         The bug is RenderSVG* classes use computeFloatRectForRepaint(), but the rest of the
2673         render classes use computeRectForRepaint(). RenderSVGForeignObject::computeRectForRepaint()
2674         was not defined, so we end up hitting RenderObject::computeRectForRepaint() for 
2675         a RenderSVGTransformableContainer and completely miss the transform.
2676
2677         Tests: svg/transforms/svg-transform-foreign-object-repaint.html
2678
2679         Implement RenderSVGForeignObject::computeRectForRepaint() so we can apply the
2680         container transformation on the SVG foreign object repaint rectangle.
2681         * rendering/svg/RenderSVGForeignObject.cpp:
2682         (WebCore::RenderSVGForeignObject::computeRectForRepaint):
2683         * rendering/svg/RenderSVGForeignObject.h:
2684
2685 2014-11-10  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2686
2687         Use std::unique_ptr<> and std::make_unique<> in WebCore
2688         https://bugs.webkit.org/show_bug.cgi?id=138560
2689
2690         Reviewed by Chris Dumez.
2691
2692         Clean up unused OwnPtr.h and PassOwnPtr.h and use std::unique_ptr.
2693
2694         No new tests, no behavior changes.
2695
2696         * Modules/encryptedmedia/CDMPrivateMediaPlayer.h:
2697         * dom/ContainerNode.h:
2698         * dom/ElementIteratorAssertions.h:
2699         (WebCore::ElementIteratorAssertions::ElementIteratorAssertions):
2700         * dom/ElementRareData.h:
2701         * page/DragController.h:
2702         * rendering/RenderView.h:
2703
2704 2014-11-10  Beth Dakin  <bdakin@apple.com>
2705
2706         WK1: Support default actions for editable text with misspelled word
2707         https://bugs.webkit.org/show_bug.cgi?id=138590
2708         -and corresponding-
2709         rdar://problem/18877506
2710
2711         Reviewed by Tim Horton.
2712
2713         * WebCore.exp.in:
2714
2715 2014-11-10  Chris Dumez  <cdumez@apple.com>
2716
2717         Remove unnecessary null check in FrameSelection::nodeWillBeRemoved()
2718         https://bugs.webkit.org/show_bug.cgi?id=138578
2719
2720         Reviewed by Andreas Kling.
2721
2722         Remove unnecessary null check in FrameSelection::nodeWillBeRemoved()
2723         and turn the argument into a reference to make it clear it cannot be
2724         null.
2725
2726         No new tests, no behavior change.
2727
2728         * dom/ContainerNode.cpp:
2729         (WebCore::ContainerNode::willRemoveChild):
2730         * dom/Document.cpp:
2731         (WebCore::Document::nodeChildrenWillBeRemoved):
2732         (WebCore::Document::nodeWillBeRemoved):
2733         * dom/Document.h:
2734         * dom/NodeIterator.cpp:
2735         (WebCore::NodeIterator::nodeWillBeRemoved):
2736         (WebCore::NodeIterator::updateForNodeRemoval):
2737         * dom/NodeIterator.h:
2738         * dom/Range.cpp:
2739         (WebCore::Range::insertNode):
2740         (WebCore::boundaryNodeWillBeRemoved):
2741         (WebCore::Range::nodeWillBeRemoved):
2742         * dom/Range.h:
2743         * dom/RangeBoundaryPoint.h:
2744         (WebCore::RangeBoundaryPoint::setToBeforeChild):
2745         * editing/CompositeEditCommand.cpp:
2746         (WebCore::CompositeEditCommand::updatePositionForNodeRemovalPreservingChildren):
2747         * editing/CompositeEditCommand.h:
2748         * editing/DeleteSelectionCommand.cpp:
2749         (WebCore::DeleteSelectionCommand::removeNode):
2750         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
2751         (WebCore::DeleteSelectionCommand::removeRedundantBlocks):
2752         * editing/FrameSelection.cpp:
2753         (WebCore::removingNodeRemovesPosition):
2754         (WebCore::DragCaretController::nodeWillBeRemoved):
2755         (WebCore::FrameSelection::nodeWillBeRemoved):
2756         (WebCore::FrameSelection::respondToNodeModification):
2757         * editing/FrameSelection.h:
2758         * editing/ReplaceSelectionCommand.cpp:
2759         (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
2760         * editing/htmlediting.cpp:
2761         (WebCore::updatePositionForNodeRemoval):
2762         * editing/htmlediting.h:
2763         * page/EventHandler.cpp:
2764         (WebCore::EventHandler::nodeWillBeRemoved):
2765         * page/EventHandler.h:
2766
2767 2014-11-10  Benjamin Poulain  <bpoulain@apple.com>
2768
2769         Fix the build when CSS Selectors Level 4 is disabled
2770         https://bugs.webkit.org/show_bug.cgi?id=138533
2771
2772         * css/CSSSelector.cpp:
2773         (WebCore::appendArgumentList):
2774         * cssjit/SelectorCompiler.cpp:
2775         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementLinkMatching):
2776
2777 2014-11-10  Chris Dumez  <cdumez@apple.com>
2778
2779         Support throttling of DOMTimers using nested setTimeout() calls
2780         https://bugs.webkit.org/show_bug.cgi?id=138262
2781
2782         Reviewed by Gavin Barraclough.
2783
2784         Extend DOMTimers throttling support to timers that are using nested
2785         setTimeout() calls instead of a setInterval(). To achieve this, this
2786         patch introduces a NestedTimersMap singleton class where nested timers
2787         are added, and for which we potentially update the next firing time,
2788         after the parent timer is done executing.
2789
2790         I have verified this helps on ebay.com for example, which has timers
2791         interacting with non-visible plugins that are scheduled using nested
2792         setTimeout() calls with a frequency of 150 / 200 ms.
2793
2794         This is a second take on r175441, which caused intermittent crashes.
2795         This time, nested timers are removed from the NestedTimersMap when
2796         DOMTimer::removeById() is called. It would be unsafe to use the nested
2797         timer afterwards because we don't hold a strong reference to it and
2798         the ScriptExecutionContext is unref'ing the DOMTimer when
2799         ScriptExecutionContext::removeTimeout() is called from
2800         DOMTimer::removeById().
2801
2802         * page/DOMTimer.cpp:
2803         (WebCore::NestedTimersMap::NestedTimersMap):
2804         (WebCore::NestedTimersMap::~NestedTimersMap):
2805         (WebCore::NestedTimersMap::add):
2806         (WebCore::NestedTimersMap::remove):
2807         (WebCore::NestedTimersMap::begin):
2808         (WebCore::NestedTimersMap::end):
2809         (WebCore::DOMTimer::install):
2810         (WebCore::DOMTimer::removeById):
2811         (WebCore::DOMTimer::fired):
2812
2813 2014-11-10  Jer Noble  <jer.noble@apple.com>
2814
2815         [EME][Mac] Add a systemCode to distinguish when no expired sessions were found in response to a "keyrelease" message.
2816         https://bugs.webkit.org/show_bug.cgi?id=138199
2817
2818         Reviewed by Eric Carlson.
2819
2820         Clients may want to be able to distinguish between cases where expired session data is not supported, and when
2821         those data are supported, but none are found.
2822
2823         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
2824         (WebCore::CDMSessionMediaSourceAVFObjC::generateKeyReleaseMessage):
2825
2826 2014-11-04  Jer Noble  <jer.noble@apple.com>
2827
2828         REGRESSION(r174823): Several tests fail due to canplaythrough firing before tracks are available
2829         https://bugs.webkit.org/show_bug.cgi?id=137882
2830
2831         Reviewed by Eric Carlson.
2832
2833         For HLS streams with only one video, audio, or text track, there will be no media selection group
2834         for that media characteristic. When culling out AVPlayerItemTracks in tracksDidChange(), do not skip
2835         tracks for which there is no matching AVMediaSelectionGroup.
2836
2837         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2838         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2839         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasLoadedMediaSelectionGroups): Refactored.
2840         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia): Call above.
2841         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia): Ditto.
2842         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia): Ditto.
2843         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
2844
2845 2014-11-10  Commit Queue  <commit-queue@webkit.org>
2846
2847         Unreviewed, rolling out r175813.
2848         https://bugs.webkit.org/show_bug.cgi?id=138573
2849
2850         Breaks complex text layout spacing (Requested by litherum on
2851         #webkit).
2852
2853         Reverted changeset:
2854
2855         "[OSX] Some words are placed on top of each other in complex
2856         text layout"
2857         https://bugs.webkit.org/show_bug.cgi?id=138348
2858         http://trac.webkit.org/changeset/175813
2859
2860 2014-11-10  Beth Dakin  <bdakin@apple.com>
2861
2862         Rolling out failed build fix 
2863         http://trac.webkit.org/changeset/175819
2864
2865         * WebCore.exp.in:
2866
2867 2014-11-10  Beth Dakin  <bdakin@apple.com>
2868
2869         Speculative build fix.
2870
2871         * WebCore.exp.in:
2872
2873 2014-11-10  Beth Dakin  <bdakin@apple.com>
2874
2875         Speculative build fix.
2876
2877         * WebCore.exp.in:
2878
2879 2014-11-10  Simon Fraser  <simon.fraser@apple.com>
2880
2881         [iOS WK2] Layers with negative z position disapear behind the page tiles
2882         https://bugs.webkit.org/show_bug.cgi?id=138571
2883         rdar://problem/18873480
2884
2885         Reviewed by Dean Jackson.
2886
2887         Some crufty iOS-only code in RenderLayerBacking::parentForSublayers() caused us to fail
2888         to use the m_childContainmentLayer as the ancestor for descendants, so layers with
2889         negative z position would get depth-sorted behind the tiles.
2890         
2891         Fix by removing that code.
2892         
2893         This should have been detected by compositing/tile-cache-must-flatten.html, but
2894         testing infrastructure suck prevented us from doing so.
2895
2896         * rendering/RenderLayerBacking.cpp:
2897         (WebCore::RenderLayerBacking::parentForSublayers):
2898         * rendering/RenderLayerBacking.h: Just some nullptr cleanup.
2899
2900 2014-11-10  Chris Dumez  <cdumez@apple.com>
2901
2902         Move 'resize' CSS property to the new StyleBuilder
2903         https://bugs.webkit.org/show_bug.cgi?id=138550
2904
2905         Reviewed by Andreas Kling.
2906
2907         No new tests, no behavior change.
2908
2909         Move 'resize' CSS property from DeprecatedStyleBuilder to the new
2910         StyleBuilder by adding a new 'Resize' Converter function.
2911
2912         * css/CSSPropertyNames.in:
2913         * css/DeprecatedStyleBuilder.cpp:
2914         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
2915         (WebCore::ApplyPropertyResize::applyValue): Deleted.
2916         (WebCore::ApplyPropertyResize::createHandler): Deleted.
2917         * css/StyleBuilderConverter.h:
2918         (WebCore::StyleBuilderConverter::convertResize):
2919
2920 2014-11-10  Beth Dakin  <bdakin@apple.com>
2921
2922         Speculative build fix.
2923
2924         * editing/DictionaryLookup.h:
2925         * editing/DictionaryLookup.mm:
2926
2927 2014-11-10  Chris Dumez  <cdumez@apple.com>
2928
2929         Move 'text-indent' CSS property to the new StyleBuilder
2930         https://bugs.webkit.org/show_bug.cgi?id=138547
2931
2932         Reviewed by Andreas Kling.
2933
2934         Move 'text-indent' CSS property from DeprecatedStyleBuilder to the new
2935         StyleBuilder, by using custom code.
2936
2937         No new tests, no behavior change.
2938
2939         * css/CSSPropertyNames.in:
2940         * css/DeprecatedStyleBuilder.cpp:
2941         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
2942         (WebCore::ApplyPropertyTextIndent::applyInheritValue): Deleted.
2943         (WebCore::ApplyPropertyTextIndent::applyInitialValue): Deleted.
2944         (WebCore::ApplyPropertyTextIndent::applyValue): Deleted.
2945         (WebCore::ApplyPropertyTextIndent::createHandler): Deleted.
2946         * css/StyleBuilderConverter.h:
2947         * css/StyleBuilderCustom.h:
2948         (WebCore::StyleBuilderFunctions::applyInheritTextIndent):
2949         (WebCore::StyleBuilderFunctions::applyInitialTextIndent):
2950         (WebCore::StyleBuilderFunctions::applyValueTextIndent):
2951
2952 2014-11-10  Beth Dakin  <bdakin@apple.com>
2953
2954         WK1: Support default actions for read-only text
2955         https://bugs.webkit.org/show_bug.cgi?id=138552
2956         -and corresponding-
2957         rdar://problem/18877483
2958
2959         Reviewed by Tim Horton.
2960
2961         WK1 now needs to do a lot of dictionary lookup operations that it did not 
2962         previously have to handle. So this patch takes a lot of that functionality, which 
2963         was implemented as static functions in WebPageMac for WK2 and moves it into 
2964         WebCore.
2965
2966         * WebCore.exp.in:
2967         * WebCore.xcodeproj/project.pbxproj:
2968         * editing/DictionaryLookup.h: Added.
2969         * editing/DictionaryLookup.mm: Added.
2970         (WebCore::isPositionInRange):
2971         (WebCore::shouldUseSelection):
2972         (WebCore::rangeExpandedAroundPositionByCharacters):
2973         (WebCore::rangeForDictionaryLookupForSelection):
2974         (WebCore::rangeForDictionaryLookupAtHitTestResult):
2975         * platform/mac/WebCoreSystemInterface.h:
2976         * platform/mac/WebCoreSystemInterface.mm:
2977
2978 2014-11-10  Myles C. Maxfield  <mmaxfield@apple.com>
2979
2980         [OSX] Some words are placed on top of each other in complex text layout
2981         https://bugs.webkit.org/show_bug.cgi?id=138348
2982
2983         Reviewed by Simon Fraser.
2984
2985         Some complex text layouts have lots of diacritics being placed all over the place.
2986         CoreText sometimes compensates for this by adjusting the advances of the glyphs
2987         throughout the string to make glyphs appear in the correct place. This means that
2988         we can't naively cache the width of a space character; instead, we must obey
2989         CoreText when it gives us an advance for a space.
2990
2991         Test: fast/text/large-space-width-complex.html
2992
2993         * platform/graphics/mac/ComplexTextController.cpp:
2994         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2995
2996 2014-11-10  Eric Carlson  <eric.carlson@apple.com>
2997
2998         [iOS] wireless playback placeholder UI doesn't always draw
2999         https://bugs.webkit.org/show_bug.cgi?id=138548
3000
3001         While it is important to only listen for the 'webkitplaybacktargetavailabilitychanged' event
3002         when we are displaying inline controls because listening for it increases power consumption,
3003         we should always listen for the 'webkitcurrentplaybacktargetiswirelesschanged' event because
3004         it controls whether or not we draw the placeholder UI which is always visible during wireless
3005         playback.
3006
3007         Reviewed by Brent Fulgham.
3008
3009         * Modules/mediacontrols/mediaControlsiOS.js:
3010         (ControllerIOS.prototype.addVideoListeners): Always listen for the
3011             'webkitcurrentplaybacktargetiswirelesschanged' event.
3012         (ControllerIOS.prototype.removeVideoListeners): Always stop listening for the 
3013             'webkitcurrentplaybacktargetiswirelesschanged' event.
3014         (ControllerIOS.prototype.handleStartPlaybackButtonTouchEnd): Call updateControls so we update 
3015             the type of controls rendered and start listening for wireless target changes immediately.
3016         (ControllerIOS.prototype.setShouldListenForPlaybackTargetAvailabilityEvent): Don't start and stop 
3017             listening for 'webkitcurrentplaybacktargetiswirelesschanged', we should always listen for it.
3018
3019 2014-11-10  Csaba Osztrogonác  <ossy@webkit.org>
3020
3021         Crash in WebCore::Node::getFlag
3022         https://bugs.webkit.org/show_bug.cgi?id=137961
3023
3024         Reviewed by Antti Koivisto.
3025
3026         * editing/ApplyStyleCommand.cpp:
3027         (WebCore::ApplyStyleCommand::applyBlockStyle): Null pointer check added.
3028
3029 2014-11-10  Mihnea Ovidenie  <mihnea@adobe.com>
3030
3031         ASSERTION FAILED: !object || !object->parent()->isRuby() || is<RenderRubyRun>(*object) || (object->isInline() && (object->isBeforeContent() || object->isAfterContent())) || (object->isAnonymous() && ... ) in WebCore::isAnonymousRubyInlineBlock
3032         https://bugs.webkit.org/show_bug.cgi?id=137958
3033
3034         Reviewed by Chris Dumez.
3035
3036         When a ruby element, with block behavior, dynamically changes its style
3037         from multicol to without multicol, we have to remove its special children,
3038         RenderMultiColumnFlowThread and RenderMultiColumnSet, the normal way using
3039         the method in RenderBlockFlow base class. This patch adds both
3040         RenderMultiColumnFlowThread and RenderMultiColumnSet to the list of RenderRuby
3041         children removed normally and adds a new function - isRubyChildForNormalRemove -
3042         to test the condition and use it in the assertion in RenderRuby*::removeChild
3043         method.
3044
3045         Test: fast/multicol/newmulticol/ruby-from-multicol-to-auto.html
3046
3047         * rendering/RenderRuby.cpp:
3048         (WebCore::isRubyChildForNormalRemove):
3049         (WebCore::RenderRubyAsInline::removeChild):
3050         (WebCore::RenderRubyAsBlock::removeChild):
3051
3052 2014-11-09  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3053
3054         [EFL] Remove GamepadDeviceEfl::create()
3055         https://bugs.webkit.org/show_bug.cgi?id=138553
3056
3057         Reviewed by Darin Adler.
3058
3059         As a step to use std::unique_ptr<> and std::make_unique<>, this patch removes GamepadDeviceEfl::create().
3060         Instead we use std::make_unique<>.
3061
3062         No new tests, no behavior changes.
3063
3064         * platform/efl/GamepadsEfl.cpp:
3065         (WebCore::GamepadsEfl::registerDevice):
3066         (WebCore::GamepadDeviceEfl::create): Deleted.
3067         (WebCore::GamepadsEfl::unregisterDevice): Deleted.
3068
3069 2014-11-09  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3070
3071         Remove create() factory function in FooAnimationValue classes
3072         https://bugs.webkit.org/show_bug.cgi?id=138206
3073
3074         Reviewed by Darin Adler.
3075
3076         As a step to use std::unique_ptr and std::make_unique, this patch removes create()
3077         factory function in FooAnimationValue classes. As this changes, FooAnimationValue::create()
3078         are changed to std::make_unique<>.
3079
3080         No new tests, no behavior changes.
3081
3082         * platform/graphics/GraphicsLayer.cpp:
3083         (WebCore::KeyframeValueList::insert):
3084         * platform/graphics/GraphicsLayer.h:
3085         (WebCore::FloatAnimationValue::FloatAnimationValue):
3086         (WebCore::TransformAnimationValue::TransformAnimationValue):
3087         (WebCore::FilterAnimationValue::FilterAnimationValue):
3088         (WebCore::FloatAnimationValue::create): Deleted.
3089         (WebCore::TransformAnimationValue::create): Deleted.
3090         (WebCore::FilterAnimationValue::create): Deleted.
3091         * rendering/RenderLayerBacking.cpp:
3092         (WebCore::RenderLayerBacking::startAnimation):
3093         (WebCore::RenderLayerBacking::startTransition):
3094
3095 2014-11-09  Chris Dumez  <cdumez@apple.com>
3096
3097         Add a more correct way to compare floating point numbers and use it
3098         https://bugs.webkit.org/show_bug.cgi?id=138527
3099
3100         Reviewed by Darin Adler.
3101
3102         Use the new WTF::areEssentuallyEqual() utility function from MathExtras.h
3103         to compare floating-point numbers.
3104
3105         No new tests, no behavior change.
3106
3107         * page/DOMTimer.cpp:
3108         (WebCore::DOMTimer::updateTimerIntervalIfNecessary):
3109         * platform/graphics/FloatQuad.cpp:
3110         (WebCore::FloatQuad::isRectilinear):
3111         * platform/graphics/FloatRoundedRect.cpp:
3112         (WebCore::FloatRoundedRect::Radii::isUniformCornerRadius):
3113         * platform/graphics/FloatSize.h:
3114         (WebCore::areEssentiallyEqual):
3115         (WebCore::withinEpsilon): Deleted.
3116
3117 2014-11-08  Simon Fraser  <simon.fraser@apple.com>
3118
3119         Implement round-rect clipping on video elements
3120         https://bugs.webkit.org/show_bug.cgi?id=138537
3121         rdar://problem/9534399
3122
3123         Reviewed by Darin Adler.
3124         
3125         Support border-radius on video and other layers with composited contents,
3126         by pushing a FloatRoundedRect onto the GraphicsLayer as the contentsClippingRect,
3127         and, on Mac, using layer corner-radius or a CAShapeLayer mask.
3128
3129         Test: compositing/video/video-border-radius.html
3130
3131         * WebCore.exp.in:
3132         * platform/graphics/FloatRoundedRect.cpp:
3133         (WebCore::FloatRoundedRect::Radii::isUniformCornerRadius): Returns true if all
3134         corner radii are the same, and have equal widths and heights.
3135         * platform/graphics/FloatRoundedRect.h: Allow construction without an explicit
3136         rect.
3137         * platform/graphics/GraphicsLayer.cpp:
3138         (WebCore::GraphicsLayer::GraphicsLayer): nullptr goodness.
3139         (showGraphicsLayerTree): Print contents layers when debugging.
3140         * platform/graphics/GraphicsLayer.h:
3141         (WebCore::GraphicsLayer::contentsClippingRect): Make this take a FloatRoundedRect.
3142         (WebCore::GraphicsLayer::setContentsClippingRect):
3143         * platform/graphics/ca/GraphicsLayerCA.cpp:
3144         (WebCore::GraphicsLayerCA::setContentsClippingRect):
3145         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
3146         (WebCore::GraphicsLayerCA::setContentsToImage):
3147         (WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
3148         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
3149         (WebCore::GraphicsLayerCA::updateClippingStrategy): Determines whether we can simply
3150         use corner-radius on the existing contentsClippingLayer, or whether we have to
3151         create a shape layer to use as a mask.
3152         (WebCore::GraphicsLayerCA::updateContentsRects): We have to add/remove the shape layer
3153         based on the rounded rect radii. Calls updateClippingStrategy() on the clipping layer,
3154         and also updates clones accordingly.
3155         (WebCore::dumpInnerLayer):
3156         (WebCore::GraphicsLayerCA::dumpAdditionalProperties): Dump all the inner layers
3157         (requiring on test rebaseline), including the new shape and backdrop layers.
3158         * platform/graphics/ca/GraphicsLayerCA.h:
3159         * platform/graphics/ca/PlatformCALayer.h: Add a new shape layer type.
3160         * platform/graphics/ca/mac/PlatformCALayerMac.h: Support for corner radius and
3161         a rounded rect shape mask.
3162         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
3163         (PlatformCALayerMac::PlatformCALayerMac):
3164         (PlatformCALayerMac::clone):
3165         (PlatformCALayerMac::setMask):
3166         (PlatformCALayerMac::cornerRadius):
3167         (PlatformCALayerMac::setCornerRadius):
3168         (PlatformCALayerMac::shapeRoundedRect):
3169         (PlatformCALayerMac::setShapeRoundedRect):
3170         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3171         (PlatformCALayerWin::cornerRadius):
3172         (PlatformCALayerWin::setCornerRadius):
3173         (PlatformCALayerWin::shapeRoundedRect):
3174         (PlatformCALayerWin::setShapeRoundedRect):
3175         * platform/graphics/ca/win/PlatformCALayerWin.h:
3176         * rendering/RenderLayerBacking.cpp:
3177         (WebCore::RenderLayerBacking::resetContentsRect): Use getRoundedInnerBorderFor() to get
3178         the rounded rect used to clip contents.
3179         (WebCore::RenderLayerBacking::positionOverflowControlsLayers): Push a FloatRoundedRect for the contents clip,
3180         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor): Ditto.
3181         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage): Ditto.
3182         (WebCore::RenderLayerBacking::updateImageContents): Get the rounded rect clip.
3183         * rendering/RenderLayerBacking.h: nullptr.
3184
3185 2014-11-09  Darin Adler  <darin@apple.com>
3186
3187         Fix various cases of incorrect cross-thread capture of non-thread-safe RefCounted
3188         https://bugs.webkit.org/show_bug.cgi?id=138539
3189
3190         Reviewed by Alexey Proskuryakov.
3191
3192         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
3193         (WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect): Use StringCapture
3194         instead of isolatedCopy, to avoid a problem where the original thread does its deref
3195         after passing the string to the other thread.
3196         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage): Ditto.
3197         (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose): Ditto.
3198         (WebCore::WorkerThreadableWebSocketChannel::Bridge::initialize): Ditto.
3199         (WebCore::WorkerThreadableWebSocketChannel::Bridge::connect): Ditto.
3200         (WebCore::WorkerThreadableWebSocketChannel::Bridge::send): Ditto.
3201         (WebCore::WorkerThreadableWebSocketChannel::Bridge::close): Ditto.
3202         (WebCore::WorkerThreadableWebSocketChannel::Bridge::fail): Ditto.
3203
3204         * dom/Document.cpp:
3205         (WebCore::Document::addConsoleMessage): Pass a StringCapture when creating
3206         AddConsoleMessageTask. Same reason as above, but in a different context.
3207         (WebCore::Document::addMessage): Ditto.
3208
3209         * dom/ScriptExecutionContext.h: Changed AddConsoleMessageTask to take and
3210         capture a StringCapture rather than a String, for the same reason as above.
3211
3212         * fileapi/AsyncFileStream.cpp:
3213         (WebCore::AsyncFileStream::write): Use URLCapture instead of trying to use
3214         StringCapture on a URL, since that doesn't preserve the validity flag.
3215
3216         * loader/WorkerThreadableLoader.cpp:
3217         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Use StringCapture.
3218         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFail): Ditto.
3219         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailAccessControlCheck): Ditto.
3220
3221         * platform/URL.h: Added URLCapture.
3222
3223         * platform/network/FormData.cpp:
3224         (WebCore::appendBlobResolved): Remove incorrect pointless code that creates a new URL
3225         from an existing URL with the ParsedURLString constructor.
3226
3227         * workers/DefaultSharedWorkerRepository.cpp: Fixed code that was trying to copy a URL
3228         by copying a string to instead just use URL::copy. The comment claimed that URL::copy
3229         is not thread safe, but that claim is incorrect.
3230         (WebCore::SharedWorkerProxy::postExceptionToWorkerObject): Use StringCapture.
3231         (WebCore::SharedWorkerProxy::postConsoleMessageToWorkerObject): Ditto.
3232         (WebCore::DefaultSharedWorkerRepository::getProxy): Use URL::copy.
3233
3234         * workers/WorkerGlobalScope.cpp:
3235         (WebCore::WorkerGlobalScope::addConsoleMessage): Use StringCapture.
3236         (WebCore::WorkerGlobalScope::addMessage): Ditto.
3237         * workers/WorkerMessagingProxy.cpp:
3238         (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject): Ditto.
3239         (WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject): Ditto.
3240         (WebCore::WorkerMessagingProxy::sendMessageToInspector): Ditto.
3241         (WebCore::WorkerMessagingProxy::postMessageToPageInspector): Ditto.
3242
3243         * workers/WorkerRunLoop.cpp:
3244         (WebCore::WorkerRunLoop::postTaskAndTerminate): Make a Task with make_unique
3245         rather than with Task::create. Removed an extra isolatedCopy, unneeded because
3246         the Task constructor already does an isolatedCopy.
3247         (WebCore::WorkerRunLoop::postTaskForMode): Ditto.
3248         (WebCore::WorkerRunLoop::Task::create): Deleted.
3249
3250         * workers/WorkerRunLoop.h: Removed unneeded create function and explicit
3251         public empty destructor.
3252
3253 2014-11-09  Chris Dumez  <cdumez@apple.com>
3254
3255         Use is<>() / downcast<>() for HTMLCollection subclasses
3256         https://bugs.webkit.org/show_bug.cgi?id=138541
3257
3258         Reviewed by Sam Weinig.
3259
3260         Use is<>() / downcast<>() for HTMLCollection subclasses for
3261         safety and consistency with the rest of the code base.
3262
3263         No new tests, no behavior change.
3264
3265         * bindings/gobject/WebKitDOMPrivate.cpp:
3266         (WebKit::wrap):
3267         * html/HTMLAllCollection.h:
3268         * html/HTMLCollection.cpp:
3269         (WebCore::isMatchingHTMLElement):
3270         (WebCore::isMatchingElement):
3271         * html/HTMLCollection.h:
3272         * html/HTMLFormControlsCollection.h:
3273         * html/HTMLNameCollection.h:
3274         * html/HTMLOptionsCollection.h:
3275         * html/HTMLSelectElement.cpp:
3276         (WebCore::HTMLSelectElement::options):
3277         * html/HTMLTableRowsCollection.h:
3278
3279 2014-11-08  Chris Dumez  <cdumez@apple.com>
3280
3281         Call faster HTMLElement::hasTagName() in HTMLCollection
3282         https://bugs.webkit.org/show_bug.cgi?id=138529
3283
3284         Reviewed by Darin Adler.
3285
3286         Call faster HTMLElement::hasTagName() in HTMLCollection instead of
3287         slower Node::hasTagName() by restructuring the code a bit to
3288         distinguish collection that deal only with HTMLElements from others.
3289
3290         No new tests, no behavior change.
3291
3292         * html/HTMLCollection.cpp:
3293         (WebCore::isMatchingHTMLElement):
3294         (WebCore::isMatchingElement):
3295
3296 2014-11-08  Chris Dumez  <cdumez@apple.com>
3297
3298         Move isEmptyValue() logic from HTMLInputElement to TextFieldInputType
3299         https://bugs.webkit.org/show_bug.cgi?id=138538
3300
3301         Reviewed by Darin Adler.
3302
3303         Move isEmptyValue() logic from HTMLInputElement to TextFieldInputType
3304         as this only makes sense for text field input types.
3305
3306         No new tests, no behavior change.
3307
3308         * html/HTMLInputElement.cpp:
3309         (WebCore::HTMLInputElement::isEmptyValue):
3310         * html/InputType.cpp:
3311         (WebCore::InputType::isEmptyValue):
3312         * html/InputType.h:
3313         * html/TextFieldInputType.cpp:
3314         (WebCore::TextFieldInputType::isEmptyValue):
3315         * html/TextFieldInputType.h:
3316
3317 2014-11-08  Darin Adler  <darin@apple.com>
3318
3319         Replace FileThread class with a single function
3320         https://bugs.webkit.org/show_bug.cgi?id=138282
3321
3322         Reviewed by Alexey Proskuryakov.
3323
3324         * CMakeLists.txt: Removed FileThread.cpp.
3325
3326         * WebCore.vcxproj/WebCore.vcxproj: Removed FileThread.cpp/.h.
3327         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
3328         * WebCore.xcodeproj/project.pbxproj: Ditto.
3329
3330         * bindings/generic/ActiveDOMCallback.cpp: Removed unneeded includes.
3331         * dom/ActiveDOMObject.cpp: Ditto.
3332
3333         * fileapi/AsyncFileStream.cpp:
3334         (WebCore::callOnFileThread): Added. Implements the file thread.
3335         (WebCore::AsyncFileStream::AsyncFileStream): Take a reference to the client.
3336         Make m_internals. Use the destroyed flag instead of trickier techniques to
3337         handle stopping. Once the stream is destroyed, there will be no further callbacks.
3338         (WebCore::AsyncFileStream::~AsyncFileStream): Added assertions and merged in the
3339         stop behavior here. This class no longer requires an explicit stop function.
3340         (WebCore::AsyncFileStream::perform): Added. Helper used for all the operations
3341         below. Takes a function that performs an operation and then returns a client
3342         callback function. Respects the m_stopped boolean on the file thread (so we
3343         don't do extra operations) and on the client thread (so we are guaranteed not
3344         to get any client callbacks even if the file thread was partway through an
3345         operation).
3346         (WebCore::AsyncFileStream::getSize): Changed to use the perform function.
3347         (WebCore::AsyncFileStream::openForRead): Ditto. Also fixed reference count
3348         thread safety issue by capturing a StringCapture rather than a String.
3349         (WebCore::AsyncFileStream::openForWrite): Ditto.
3350         (WebCore::AsyncFileStream::close): Changed to use callOnFileThread.
3351         (WebCore::AsyncFileStream::read): Changed to use the perform function.
3352         (WebCore::AsyncFileStream::write): Ditto. Also fixed reference count
3353         thread safety issue by capturing a StringCapture rather than a URL.
3354         (WebCore::AsyncFileStream::truncate): Ditto.
3355
3356         * fileapi/AsyncFileStream.h: Removed use of RefCounted since we only need
3357         single ownership. Removed the stop function, since we can now stop when
3358         the stream is destroyed since we have single ownership. Made a new Internals
3359         object to handle destruction while operations are still going on the file thread.
3360
3361         * fileapi/FileThread.cpp: Removed.
3362         * fileapi/FileThread.h: Removed.
3363
3364         * loader/ResourceLoader.cpp: Removed unneeded include.
3365
3366         * platform/FileStream.cpp:
3367         (WebCore::FileStream::~FileStream): Merged the stop function in here.
3368
3369         * platform/FileStream.h: Removed use of RefCounted since we only need
3370         single ownership. Removed the empty start function. Removed the stop function,
3371         since we can now stop when the stream is destroyed since we have single ownership.
3372
3373         * platform/FileStreamClient.h: Removed unneeded didStart and didStop.
3374
3375         * platform/network/BlobResourceHandle.cpp:
3376         (WebCore::BlobResourceHandle::BlobResourceHandle): Use make_unique to make the
3377         stream objects instead of custom create functions.
3378         (WebCore::BlobResourceHandle::~BlobResourceHandle): Removed now-unneeded code
3379         to call stop functions. Destroying the objects now takes care of the this, and
3380         that's done by the unique_ptrs.
3381         (WebCore::BlobResourceHandle::cancel): Removed the rest of the code to stop the
3382         m_asyncStream, keeping only the code that sets it to null. That now stops the
3383         stream by destroying it.
3384
3385         * platform/network/BlobResourceHandle.h: Use std::unique_ptr rather than
3386         RefPtr for the file stream objects.
3387
3388         * storage/StorageThread.h: Tweaked formatting of std::function<void()> to
3389         match the format used elsewhere in WebKit.
3390
3391 2014-11-08  Simon Fraser  <simon.fraser@apple.com>
3392
3393         Don't try to schedule a GraphicsLayer flush when propagating changes to replicas inside a flush
3394         https://bugs.webkit.org/show_bug.cgi?id=138532
3395
3396         Reviewed by Dan Bernstein.
3397
3398         When changing masks on replica layers with certain layer configurations, 
3399         it was possible to hit an assertion that a flush was being scheduled when already
3400         flushing, via propagateLayerChangeToReplicas(). Fix by passing the scheduleFlush
3401         flag along.
3402         
3403         Not testable with current GraphicsLayer configurations.
3404
3405         * platform/graphics/ca/GraphicsLayerCA.cpp:
3406         * platform/graphics/ca/GraphicsLayerCA.h:
3407
3408 2014-11-08  Beth Dakin  <bdakin@apple.com>
3409
3410         Implement action menu support for videos
3411         https://bugs.webkit.org/show_bug.cgi?id=138534
3412         -and corresponding-
3413         rdar://problem/18742164
3414
3415         Reviewed by Tim Horton.
3416
3417         Export needed symbols and added not-yet-implemented 
3418         HitTestResult::isMediaThatCanBeDownloaded() so that action menus will work as 
3419         expected once it is implemented.
3420         * WebCore.exp.in:
3421         * rendering/HitTestResult.cpp:
3422         (WebCore::HitTestResult::isMediaThatCanBeDownloaded):
3423         * rendering/HitTestResult.h:
3424
3425 2014-11-08  Chris Dumez  <cdumez@apple.com>
3426
3427         Speed up HTMLInputElement::isEmptyValue()
3428         https://bugs.webkit.org/show_bug.cgi?id=138515
3429
3430         Reviewed by Geoffrey Garen.