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