91c5262bcf8495188ba46999d6974db20b88dfb0
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-11-03  Tim Horton  <timothy_horton@apple.com>
2
3         Use FrameSnapshotting functions in FindController::getFindIndicatorBitmap
4         https://bugs.webkit.org/show_bug.cgi?id=138300
5         <rdar://problem/18855863>
6
7         Reviewed by Simon Fraser.
8
9         * WebCore.exp.in:
10         * page/FrameSnapshotting.cpp:
11         (WebCore::snapshotSelection):
12         Move knowledge that selectionBounds can be empty down to WebCore.
13
14 2014-11-03  Joseph Pecoraro  <pecoraro@apple.com>
15
16         Web Inspector: Show Selector's Specificity
17         https://bugs.webkit.org/show_bug.cgi?id=138189
18
19         Reviewed by Timothy Hatcher.
20
21         Test: inspector/css/selector-specificity.html
22
23         * css/CSSSelector.h:
24         Remove very stale comment. '*' is a starAtom now instead of a special -1 tag.
25         Made the specificity masks public class constants.
26
27         * inspector/InspectorStyleSheet.h:
28         * inspector/InspectorStyleSheet.cpp:
29         (WebCore::InspectorStyle::buildArrayForComputedStyle):
30         (WebCore::InspectorStyle::styleWithProperties):
31         (WebCore::InspectorStyleSheet::buildObjectForStyleSheetInfo):
32         Drive by use release() in some cases to reduce ref count churn.
33
34         (WebCore::buildObjectForSelectorHelper):
35         (WebCore::selectorsFromSource):
36         (WebCore::InspectorStyleSheet::buildObjectForSelector):
37         (WebCore::InspectorStyleSheet::buildObjectForSelectorList):
38         Build CSSSelector objects for SelectorLists.
39
40 2014-11-03  Chris Dumez  <cdumez@apple.com>
41
42         Move -webkit-shape-outside to the new StyleBuilder
43         https://bugs.webkit.org/show_bug.cgi?id=138296
44
45         Reviewed by Zoltan Horvath.
46
47         Move -webkit-shape-outside to the new StyleBuilder, using custom
48         code as it does not always call setShapeOutside().
49
50         No new tests, no behavior change.
51
52         * css/CSSPropertyNames.in:
53         * css/DeprecatedStyleBuilder.cpp:
54         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
55         (WebCore::ApplyPropertyShape::setValue): Deleted.
56         (WebCore::ApplyPropertyShape::applyValue): Deleted.
57         (WebCore::ApplyPropertyShape::createHandler): Deleted.
58         * css/StyleBuilderCustom.h:
59         (WebCore::StyleBuilderFunctions::applyValueWebkitShapeOutside):
60
61 2014-11-03  Alexey Proskuryakov  <ap@apple.com>
62
63         REGRESSION: Using a media element changes window.name
64         https://bugs.webkit.org/show_bug.cgi?id=138278
65         rdar://problem/18704134
66
67         Apply the same fix to mediaControlsBase.js. I do not know who uses this file, but
68         there is no reason to have the bug there.
69
70         * Modules/mediacontrols/mediaControlsBase.js:
71         (Controller.prototype.addVideoListeners):
72         (Controller.prototype.removeVideoListeners):
73         (Controller.prototype.disconnectControls):
74
75 2014-11-03  Andreas Kling  <akling@apple.com>
76
77         RenderLayerModelObject shouldn't need a pre-destructor hook.
78         <https://webkit.org/b/138314>
79
80         Reviewed by Antti Koivisto.
81
82         Move code from the willBeDestroyed() pre-destructor hook to the regular
83         ~RenderLayerModelObject() destructor.
84
85         We just need to unregister the renderer from the FrameView's set of
86         viewport-constrained objects. That doesn't require being able to walk
87         the render tree or call virtuals, which is the main reason you'd use
88         willBeDestroyed().
89
90         * rendering/RenderLayerModelObject.cpp:
91         (WebCore::RenderLayerModelObject::~RenderLayerModelObject):
92         (WebCore::RenderLayerModelObject::willBeDestroyed): Deleted.
93         * rendering/RenderLayerModelObject.h:
94
95 2014-11-03  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
96
97         [EFL] Fix the build if LOG_DISABLED=0 in release mode
98         https://bugs.webkit.org/show_bug.cgi?id=138309
99
100         Reviewed by Chris Dumez.
101
102         * platform/efl/LoggingEfl.cpp:
103
104 2014-11-03  Chris Dumez  <cdumez@apple.com>
105
106         Move 'zoom' CSS property to the new StyleBuilder
107         https://bugs.webkit.org/show_bug.cgi?id=138297
108
109         Reviewed by Antti Koivisto.
110
111         Move 'zoom' CSS property from DeprecatedStyleBuilder to the new
112         StyleBuilder by using custom code as it requires special handling.
113
114         No new tests, no behavior change.
115
116         * css/makeprop.pl:
117         Add support for Custom=All StyleBuilder option to indicate
118         that the property requires custom code to set the initial,
119         inherit and current values.
120
121 2014-11-03  Sungmann Cho  <sungmann.cho@navercorp.com>
122
123         AX: Fix some minor typos related to the word "accessibility".
124         https://bugs.webkit.org/show_bug.cgi?id=138299
125
126         Reviewed by Chris Fleizach.
127
128         No new tests, no behavior change.
129
130         * accessibility/AccessibilityNodeObject.cpp:
131         (WebCore::shouldUseAccessibilityObjectInnerText):
132         (WebCore::AccessibilityNodeObject::textUnderElement):
133         (WebCore::shouldUseAccessiblityObjectInnerText): Deleted.
134         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
135         (getRunAttributesFromAccessibilityObject):
136         (webkitAccessibleTextGetRunAttributes):
137         (getRunAttributesFromAccesibilityObject): Deleted.
138         * page/CaptionUserPreferencesMediaAF.cpp:
139         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore):
140
141 2014-11-02  Chris Dumez  <cdumez@apple.com>
142
143         Move string-typed properties to the new StyleBuilder
144         https://bugs.webkit.org/show_bug.cgi?id=138295
145
146         Reviewed by Antti Koivisto.
147
148         Move string-typed properties to the new StyleBuilder:
149         -webkit-hyphenate-character
150         -webkit-line-grid
151         -webkit-flow-into
152         -webkit-flow-from
153
154         No new tests, no behavior change.
155
156 2014-11-02  Chris Dumez  <cdumez@apple.com>
157
158         Unreviewed, rebaseline bindings tests after r175462.
159
160         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
161         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
162         (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
163         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
164         (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
165         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
166         (WebCore::jsTestEventTargetPrototypeFunctionItem):
167         (WebCore::jsTestEventTargetPrototypeFunctionDispatchEvent):
168         * bindings/scripts/test/JS/JSTestInterface.cpp:
169         (WebCore::JSTestInterfaceConstructor::constructJSTestInterface):
170         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
171         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
172         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
173         (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
174         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
175         (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
176         * bindings/scripts/test/JS/JSTestObj.cpp:
177         (WebCore::JSTestObjConstructor::constructJSTestObj):
178         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
179         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
180         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
181         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
182         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
183         (WebCore::jsTestObjPrototypeFunctionMethodWithSequenceArg):
184         (WebCore::jsTestObjPrototypeFunctionMethodReturningSequence):
185         (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg):
186         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
187         (WebCore::jsTestObjPrototypeFunctionSerializedValue):
188         (WebCore::jsTestObjPrototypeFunctionOptionsObject):
189         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
190         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
191         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
192         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
193         (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArg):
194         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
195         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
196         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
197         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
198         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
199         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6):
200         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
201         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
202         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
203         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
204         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
205         (WebCore::jsTestObjConstructorFunctionClassMethod2):
206         (WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
207         (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
208         (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
209         (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
210         (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
211         (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
212         (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
213         (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence2):
214         (WebCore::jsTestObjPrototypeFunctionConvert1):
215         (WebCore::jsTestObjPrototypeFunctionConvert2):
216         (WebCore::jsTestObjPrototypeFunctionConvert4):
217         (WebCore::jsTestObjPrototypeFunctionConvert5):
218         (WebCore::jsTestObjPrototypeFunctionStrictFunction):
219         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
220         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
221         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
222         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
223         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
224         (WebCore::jsTestObjPrototypeFunctionAny):
225         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
226         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors1):
227         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors2):
228         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors3):
229         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors4):
230         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
231         (WebCore::JSTestTypedefsConstructor::constructJSTestTypedefs):
232         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
233         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
234         (WebCore::jsTestTypedefsPrototypeFunctionNullableArrayArg):
235         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
236         (WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction):
237         (WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction2):
238         (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):
239
240 2014-11-02  Chris Dumez  <cdumez@apple.com>
241
242         Reduce the cost of argumentCount checks in the JS bindings
243         https://bugs.webkit.org/show_bug.cgi?id=138289
244
245         Reviewed by Sam Weinig.
246
247         Slightly reduce the cost of argumentCount checks in the JS bindings by
248         hinting to the compiler that it is UNLIKELY that those methods are
249         called with too few arguments.
250
251         I see a 3% progression on PerformanceTests/DOM/DOMDivWalk.html
252         performance test.
253
254         No new tests, no behavior change.
255
256         * bindings/scripts/CodeGeneratorJS.pm:
257         (GenerateArgumentsCountCheck):
258
259 2014-11-01  Alexey Proskuryakov  <ap@apple.com>
260
261         REGRESSION: Using a media element changes window.name
262         https://bugs.webkit.org/show_bug.cgi?id=138278
263         rdar://problem/18704134
264
265         Reviewed by Jer Noble.
266
267         Test: fast/media/window-name.html
268
269         Use an actual variable for name (and while at it, for "item" as well).
270
271         * Modules/mediacontrols/mediaControlsApple.js:
272         (Controller.prototype.addVideoListeners):
273         (Controller.prototype.removeVideoListeners):
274         (Controller.prototype.disconnectControls):
275
276 2014-11-01  Chris Dumez  <cdumez@apple.com>
277
278         Move "direction" CSS property to the new StyleBuilder
279         https://bugs.webkit.org/show_bug.cgi?id=138288
280
281         Reviewed by Sam Weinig.
282
283         Move "direction" CSS property to the new StyleBuilder by using custom
284         code as it requires special handling to call
285         Document::setDirectionSetOnDocumentElement() when necessary.
286
287         No new tests, no behavior change.
288
289         * css/CSSPropertyNames.in:
290         * css/DeprecatedStyleBuilder.cpp:
291         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
292         (WebCore::ApplyPropertyDirection::applyValue): Deleted.
293         (WebCore::ApplyPropertyDirection::createHandler): Deleted.
294         * css/StyleBuilderCustom.h:
295         (WebCore::StyleBuilderFunctions::applyValueDirection):
296
297 2014-11-01  Sam Weinig  <sam@webkit.org>
298
299         Move the -webkit-transform property to the new StyleBuilder
300         https://bugs.webkit.org/show_bug.cgi?id=138283
301
302         Reviewed by Chris Dumez.
303
304         Move the -webkit-transform property from StyleResolver to the new
305         generated StyleBuilder. Adds a converter for TransformOperations.
306
307         * css/CSSPropertyNames.in:
308         * css/StyleBuilderConverter.h:
309         (WebCore::StyleBuilderConverter::convertTransform):
310         * css/StyleResolver.cpp:
311         (WebCore::StyleResolver::applyProperty):
312         * css/TransformFunctions.cpp:
313         (WebCore::transformsForValue):
314         * css/TransformFunctions.h:
315         * css/WebKitCSSMatrix.cpp:
316         (WebCore::WebKitCSSMatrix::setMatrixValue):
317
318 2014-11-01  Benjamin Poulain  <bpoulain@apple.com>
319
320         Fix the specificity of the extended :not() selector
321         https://bugs.webkit.org/show_bug.cgi?id=138275
322
323         Reviewed by Andreas Kling.
324
325         The current draft says "The specificity of a :not() pseudo-class
326         is the specificity of the most specifc complex selector in its selector list."
327
328         It is still unclear how :not() plays with other new selectors. Until that is clarified,
329         this only handle the simple cases.
330
331         Tests: fast/css/not-self-specificity.html
332                fast/css/not-specificity-1.html
333                fast/css/not-specificity-2.html
334                fast/css/not-specificity-3.html
335                fast/css/not-specificity-4.html
336                fast/css/not-specificity-5.html
337                fast/css/not-specificity-6.html
338
339         * css/CSSSelector.cpp:
340         (WebCore::CSSSelector::specificityForOneSelector):
341
342 2014-10-31  Benjamin Poulain  <bpoulain@apple.com>
343
344         Fix the Debug builds after r175446
345
346         * css/CSSSelector.cpp:
347         (WebCore::CSSSelector::selectorText):
348
349 2014-10-31  Dhi Aurrahman  <diorahman@rockybars.com>
350
351         Add initial parsing functionality of :lang pseudo class in Selectors Level 4.
352         https://bugs.webkit.org/show_bug.cgi?id=138170
353
354         Reviewed by Benjamin Poulain.
355
356         Add initial parsing functionality of :lang pseudo class in Selectors Level 4,
357         as specified in [1].
358
359         It parses comma-separated list of string arguments. Currently, it throws error
360         on arguments with "*" (e.g. :lang(zh, *-hant)).
361
362         Add additional test file fast/selectors/lang-invalid.html along side the 
363         fast/css/css-selector-text.html.
364
365         [1] http://dev.w3.org/csswg/selectors4/#the-lang-pseudo
366
367         Test: fast/selectors/lang-invalid.html
368
369         * css/CSSGrammar.y.in:
370         * css/CSSParser.cpp:
371         (WebCore::CSSParser::detectFunctionTypeToken):
372         * css/CSSParserValues.cpp:
373         (WebCore::CSSParserSelector::setArgumentList):
374         * css/CSSParserValues.h:
375         * css/CSSSelector.cpp:
376         (WebCore::appendArgumentList):
377         (WebCore::CSSSelector::selectorText):
378         (WebCore::CSSSelector::setArgumentList):
379         * css/CSSSelector.h:
380         (WebCore::CSSSelector::argumentList):
381         * css/SelectorChecker.cpp:
382         (WebCore::SelectorChecker::checkOne):
383         * cssjit/SelectorCompiler.cpp:
384         (WebCore::SelectorCompiler::addPseudoClassType):
385
386 2014-10-31  Chris Dumez  <cdumez@apple.com>
387
388         StyleBuilder: Stop using custom code for -webkit-hyphenate-limit-lines
389         https://bugs.webkit.org/show_bug.cgi?id=138270
390
391         Reviewed by Antti Koivisto.
392
393         Stop using custom code for -webkit-hyphenate-limit-lines in the new
394         StyleBuilder. We don't really need to, we can just have a Converter
395         specific to this property.
396
397         No new tests, no behavior change.
398
399         * css/CSSPropertyNames.in:
400         * css/StyleBuilderConverter.h:
401         (WebCore::StyleBuilderConverter::convertWebkitHyphenateLimitLines):
402         * css/StyleBuilderCustom.h:
403         (WebCore::StyleBuilderFunctions::applyValueWebkitHyphenateLimitLines): Deleted.
404
405 2014-10-31  Chris Dumez  <cdumez@apple.com>
406
407         Support throttling of DOMTimers using nested setTimeout() calls
408         https://bugs.webkit.org/show_bug.cgi?id=138262
409
410         Reviewed by Gavin Barraclough.
411
412         Extend DOMTimers throttling support to timers that are using nested
413         setTimeout() calls instead of a setInterval(). To achieve this, this
414         patch introduces a NestedTimersVector singleton class where nested
415         timers are appended, and for which we potentially update the next
416         firing time, after the parent timer is done executing.
417
418         I have verified this helps on cnn.com for example, which has timers
419         interacting with non-visible plugins that are scheduled using nested
420         setTimeout() calls with a frequency of 150 / 200 ms.
421
422         * page/DOMTimer.cpp:
423         (WebCore::NestedTimersVector::NestedTimersVector):
424         (WebCore::NestedTimersVector::~NestedTimersVector):
425         (WebCore::NestedTimersVector::registerTimer):
426         (WebCore::NestedTimersVector::begin):
427         (WebCore::NestedTimersVector::end):
428         (WebCore::DOMTimer::install):
429         (WebCore::DOMTimer::updateThrottlingStateIfNecessary):
430         (WebCore::DOMTimer::fired):
431         * page/DOMTimer.h:
432
433 2014-10-31  Chris Dumez  <cdumez@apple.com>
434
435         Move -webkit-marquee-increment property to the new StyleBuilder
436         https://bugs.webkit.org/show_bug.cgi?id=138208
437
438         Reviewed by Andreas Kling.
439
440         Move -webkit-marquee-increment property from DeprecatedStyleBuilder to
441         the new StyleBuilder so that it is generated from CSSPropertyNames.in.
442         Custom code is used to set the value due to the !length.isUndefined()
443         check before calling setMarqueeIncrement().
444
445         Test: fast/css/webkit-marquee-increment-bad-value.html
446
447         * css/CSSPropertyNames.in:
448         * css/DeprecatedStyleBuilder.cpp:
449         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
450         (WebCore::ApplyPropertyLength::setValue): Deleted.
451         (WebCore::ApplyPropertyLength::applyValue): Deleted.
452         (WebCore::ApplyPropertyLength::createHandler): Deleted.
453         (WebCore::ApplyPropertyMarqueeIncrement::applyValue): Deleted.
454         (WebCore::ApplyPropertyMarqueeIncrement::createHandler): Deleted.
455         * css/StyleBuilderCustom.h:
456         (WebCore::StyleBuilderFunctions::applyValueWebkitMarqueeIncrement):
457
458 2014-10-31  Simon Fraser  <simon.fraser@apple.com>
459
460         Brace cleanup in StyleResolver::adjustRenderStyle()
461         https://bugs.webkit.org/show_bug.cgi?id=138267
462
463         Reviewed by Chris Dumez.
464
465         No braces for single-line clauses.
466
467         * css/StyleResolver.cpp:
468         (WebCore::StyleResolver::adjustRenderStyle):
469
470 2014-10-31  Chris Dumez  <cdumez@apple.com>
471
472         Fix several warnings reported by clang static analyzer in WebCore
473         https://bugs.webkit.org/show_bug.cgi?id=138258
474
475         Reviewed by Joseph Pecoraro.
476
477         Fix several warnings reported by clang static analyzer in WebCore
478         related to variable unnecessary assignments and scope.
479
480         No new tests, no behavior change.
481
482         * dom/ContainerNode.cpp:
483         (WebCore::ContainerNode::getUpperLeftCorner):
484         * html/HTMLMediaElement.cpp:
485         (WebCore::HTMLMediaElement::parseAttribute):
486         * inspector/InspectorStyleTextEditor.cpp:
487         (WebCore::InspectorStyleTextEditor::replaceProperty):
488         * page/ContextMenuController.cpp:
489         (WebCore::openNewWindow):
490         * page/DragController.cpp:
491         (WebCore::createMouseEvent):
492         * rendering/RenderBlockFlow.cpp:
493         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
494         * rendering/svg/SVGInlineTextBox.cpp:
495         (WebCore::SVGInlineTextBox::paintSelectionBackground):
496
497 2014-10-31  Simon Fraser  <simon.fraser@apple.com>
498
499         Whitespace cleanup in Screen.h
500         https://bugs.webkit.org/show_bug.cgi?id=138265
501
502         Reviewed by Chris Dumez.
503
504         No indent for namespaces. Mark 'final'. Fix * placement.
505
506         * page/Screen.h:
507         (WebCore::Screen::create):
508
509 2014-10-31  Simon Fraser  <simon.fraser@apple.com>
510
511         Change the ScrollingThread code to use RunLoop::main().dispatch() rather than callOnMainThread(), which has Obj-C overhead
512         https://bugs.webkit.org/show_bug.cgi?id=138263
513
514         Reviewed by Geoffrey Garen.
515
516         callOnMainThread() uses -performSelector:onMainThread:withObject:waitUntilDone:, so
517         it's slightly more efficient to use RunLoop::main().dispatch().
518
519         * page/scrolling/ThreadedScrollingTree.cpp:
520         (WebCore::ThreadedScrollingTree::invalidate):
521         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
522         (WebCore::ThreadedScrollingTree::handleWheelEventPhase):
523
524 2014-10-31  Benjamin Poulain  <bpoulain@apple.com>
525
526         Pseudo classes with an escaped parenthesis generate invalid rules
527         https://bugs.webkit.org/show_bug.cgi?id=138266
528
529         Reviewed by Antti Koivisto.
530
531         Since the functional pseudo classes are part of the list of PseudoClassAndCompatibilityElement,
532         they could be created by the rule
533              pseudo:
534                  ':' IDENT
535         if the parenthesis is escaped. For example, with ":not\\(", the IDENT would be
536         "not(", CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector would
537         find a pseudo class type of PseudoClassNot, and the action would create an invalid
538         CSSSelector for a :not() without nested selector.
539
540         This patch fixes the issue by detecting the function case in
541         CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector().
542
543         An other solution would be to split PseudoClassAndCompatibilityElement into simple pseudo class
544         and functional pseudo classes. We may do that some day but at the moment it is a lot of work with
545         a little benefit.
546
547         Tests: fast/css/crash-on-incomplete-webkit-any.html
548                fast/css/pseudo-escaped-parenthesis.html
549                fast/selectors/invalid-functional-pseudo-class.html
550
551         * css/CSSParserValues.cpp:
552         (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector):
553
554 2014-10-31  Chris Dumez  <cdumez@apple.com>
555
556         Make CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement() faster
557         https://bugs.webkit.org/show_bug.cgi?id=138227
558
559         Reviewed by Benjamin Poulain.
560
561         Restructure CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement()
562         a bit to do less if checks. The previous implementation was doing 7 if
563         checks no matter the input value. The new implementation does less
564         if checks depending on the input type.
565
566         Also, the isImageControlsRootElement() was showing in the profiles so
567         I updated the condition to only do this virtual function call if the
568         input is an HTMLDivElement (which we can check more efficiently).
569
570         With the change, I see that we're spending about ~26% less time in
571         this method when running speedometer. However, the impact on the
572         overall score is within noise.
573
574         No new tests, no behavior change.
575
576         * css/CSSDefaultStyleSheets.cpp:
577         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
578
579 2014-10-31  Antti Koivisto  <antti@apple.com>
580
581         Fix assertion in CachedResource::addDataBuffer
582
583         * loader/cache/CachedRawResource.cpp:
584         (WebCore::CachedRawResource::addDataBuffer):
585
586             Don't call to base class if buffering mode changed (happens with some special top level document types).
587
588 2014-10-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
589
590         Remove webkit prefix from CSS columns.
591         https://bugs.webkit.org/show_bug.cgi?id=137132.
592
593         Reviewed by Dean Jackson.
594
595         CSS columns properties are ready for un-prefixing. There are still a couple
596         that we haven't implemented, such as the ones starting with "break-", so we're
597         just going to do the ones starting with "column-".  The list of column un-
598         prefixed properties in this change set is:
599             - column-count
600             - column-fill
601             - column-gap
602             - column-progression
603             - column-rule
604             - column-rule-color
605             - column-rule-style
606             - column-rule-width
607             - column-span
608             - column-width
609             - columns
610
611         Tests: fast/multicol/column-box-alignment-rtl.html
612                fast/multicol/multicol-aliases.html
613                imported/w3c/css/multicol/multicol-basic-001.html
614                imported/w3c/css/multicol/multicol-basic-002.html
615                imported/w3c/css/multicol/multicol-basic-003.html
616                imported/w3c/css/multicol/multicol-basic-004.html
617
618         Add new un-prefixed column properties and make the -webkit* ones be aliases
619         to the new ones.
620         * css/CSSPropertyNames.in:
621
622         Use the new enums CSSPropertyColumn* instead of the prefixed ones.
623         * css/CSSComputedStyleDeclaration.cpp:
624         (WebCore::ComputedStyleExtractor::propertyValue):
625         * css/CSSParser.cpp:
626         (WebCore::isColorPropertyID):
627         (WebCore::isValidKeywordPropertyAndValue):
628         (WebCore::isKeywordPropertyID):
629         (WebCore::CSSParser::parseValue):
630         * css/DeprecatedStyleBuilder.cpp:
631         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
632         * css/StyleProperties.cpp:
633         (WebCore::StyleProperties::getPropertyValue):
634         * css/StylePropertyShorthand.cpp:
635         (WebCore::webkitColumnsShorthand):
636         (WebCore::webkitColumnRuleShorthand):
637         (WebCore::shorthandForProperty):
638         (WebCore::matchingShorthandsForLonghand):
639         * css/StyleResolver.cpp:
640         (WebCore::isValidVisitedLinkProperty):
641         (WebCore::StyleResolver::applyProperty):
642         * page/animation/CSSPropertyAnimation.cpp:
643         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
644         * rendering/RenderMultiColumnSet.cpp:
645         (WebCore::RenderMultiColumnSet::paintColumnRules):
646         * rendering/style/RenderStyle.cpp:
647         (WebCore::RenderStyle::colorIncludingFallback):
648
649 2014-10-31  Tim Horton  <timothy_horton@apple.com>
650
651         Remove "Add to iPhoto" from the action menu's sharing menu
652         https://bugs.webkit.org/show_bug.cgi?id=138251
653         <rdar://problem/18837197>
654
655         Reviewed by Anders Carlsson.
656
657         * platform/spi/mac/NSSharingServiceSPI.h:
658         Add 'name' to the NSSharingService SPI header.
659
660 2014-10-31  Akos Kiss  <akiss@inf.u-szeged.hu>
661
662         Fix type clash warning in supports_error rule of CSSGrammar.
663         https://bugs.webkit.org/show_bug.cgi?id=138248
664
665         Reviewed by Antti Koivisto.
666
667         Added explicit actions to supports_error rule in CSSGrammar.y.in since
668         the default actions caused bison to emit type clash warnings.
669
670         No new tests because there is no behavior change.
671
672         * css/CSSGrammar.y.in:
673
674 2014-10-31  Adrian Perez de Castro  <aperez@igalia.com>
675
676         [GTK] Support script message handlers WebKitUserContentManager
677         https://bugs.webkit.org/show_bug.cgi?id=133730
678
679         Reviewed by Carlos Garcia Campos.
680
681         Support user script message handlers in WebKitUserContentManager.
682         This needs building with ENABLE_USER_MESSAGE_HANDLERS, for which
683         an option is added to the CMake build files. The option is disabled
684         globally by default, and the WebKitGTK port enables it. On the API
685         level, two new methods to register and unregister names are provided
686         in the "window.webkit" namespace, and on message reception the
687         "WebKitUserContentManager::script-message-received" signal is
688         emitted, using the registered names as signal detail.
689
690         * CMakeLists.txt: Conditionally add the needed files to the build
691         when the ENABLE_USER_MESSAGE_HANDLERS feature is enabled.
692
693 2014-10-31  Andrzej Badowski  <a.badowski@samsung.com>
694
695         [ATK] Improve AccessibilityTableCell's determineAccessibilityRole function.
696         https://bugs.webkit.org/show_bug.cgi?id=137737
697
698         Reviewed by Chris Fleizach.
699
700         Use of new functions isRowHeaderCell and isColumnHeaderCell (bug 136818)
701         to more accurately determine accessibility role of the table cell.
702
703         Test: accessibility/table-cells-roles.html
704
705         * accessibility/AccessibilityARIAGridCell.cpp:
706         (WebCore::AccessibilityARIAGridCell::rowIndexRange):
707         Change to const.
708         * accessibility/AccessibilityARIAGridCell.h:
709         Change rowIndexRange function to const.
710         * accessibility/AccessibilityTableCell.cpp:
711         (WebCore::AccessibilityTableCell::determineAccessibilityRole):
712         Use of isRowHeaderCell and isColumnHeaderCell to more accurately determine accessibility role (ATK).
713         (WebCore::AccessibilityTableCell::isColumnHeaderCell):
714         Add a case of direct placement a row in the table.
715         (WebCore::AccessibilityTableCell::isRowHeaderCell):
716         Add a case of direct placement a row in the table.
717         (WebCore::AccessibilityTableCell::rowIndexRange):
718         Change to const.
719         * accessibility/AccessibilityTableCell.h:
720         Change rowIndexRange function to const.
721
722 2014-10-30  Darin Adler  <darin@apple.com>
723
724         Eliminate ResourceBuffer and use SharedBuffer directly instead
725         https://bugs.webkit.org/show_bug.cgi?id=138174
726
727         Reviewed by Antti Koivisto.
728
729         Refactoring, with test coverage across many existing tests.
730
731         * CMakeLists.txt: Deleted ResourceBuffer.cpp.
732
733         * WebCore.exp.in: Removed ResourceBuffer-related symbols, and updated symbol
734         for one function that used to take a PassRefPtr but now takes a reference instead.
735
736         * WebCore.vcxproj/WebCore.vcxproj: Deleted ResourceBuffer.cpp/.h.
737         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
738         * WebCore.xcodeproj/project.pbxproj: Deleted ResourceBuffer.mm/.cpp/.h.
739
740         * bindings/objc/DOMUIKitExtensions.mm:
741         (-[DOMHTMLImageElement dataRepresentation:]): Use SharedBuffer directly.
742         * editing/ios/EditorIOS.mm:
743         (WebCore::Editor::writeImageToPasteboard): Ditto.
744         * editing/mac/EditorMac.mm:
745         (WebCore::Editor::writeImageToPasteboard): Ditto.
746
747         * html/ImageDocument.cpp:
748         (WebCore::ImageDocument::updateDuringParsing): Use SharedBuffer directly, and
749         also pass a reference only if non-null rather than passing a pointer.
750         (WebCore::ImageDocument::finishedParsing): Ditto. Added a missing null check.
751
752         * inspector/InspectorPageAgent.cpp:
753         (WebCore::InspectorPageAgent::cachedResourceContent): Use SharedBuffer directly.
754         (WebCore::InspectorPageAgent::mainResourceContent): Ditto.
755         * inspector/InspectorResourceAgent.cpp:
756         (WebCore::InspectorResourceAgent::didFinishLoading): Ditto.
757         (WebCore::InspectorResourceAgent::didFailLoading): Ditto.
758
759         * loader/DocumentLoader.cpp:
760         (WebCore::DocumentLoader::mainResourceData): Use SharedBuffer directly,
761         and use the copy function rather than a hand-written alternative.
762         (WebCore::DocumentLoader::maybeCreateArchive): Ditto.
763         (WebCore::DocumentLoader::mainResource): Ditto.
764         (WebCore::DocumentLoader::subresource): Ditto.
765         (WebCore::DocumentLoader::maybeFinishLoadingMultipartContent): Ditto.
766
767         * loader/DocumentLoader.h: Changed mainResourceData to return a
768         PassRefPtr<SharedBuffer>. Would be better if it returned a SharedBuffer&,
769         but it currently returns a newly created buffer when there is substitute
770         data and can also return null, even though many callers assume it will not!
771
772         * loader/MediaResourceLoader.cpp:
773         (WebCore::MediaResourceLoader::dataReceived): Removed call to unused client
774         function bufferReceived.
775         (WebCore::MediaResourceLoader::notifyFinished): Removed unused buffer
776         argument to client function loadFinished.
777
778         * loader/ResourceBuffer.cpp: Removed.
779         * loader/ResourceBuffer.h: Removed.
780
781         * loader/ResourceLoader.cpp:
782         (WebCore::ResourceLoader::addDataOrBuffer): Use SharedBuffer directly.
783
784         * loader/ResourceLoader.h:
785         (WebCore::ResourceLoader::resourceData): Use SharedBuffer.
786
787         * loader/SubresourceLoader.cpp:
788         (WebCore::SubresourceLoader::didReceiveResponse): Use SharedBuffer.
789         (WebCore::SubresourceLoader::didReceiveDataOrBuffer): Ditto.
790
791         * loader/TextTrackLoader.cpp:
792         (WebCore::TextTrackLoader::processNewCueData): Use SharedBuffer.
793         * loader/appcache/ApplicationCacheGroup.cpp:
794         (WebCore::ApplicationCacheGroup::finishedLoadingMainResource): Ditto.
795         * loader/archive/cf/LegacyWebArchive.cpp:
796         (WebCore::LegacyWebArchive::create): Ditto.
797
798         * loader/cache/CachedCSSStyleSheet.cpp:
799         (WebCore::CachedCSSStyleSheet::finishLoading): Use SharedBuffer.
800         * loader/cache/CachedCSSStyleSheet.h: Ditto.
801         * loader/cache/CachedFont.cpp:
802         (WebCore::CachedFont::finishLoading): Ditto.
803         (WebCore::CachedFont::ensureCustomFontData): Ditto.
804         * loader/cache/CachedFont.h: Ditto.
805
806         * loader/cache/CachedImage.cpp:
807         (WebCore::CachedImage::didAddClient): Use SharedBuffer.
808         (WebCore::CachedImage::didRemoveClient): Ditto.
809         (WebCore::CachedImage::addIncrementalDataBuffer): Ditto. Changed to take
810         a reference rather than a pointer.
811         (WebCore::CachedImage::addDataBuffer): Ditto. Also added call through
812         to base class and changed to take a reference rather than a pointer.
813         (WebCore::CachedImage::addData): Ditto. Also added call through to base class.
814         (WebCore::CachedImage::finishLoading): Ditto.
815         * loader/cache/CachedImage.h: Ditto. Also changed the type of some bit fields
816         to be unsigned instead of unsigend char.
817
818         * loader/cache/CachedRawResource.cpp:
819         (WebCore::CachedRawResource::calculateIncrementalDataChunk): Use SharedBuffer.
820         (WebCore::CachedRawResource::addDataBuffer): Ditto. Changed to take
821         a reference rather than a pointer.
822         (WebCore::CachedRawResource::addData): Ditto.
823         (WebCore::CachedRawResource::finishLoading): Ditto.
824         (WebCore::CachedRawResource::canReuse): Ditto.
825         * loader/cache/CachedRawResource.h: Ditto.
826
827         * loader/cache/CachedResource.cpp:
828         (WebCore::CachedResource::CachedResource): Reordered data members due to change
829         in header.
830         (WebCore::CachedResource::addDataBuffer): Changed argument type.
831         (WebCore::CachedResource::finishLoading): Ditto.
832         (WebCore::CachedResource::didAddClient): Refactored to eliminate one extra hash
833         table lookup by using the return value from the remove function.
834         (WebCore::CachedResource::addClientToSet): Use std::make_unique directly instead
835         of using a function named "schedule" to allocate the callback object.
836         (WebCore::CachedResource::Callback::Callback): Changed function and data member
837         name.
838         (WebCore::CachedResource::Callback::cancel): Ditto.
839         (WebCore::CachedResource::Callback::timerFired): Ditto.
840         (WebCore::CachedResource::tryReplaceEncodedData): Changed to take a SharedBuffer&.
841
842         * loader/cache/CachedResource.h: Changed types to use SharedBuffer. Also made most
843         data members and one function member private instead of protected. Also renamed the
844         CachedResource::CachedResourceCallback function CachedResource::Callback and moved
845         its definition out of the CachedResource class definition.
846
847         * loader/cache/CachedResourceClient.h: Removed unneeded include.
848
849         * loader/cache/CachedSVGDocument.cpp:
850         (WebCore::CachedSVGDocument::finishLoading): Use SharedBuffer.
851
852         * loader/cache/CachedSVGDocument.h: Ditto. Made data members private.
853
854         * loader/cache/CachedScript.cpp:
855         (WebCore::CachedScript::finishLoading): Use SharedBuffer.
856         * loader/cache/CachedScript.h: Ditto. Also fixed indenting and removed unneeded
857         forward declaration.
858
859         * loader/cache/CachedTextTrack.cpp:
860         (WebCore::CachedTextTrack::updateData): Added, so that finishLoading does not
861         call addDataBuffer.
862         (WebCore::CachedTextTrack::addDataBuffer): Take SharedBuffer, call updateData.
863         (WebCore::CachedTextTrack::finishLoading): Ditto.
864         * loader/cache/CachedTextTrack.h: Take out unneeded explicit override of the
865         destructor. Updated for above changes.
866
867         * loader/cache/CachedXSLStyleSheet.cpp:
868         (WebCore::CachedXSLStyleSheet::finishLoading): Updated to use SharedBuffer.
869         * loader/cache/CachedXSLStyleSheet.h: Took out unneeded includes, made everything
870         private rather than protected. Added an explicit virtual constructor so we can
871         compile without knowing how to ref/deref TextResourceDecoder.
872
873         * loader/cf/SubresourceLoaderCF.cpp:
874         (WebCore::SubresourceLoader::didReceiveDataArray): Updated to use SharedBuffer
875         and to call addDataBuffer only if there is a new data buffer.
876
877         * loader/cocoa/DiskCacheMonitorCocoa.h: Use SharedBuffer& instead of PassRefPtr.
878         * loader/cocoa/DiskCacheMonitorCocoa.mm:
879         (WebCore::DiskCacheMonitor::DiskCacheMonitor): Ditto.
880         (WebCore::DiskCacheMonitor::resourceBecameFileBacked): Ditto.
881
882         * loader/icon/IconLoader.cpp:
883         (WebCore::IconLoader::notifyFinished): Use SharedBuffer* instead of
884         RefPtr<ResourceBuffer>.
885
886         * loader/mac/ResourceBuffer.mm: Removed.
887
888         * loader/mac/ResourceLoaderMac.mm:
889         (WebCore::ResourceLoader::didReceiveDataArray): Use SharedBuffer.
890
891         * platform/SharedBuffer.cpp:
892         (WebCore::SharedBuffer::clear): Use a modern for loop.
893         (WebCore::SharedBuffer::copy): Return a PassRef instead of a PassRefPtr, since
894         this never returns null. Use modern for loops.
895         (WebCore::SharedBuffer::copyBufferAndClear): Use a modern for loop.
896
897         * platform/SharedBuffer.h: Changed copy to return PassRef instead of PassRefPtr.
898         Changed tryReplaceContentsWithPlatformBuffer to take a reference rather than
899         a pointer.
900
901         * platform/cf/SharedBufferCF.cpp:
902         (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Take a reference
903         instead of a pointer.
904
905         * platform/graphics/PlatformMediaResourceLoader.h: Removed unused function
906         bufferReceived and unneeded buffer argument from loadFinished. Also marked the
907         constructor explicit.
908
909         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
910         Removed include of ResourceBuffer.h.
911         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
912         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource): Use
913         SharedBuffer directly.
914
915         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
916         (CachedResourceStreamingClient::loadFinished): Updated for change to
917         PlatformMediaResourceLoaderClient.
918
919         * platform/mac/PasteboardMac.mm: Removed include of ResourceBuffer.h.
920
921         * platform/soup/SharedBufferSoup.cpp: Removed unused, unneeded
922         tryReplaceContentsWithPlatformBuffer function.
923
924 2014-10-30  Chris Dumez  <cdumez@apple.com>
925
926         Move border-image-source / -webkit-mask-box-image-source to the new StyleBuilder
927         https://bugs.webkit.org/show_bug.cgi?id=138209
928
929         Reviewed by Andreas Kling.
930
931         Move border-image-source / -webkit-mask-box-image-source CSS properties
932         from DeprecatedStyleBuilder to the new StyleBuilder so that they are
933         now generated from CSSPropertyNames.in.
934
935         No new tests, no behavior change.
936
937         * css/CSSPropertyNames.in:
938         * css/DeprecatedStyleBuilder.cpp:
939         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
940         (WebCore::ApplyPropertyBorderImageSource::applyValue): Deleted.
941         (WebCore::ApplyPropertyBorderImageSource::createHandler): Deleted.
942         * css/StyleBuilderConverter.h:
943         (WebCore::StyleBuilderConverter::convertBorderImageSource):
944
945 2014-10-30  Jer Noble  <jer.noble@apple.com>
946
947         [EME] Add Setting for accessing storage location for MediaKeys data
948         https://bugs.webkit.org/show_bug.cgi?id=138147
949
950         Reviewed by Brady Eidson.
951
952         Allow MediaPlayerPrivateAVFoundationObjC to query for the MediaKeys storage directory
953         by piping that request down from WebKit and WebKit2 into Settings.
954
955         * html/HTMLMediaElement.cpp:
956         (WebCore::HTMLMediaElement::mediaKeysStorageDirectory): Get the location from Settings and
957             append the current origin.
958         * html/HTMLMediaElement.h:
959         * page/Settings.h:
960         (WebCore::Settings::setMediaKeysStorageDirectory): Simple setter.
961         (WebCore::Settings::mediaKeysStorageDirectory): Simple accessor.
962         * platform/graphics/MediaPlayer.cpp:
963         (WebCore::MediaPlayer::mediaKeysStorageDirectory): Pass through to m_client.
964         * platform/graphics/MediaPlayer.h:
965         (WebCore::MediaPlayerClient::mediaPlayerMediaKeysStorageDirectory): Default implementation.
966         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
967         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession): Fetch the location from MediaPlayer.
968         (WebCore::sessionStorageDirectory): Deleted.
969
970 2014-10-30  Dana Burkart  <dburkart@apple.com>
971
972         <rdar://problem/18821260> Prepare for the mysterious future
973
974         Reviewed by Lucas Forschler.
975
976         * Configurations/Base.xcconfig:
977         * Configurations/DebugRelease.xcconfig:
978         * Configurations/FeatureDefines.xcconfig:
979         * Configurations/Version.xcconfig:
980
981 2014-10-30  Simon Fraser  <simon.fraser@apple.com>
982
983         Short-circuit repaints with empty rects
984         https://bugs.webkit.org/show_bug.cgi?id=138234
985
986         Reviewed by Zalan Bujtas.
987         
988         Repaints with an empty rectangle are common enough that it's worth
989         short-circuiting them.
990
991         * rendering/RenderObject.cpp:
992         (WebCore::RenderObject::repaintUsingContainer):
993
994 2014-10-30  Chris Dumez  <cdumez@apple.com>
995
996         Clean up virtual functions in css/
997         https://bugs.webkit.org/show_bug.cgi?id=138230
998
999         Reviewed by Benjamin Poulain.
1000
1001         Clean up virtual functions in css/ by:
1002         - Making virtual functions final when possible
1003         - Making classes final when possible
1004         - Using 'override' when appropriate
1005         - Explicitly marking functions / destructors as virtual when they are
1006           inherently virtual
1007         - Making isXXX() virtual functions private on XXX classes to avoid
1008           unnecessary type checks
1009
1010         No new tests, no behavior change.
1011
1012         * WebCore.exp.in:
1013         * css/CSSBasicShapes.h:
1014         * css/CSSCharsetRule.h:
1015         * css/CSSComputedStyleDeclaration.h:
1016         * css/CSSCrossfadeValue.h:
1017         * css/CSSFilterImageValue.h:
1018         * css/CSSFontFaceLoadEvent.h:
1019         * css/CSSFontFaceRule.h:
1020         * css/CSSFontFaceSource.h:
1021         * css/CSSImportRule.h:
1022         * css/CSSMediaRule.h:
1023         * css/CSSPageRule.h:
1024         * css/CSSRuleList.h:
1025         (WebCore::StaticCSSRuleList::ref): Deleted.
1026         (WebCore::StaticCSSRuleList::styleSheet): Deleted.
1027         (WebCore::StaticCSSRuleList::length): Deleted.
1028         (WebCore::StaticCSSRuleList::item): Deleted.
1029         (WebCore::LiveCSSRuleList::ref): Deleted.
1030         (WebCore::LiveCSSRuleList::deref): Deleted.
1031         (WebCore::LiveCSSRuleList::length): Deleted.
1032         (WebCore::LiveCSSRuleList::item): Deleted.
1033         (WebCore::LiveCSSRuleList::styleSheet): Deleted.
1034         * css/CSSStyleRule.h:
1035         * css/CSSSupportsRule.h:
1036         * css/CSSUnknownRule.h:
1037         * css/FontLoader.h:
1038         * css/PropertySetCSSStyleDeclaration.h:
1039         (WebCore::PropertySetCSSStyleDeclaration::parentElement):
1040         * css/WebKitCSSKeyframeRule.h:
1041         * css/WebKitCSSViewportRule.h:
1042
1043 2014-10-30  Tim Horton  <timothy_horton@apple.com>
1044
1045         Long spins under rangeExpandedAroundPosition on Yahoo Mail
1046         https://bugs.webkit.org/show_bug.cgi?id=138223
1047         <rdar://problem/18819547>
1048
1049         Reviewed by Enrica Casucci.
1050
1051         * WebCore.exp.in:
1052         Export some things.
1053
1054 2014-10-30  Ada Chan  <adachan@apple.com>
1055
1056         The Page's muted setting should not affect the HTMLMediaElement's 'muted' IDL attribute.
1057         https://bugs.webkit.org/show_bug.cgi?id=138215
1058
1059         Reviewed by Eric Carlson.
1060
1061         Add m_muted in Page to keep track of the Page's muted state. Change AudioProducer::setMuted()
1062         to pageMutedStateDidChange(). When that method is called, the AudioProducer is supposed to
1063         update its muted state again taking the Page's muted state into account.
1064
1065         Add HTMLMediaElement::effectiveMuted(), which returns the effective muted state of the
1066         HTMLMediaElement, taking the Page's muted state into account.
1067
1068         Test: media/video-muted-after-setting-page-muted-state.html
1069
1070         * dom/Document.cpp:
1071         (WebCore::Document::pageMutedStateDidChange):
1072         (WebCore::Document::setMuted): Deleted.
1073         * dom/Document.h:
1074         * html/HTMLMediaElement.cpp:
1075         (WebCore::HTMLMediaElement::setMuted):
1076         Set the MediaPlayer's muted state to the result of effectiveMuted() rather than m_muted.
1077         (WebCore::HTMLMediaElement::updateVolume):
1078         Ditto, and also make sure the MediaController's muted state does not override the Page's
1079         muted state.
1080         (WebCore::HTMLMediaElement::updatePlayState):
1081         Set the MediaPlayer's muted state to the result of effectiveMuted() rather than muted().
1082         (WebCore::HTMLMediaElement::pageMutedStateDidChange):
1083         Call updateVolume(), which will update the MediaPlayer's muted state.
1084         (WebCore::HTMLMediaElement::effectiveMuted):
1085         Figure out the muted value taking Page's muted state into account.
1086         * html/HTMLMediaElement.h:
1087         * page/AudioProducer.h:
1088         * page/Page.cpp:
1089         (WebCore::Page::Page):
1090         (WebCore::Page::setMuted):
1091         Update m_muted, and only iterate through the frames' documents to call pageMutedStateDidChange()
1092         if m_muted changes.
1093         * page/Page.h:
1094         (WebCore::Page::isMuted):
1095         * testing/Internals.cpp:
1096         (WebCore::Internals::setPageMuted):
1097         Expose a way to set the Page's muted state in Internals for testing.
1098         * testing/Internals.h:
1099         * testing/Internals.idl:
1100
1101 2014-10-30  Myles C. Maxfield  <mmaxfield@apple.com>
1102
1103         Use references in calculateMinimumPageHeight() for non-optional arguments
1104         https://bugs.webkit.org/show_bug.cgi?id=138231
1105
1106         Reviewed by Dean Jackson.
1107
1108         No new tests because there is no behavior change.
1109
1110         * rendering/RenderBlockFlow.cpp:
1111         (WebCore::calculateMinimumPageHeight):
1112         (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
1113
1114 2014-10-30  Chris Dumez  <cdumez@apple.com>
1115
1116         Move -webkit-border-image / -webkit-mask-box-image to the new StyleBuilder
1117         https://bugs.webkit.org/show_bug.cgi?id=138207
1118
1119         Reviewed by Andreas Kling.
1120
1121         Move -webkit-border-image / -webkit-mask-box-image CSS properties to
1122         the new StyleBuilder so that they are now generated from
1123         CSSPropertyNames.in.
1124
1125         No new tests, no behavior change.
1126
1127         * css/CSSPropertyNames.in:
1128         * css/DeprecatedStyleBuilder.cpp:
1129         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
1130         (WebCore::ApplyPropertyBorderImage::applyValue): Deleted.
1131         (WebCore::ApplyPropertyBorderImage::createHandler): Deleted.
1132         * css/StyleBuilderConverter.h:
1133         (WebCore::StyleBuilderConverter::convertBorderImage):
1134         (WebCore::StyleBuilderConverter::convertBorderMask):
1135
1136 2014-10-30  Chris Dumez  <cdumez@apple.com>
1137
1138         Optimize HTMLVideoElement / HTMLAudioElement type checks a bit
1139         https://bugs.webkit.org/show_bug.cgi?id=138202
1140
1141         Reviewed by Benjamin Poulain.
1142
1143         Optimize HTMLVideoElement / HTMLAudioElement type checks a bit by:
1144         1. Using is<HTMLMediaElement>() instead of
1145            (is<HTMLVideoElement>() || is<HTMLAudioElement>()) if the caller is
1146            interested in both video and audio elements. This is faster because
1147            it ends up doing:
1148                - virtual call to Element::isMediaElement()
1149            instead of
1150                - Node::isHTMLElement() +
1151                  virtual call to HTMLElement::isHTMLUnknownElement() +
1152                  2 * HTMLElement::hasTagName()
1153         2. Updating HTMLVideoElement / HTMLAudioElement type traits
1154            specializations to:
1155            - Avoid doing any virtual function call if the input type is an
1156              HTMLMediaElement (which is common in the code base).
1157            - Speed up check if the input is an Element by doing:
1158                - virtual call to Element::isMediaElement() +
1159                  HTMLElement::hasTagName()
1160              instead of
1161                - Node::isHTMLElement() +
1162                  virtual call to !HTMLElement::isHTMLUnknownElement() +
1163                  HTMLElement::hasTagName()
1164              The speed stays the same if the input is a Node or an HTMLElement.
1165
1166         No new tests, no behavior change.
1167
1168         * css/CSSDefaultStyleSheets.cpp:
1169         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
1170         * dom/make_names.pl:
1171         (defaultTagPropertyHash):
1172         (printTypeHelpers):
1173         * html/HTMLAudioElement.h:
1174         (isType):
1175         * html/HTMLImageLoader.cpp:
1176         * html/HTMLTagNames.in:
1177         * html/HTMLVideoElement.h:
1178         (isType):
1179         * page/ChromeClient.h:
1180
1181 2014-10-30  Myles C. Maxfield  <mmaxfield@apple.com>
1182
1183         Migrate ComplexTextControllerCoreText to use SPI instead of WKSI
1184         https://bugs.webkit.org/show_bug.cgi?id=138228
1185
1186         Reviewed by Simon Fraser.
1187
1188         No new tests because there is no behavior change.
1189
1190         * WebCore.xcodeproj/project.pbxproj:
1191         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1192         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
1193         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1194         * platform/spi/cocoa/CoreTextSPI.h: Added.
1195
1196 2014-10-30  Eric Carlson  <eric.carlson@apple.com>
1197
1198         Add diagnostic logging to track page loads.
1199         https://bugs.webkit.org/show_bug.cgi?id=138205
1200         <rdar://problem/18173017>
1201
1202         Reviewed by Jer Noble.
1203
1204         * loader/FrameLoader.cpp:
1205         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Log page load success or failure.
1206
1207         * page/DiagnosticLoggingKeys.cpp:
1208         (WebCore::DiagnosticLoggingKeys::pageLoadedKey): New.
1209         * page/DiagnosticLoggingKeys.h:
1210
1211 2014-10-24  Philippe Normand  <pnormand@igalia.com>
1212
1213         [GStreamer] Video resolution changes trigger a crash in the TextureMapper
1214         https://bugs.webkit.org/show_bug.cgi?id=137065
1215
1216         Reviewed by Gustavo Noronha Silva.
1217
1218         Switch to GstSample for buffer+caps communication between the
1219         video sink and the player. Using a single object type for this
1220         avoid issues where the caps might not correctly describe the
1221         buffer contents anymore, for example when the video resolution is
1222         changed.
1223
1224         * platform/graphics/gstreamer/ImageGStreamer.h: Use GstSample
1225         instead of GstBuffer+GstCaps.
1226         (WebCore::ImageGStreamer::createImage):
1227         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp: Ditto.
1228         (ImageGStreamer::ImageGStreamer):
1229         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1230         (WebCore::mediaPlayerPrivateRepaintCallback): The repaint signal
1231         now uses a GstSample instead of a GstBuffer.
1232         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
1233         Store the current sample instead of a buffer. Also renamed the
1234         mutex protecting access to the sample.
1235         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Ditto.
1236         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize): Return
1237         early if no sample is available. The caps used to get the video
1238         size are store in the sample.
1239         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Use
1240         GstSample instead of GstBuffer.
1241         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): Ditto.
1242         (WebCore::MediaPlayerPrivateGStreamerBase::paint): Ditto.
1243         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1244         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: Now store a
1245         GstSample internally. Also removed the now useless current-caps property.
1246         (_WebKitVideoSinkPrivate::_WebKitVideoSinkPrivate): Renamed the
1247         mutex protecting access to the sample.
1248         (_WebKitVideoSinkPrivate::~_WebKitVideoSinkPrivate): Ditto.
1249         (webkit_video_sink_init): Disable last-sample in basesink since we
1250         already store one in our sink anyway.
1251         (webkitVideoSinkTimeoutCallback): Switch to GstSample.
1252         (webkitVideoSinkRender): Ditto.
1253         (unlockSampleMutex): Ditto.
1254         (webkitVideoSinkUnlock): Ditto.
1255         (webkitVideoSinkUnlockStop): Ditto.
1256         (webkitVideoSinkStop): Ditto!
1257         (webkitVideoSinkStart): Ditto.
1258         (webkit_video_sink_class_init): Drop current-caps property.
1259         (webkitVideoSinkGetProperty): Deleted.
1260         (unlockBufferMutex): Deleted.
1261
1262 2014-10-30  Carlos Garcia Campos  <cgarcia@igalia.com>
1263
1264         FormDataBuilder should not use Document
1265         https://bugs.webkit.org/show_bug.cgi?id=138172
1266
1267         Reviewed by Alexey Proskuryakov.
1268
1269         It's only used by encodingFromAcceptCharset() to fallback to
1270         document input encoding. That method is only used by
1271         FormSubmission::create(), so it could be moved as a static
1272         function to FormSubmission.cpp.
1273
1274         * loader/FormSubmission.cpp:
1275         (WebCore::encodingFromAcceptCharset):
1276         (WebCore::FormSubmission::create):
1277         * platform/network/FormDataBuilder.cpp:
1278         (WebCore::FormDataBuilder::encodingFromAcceptCharset): Deleted.
1279         * platform/network/FormDataBuilder.h:
1280
1281 2014-10-29  Said Abou-Hallawa  <sabouhallawa@apple.com>
1282
1283         ASSERTION NOT REACHED because RenderStyle::setWordSpacing() does not handle a Length value of type 'Calculated'.
1284         https://bugs.webkit.org/show_bug.cgi?id=138054.
1285
1286         Reviewed by Zalan Bujtas.
1287
1288         A Length of type 'Calculated' can be generated from blending two lengths of
1289         different types. Setting the wordSpacing of the render style should be handled
1290         correctly when the type of the new value is 'Calculated'.
1291
1292         Tests: css3/calculated-word-spacing.html.
1293
1294         Add a case for setting the render style wordSpacing to a <length> of type 'Calculated'.
1295         * rendering/style/RenderStyle.cpp:
1296         (WebCore::RenderStyle::setWordSpacing):
1297
1298 2014-10-29  Hunseop Jeong  <hs85.jeong@samsung.com>
1299
1300         [CoordinatedGraphics] Use modern for-loops
1301         https://bugs.webkit.org/show_bug.cgi?id=138168
1302
1303         Reviewed by Andreas Kling.
1304
1305         No new tests as there is no change in functionality.
1306
1307         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp: Use a modern for loop.
1308         (WebCore::CompositingCoordinator::renderNextFrame):
1309         (WebCore::CompositingCoordinator::paintToSurface):
1310         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: Use a modern for loop.
1311         (WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
1312         (WebCore::CoordinatedGraphicsLayer::flushCompositingState):
1313         (WebCore::CoordinatedGraphicsLayer::syncChildren):
1314         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
1315         (WebCore::CoordinatedGraphicsLayer::findFirstDescendantWithContentsRecursively):
1316         (WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
1317         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: Use a modern for loop.
1318         (WebCore::CoordinatedImageBacking::updateVisibilityIfNeeded):
1319
1320 2014-10-29  Chris Dumez  <cdumez@apple.com>
1321
1322         Final-ize more of TextFieldInputType's virtual functions
1323         https://bugs.webkit.org/show_bug.cgi?id=138194
1324
1325         Reviewed by Andreas Kling.
1326
1327         Final-ize more of TextFieldInputType's virtual functions for
1328         performance.
1329
1330         No new tests, no behavior change.
1331
1332         * html/TextFieldInputType.h:
1333
1334 2014-10-29  Chris Dumez  <cdumez@apple.com>
1335
1336         Clean up virtual functions in inspector/
1337         https://bugs.webkit.org/show_bug.cgi?id=138190
1338
1339         Reviewed by Andreas Kling.
1340
1341         Clean up virtual functions in inspector/ by:
1342         - Making virtual functions final when possible
1343         - Making classes final when possible
1344         - Explicitly marking functions / destructors as virtual when they are
1345           inherently virtual
1346         - Making isXXX() virtual functions private on XXX classes to avoid
1347           unnecessary type checks
1348
1349         No new tests, no behavior change.
1350
1351         * inspector/InspectorApplicationCacheAgent.h:
1352         (WebCore::InspectorApplicationCacheAgent::~InspectorApplicationCacheAgent): Deleted.
1353         * inspector/InspectorCSSAgent.h:
1354         * inspector/InspectorDOMAgent.h:
1355         * inspector/InspectorDOMDebuggerAgent.h:
1356         * inspector/InspectorDOMStorageAgent.h:
1357         * inspector/InspectorDatabaseAgent.h:
1358         * inspector/InspectorFrontendClientLocal.h:
1359         * inspector/InspectorIndexedDBAgent.h:
1360         * inspector/InspectorLayerTreeAgent.h:
1361         * inspector/InspectorPageAgent.h:
1362         * inspector/InspectorReplayAgent.h:
1363         * inspector/InspectorResourceAgent.h:
1364         * inspector/InspectorStyleSheet.h:
1365         * inspector/InspectorTimelineAgent.h:
1366         * inspector/InspectorWorkerAgent.h:
1367         * inspector/PageConsoleAgent.h:
1368         * inspector/WorkerInspectorController.h:
1369
1370 2014-10-29  Andreas Kling  <akling@apple.com>
1371
1372         Generalize dirtying of parent's line boxes when taking a renderer out of tree.
1373         <https://webkit.org/b/138152>
1374
1375         Reviewed by Antti Koivisto.
1376
1377         Instead of calling dirtyLinesFromChangedChild() when certain types of renderers
1378         are about to be destroyed, always do this in RenderElement::willBeRemovedFromTree().
1379
1380         This is part of an effort to make render tree teardown less incomprehensible.
1381
1382         We still don't bother at all if we're in the process of tearing down the entire
1383         render tree, since that would be a waste of time.
1384
1385         * rendering/RenderBlock.cpp:
1386         (WebCore::RenderBlock::willBeDestroyed):
1387         * rendering/RenderBlockFlow.cpp:
1388         (WebCore::RenderBlockFlow::willBeDestroyed):
1389         * rendering/RenderElement.cpp:
1390         (WebCore::RenderElement::willBeRemovedFromTree):
1391         * rendering/RenderInline.cpp:
1392         (WebCore::RenderInline::willBeDestroyed):
1393         * rendering/RenderReplaced.cpp:
1394         (WebCore::RenderReplaced::willBeDestroyed): Deleted.
1395         * rendering/RenderReplaced.h:
1396
1397 2014-10-28  Ada Chan  <adachan@apple.com>
1398
1399         Implement WKPageSetMuted(bool).
1400         https://bugs.webkit.org/show_bug.cgi?id=138158
1401
1402         Reviewed by Anders Carlsson.
1403
1404         * WebCore.exp.in:
1405         * page/Page.h:
1406
1407 2014-10-29  Alexey Proskuryakov  <ap@apple.com>
1408
1409         Notify Settings object when its Page object goes away.
1410         https://bugs.webkit.org/show_bug.cgi?id=138183
1411         rdar://problem/18786900
1412
1413         Reviewed by Andreas Kling.
1414
1415         I could not make a test for this issue.
1416
1417         * page/Page.cpp:
1418         (WebCore::Page::~Page):
1419         * page/Settings.cpp:
1420         (WebCore::setImageLoadingSettings):
1421         (WebCore::Settings::Settings):
1422         (WebCore::Settings::setTextAutosizingEnabled):
1423         (WebCore::Settings::setTextAutosizingWindowSizeOverride):
1424         (WebCore::Settings::setTextAutosizingFontScaleFactor):
1425         (WebCore::Settings::setMediaTypeOverride):
1426         (WebCore::Settings::setScriptEnabled):
1427         (WebCore::Settings::setUserStyleSheetLocation):
1428         (WebCore::Settings::setMinDOMTimerInterval):
1429         (WebCore::Settings::minDOMTimerInterval):
1430         (WebCore::Settings::domTimerAlignmentInterval):
1431         (WebCore::Settings::setUsesPageCache):
1432         (WebCore::Settings::setScreenFontSubstitutionEnabled):
1433         (WebCore::Settings::setFontRenderingMode):
1434         (WebCore::Settings::setDNSPrefetchingEnabled):
1435         (WebCore::Settings::setStorageBlockingPolicy):
1436         (WebCore::Settings::setBackgroundShouldExtendBeyondPage):
1437         (WebCore::Settings::setScrollingPerformanceLoggingEnabled):
1438         (WebCore::Settings::setHiddenPageDOMTimerThrottlingEnabled):
1439         (WebCore::Settings::setHiddenPageCSSAnimationSuspensionEnabled):
1440         (WebCore::Settings::setFontFallbackPrefersPictographs):
1441         * page/Settings.h:
1442         (WebCore::Settings::pageDestroyed):
1443
1444 2014-10-29  Zalan Bujtas  <zalan@apple.com>
1445
1446         Remove invalid float from RootInlineBox.
1447         https://bugs.webkit.org/show_bug.cgi?id=137707
1448
1449         Reviewed by Antti Koivisto.
1450
1451         In certain cases, floating boxes get attached to the last (root) inline box.
1452         When this particular floating box gets destroyed, it also needs to be detached
1453         from the last inline box.
1454         1. Introduce RootInlineBox::removeFloat() (vs. RootInlineBox::appendFloat())
1455         2. Ensure that it is called when the floating box is being destroyed.
1456
1457         Test: fast/inline/crash-when-inline-box-has-invalid-float.html
1458
1459         * rendering/RenderBlockFlow.cpp:
1460         (WebCore::RenderBlockFlow::removeFloatingObject):
1461         (WebCore::RenderBlockFlow::markAllDescendantsWithFloatsForLayout): During style recalc, while
1462         tearing down the render tree, we can get to a state where a block element has both inline and block children.
1463         It happens when the style change on an element makes sibling anonymous block wrappers detached.
1464         In that case the markAllDescendantsWithFloatsForLayout() call does not get propagated down on the
1465         block child elements as we return early at the childrenInline() check.
1466         * rendering/RootInlineBox.h:
1467         (WebCore::RootInlineBox::removeFloat):
1468
1469 2014-10-29  Antti Koivisto  <antti@apple.com>
1470
1471         Factor cache validity computation functions out of CachedResource
1472         https://bugs.webkit.org/show_bug.cgi?id=138156
1473
1474         Reviewed by Andreas Kling.
1475
1476         These can be used to implement cache logic on WebKit level.
1477
1478         * CMakeLists.txt:
1479         * WebCore.exp.in:
1480         * WebCore.vcxproj/WebCore.vcxproj:
1481         * WebCore.xcodeproj/project.pbxproj:
1482         * loader/CacheValidation.cpp: Added.
1483         (WebCore::computeCurrentAge):
1484         (WebCore::computeFreshnessLifetimeForHTTPFamily):
1485         (WebCore::updateRedirectChainStatus):
1486         (WebCore::redirectChainAllowsReuse):
1487         * loader/CacheValidation.h: Added.
1488         (WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
1489         * loader/cache/CachedResource.cpp:
1490         (WebCore::updateResponseHeadersAfterRevalidation):
1491         (WebCore::CachedResource::CachedResource):
1492         (WebCore::CachedResource::isExpired):
1493         (WebCore::CachedResource::freshnessLifetime):
1494         (WebCore::CachedResource::willSendRequest):
1495         (WebCore::CachedResource::updateResponseAfterRevalidation):
1496         (WebCore::CachedResource::redirectChainAllowsReuse):
1497         (WebCore::currentAge): Deleted.
1498         * loader/cache/CachedResource.h:
1499
1500 2014-10-29  Antti Koivisto  <antti@apple.com>
1501
1502         Unreviewed, rolling out r175342.
1503
1504         a file ended up in a wrong directory
1505
1506         Reverted changeset:
1507
1508         "Factor cache validity computation functions out of
1509         CachedResource"
1510         https://bugs.webkit.org/show_bug.cgi?id=138156
1511         http://trac.webkit.org/changeset/175342
1512
1513 2014-10-29  Antti Koivisto  <antti@apple.com>
1514
1515         Factor cache validity computation functions out of CachedResource
1516         https://bugs.webkit.org/show_bug.cgi?id=138156
1517
1518         Reviewed by Andreas Kling.
1519
1520         These can be used to implement cache logic on WebKit level.
1521
1522         * CMakeLists.txt:
1523         * WebCore.exp.in:
1524         * WebCore.vcxproj/WebCore.vcxproj:
1525         * WebCore.xcodeproj/project.pbxproj:
1526         * loader/CacheValidation.cpp: Added.
1527         (WebCore::computeCurrentAge):
1528         (WebCore::computeFreshnessLifetimeForHTTPFamily):
1529         (WebCore::updateRedirectChainStatus):
1530         (WebCore::redirectChainAllowsReuse):
1531         * loader/CacheValidation.h: Added.
1532         (WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
1533         * loader/cache/CachedResource.cpp:
1534         (WebCore::updateResponseHeadersAfterRevalidation):
1535         (WebCore::CachedResource::CachedResource):
1536         (WebCore::CachedResource::isExpired):
1537         (WebCore::CachedResource::freshnessLifetime):
1538         (WebCore::CachedResource::willSendRequest):
1539         (WebCore::CachedResource::updateResponseAfterRevalidation):
1540         (WebCore::CachedResource::redirectChainAllowsReuse):
1541         (WebCore::currentAge): Deleted.
1542         * loader/cache/CachedResource.h:
1543
1544 2014-10-28  Ada Chan  <adachan@apple.com>
1545
1546         Add API to mute/unmute a page.
1547         https://bugs.webkit.org/show_bug.cgi?id=138150
1548
1549         Reviewed by Eric Carlson.
1550
1551         No new tests, since it's difficult to test whether the Page has indeed been muted.
1552
1553         * dom/Document.cpp:
1554         (WebCore::Document::setMuted):
1555         Go through each AudioProducer and call setMuted() on it.
1556         * dom/Document.h:
1557         * page/AudioProducer.h:
1558         Add setMuted(bool). HTMLMediaElement, the only derived class of AudioProducer so far,
1559         has already implemented setMuted().
1560         * page/Page.cpp:
1561         (WebCore::Page::setMuted):
1562         Go through all its frames and call setMuted() on each frame's Document.
1563         * page/Page.h:
1564
1565 2014-10-29  Tim Horton  <timothy_horton@apple.com>
1566
1567         Implement action menus for data detected items
1568         https://bugs.webkit.org/show_bug.cgi?id=138178
1569         <rdar://problem/18709436>
1570
1571         Reviewed by Anders Carlsson.
1572
1573         * WebCore.exp.in:
1574         Export a symbol from Position that we need.
1575
1576         * WebCore.xcodeproj/project.pbxproj:
1577         * platform/spi/mac/DataDetectorsSPI.h:
1578         Add a combined SPI header for all of the random bits of DataDetectors that we use.
1579
1580 2014-10-29  Jer Noble  <jer.noble@apple.com>
1581
1582         [EME] NULL-dereference crash in MediaKeys::setMediaElement().
1583         https://bugs.webkit.org/show_bug.cgi?id=138177
1584
1585         Reviewed by Eric Carlson.
1586
1587         NULL-check m_mediaElement->player() before using. It may have been cleared if the HTMLMediaElement
1588         has previously had stop() called.
1589
1590         * Modules/encryptedmedia/MediaKeys.cpp:
1591         (WebCore::MediaKeys::setMediaElement):
1592
1593 2014-10-29  Jer Noble  <jer.noble@apple.com>
1594
1595         [EME] MediaKeySession resources persist across page reloads
1596         https://bugs.webkit.org/show_bug.cgi?id=138176
1597
1598         Reviewed by Eric Carlson.
1599
1600         MediaKeySession is an ActiveDOMObject, so when told to stop() by our execution context,
1601         close() the session, releasing all our resources.
1602
1603         * Modules/encryptedmedia/MediaKeySession.h:
1604
1605 2014-10-29  Jer Noble  <jer.noble@apple.com>
1606
1607         [EME][Mac] MediaKeySession type "keyrelease" is ignored.
1608         https://bugs.webkit.org/show_bug.cgi?id=138175
1609
1610         Reviewed by Eric Carlson.
1611
1612         To indicate that they would like to recevie expired session confirmation messages, clients
1613         will create a MediaKeySession with a type parameter of "keyrelease". The code which validates
1614         this type needs to be updated to recognize "keyrelease" as a valid type.
1615
1616         Also, the code which validates update() requests needs to allow updates containing the string
1617         "acknowledged", so that clients can request the confirmation messages be discarded.
1618
1619         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
1620         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType):
1621         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1622         (WebCore::CDMSessionMediaSourceAVFObjC::update):
1623
1624 2014-10-28  Ada Chan  <adachan@apple.com>
1625
1626         Remove MediaSessionClient::hasMediaCharacteristics() and MediaSessionClient::mediaStateDidChange().
1627         https://bugs.webkit.org/show_bug.cgi?id=138153
1628
1629         Reviewed by Jer Noble.
1630
1631         After http://trac.webkit.org/changeset/175273, Document no longer keeps a set of MediaSessions
1632         and it doesn't need to query each MediaSession for its characteristics and play state.
1633         MediaSessionClient::hasMediaCharacteristics() is no longer needed and MediaSessionClient::mediaStateDidChange()
1634         can be removed if HTMLMediaElement calls Document::updateIsPlayingAudio() after m_playing has changed.
1635
1636         No new tests, no behavior change.
1637
1638         * html/HTMLMediaElement.cpp:
1639         (WebCore::HTMLMediaElement::updatePlayState):
1640         Call setPlaying() rather than setting m_playing directly.
1641         (WebCore::HTMLMediaElement::setPlaying):
1642         Update m_playing. If it has changed, call Document::updateIsPlayingAudio().
1643         (WebCore::HTMLMediaElement::setPausedInternal):
1644         Call setPlaying() rather than setting m_playing directly.
1645         (WebCore::HTMLMediaElement::isPlayingAudio):
1646         Call isPlaying() directly rather than checking the MediaSession's state.
1647         * html/HTMLMediaElement.h:
1648         * platform/audio/MediaSession.cpp:
1649         (WebCore::MediaSession::setState):
1650         MediaSessionClient::mediaStateDidChange() has been removed.
1651         (WebCore::MediaSession::hasMediaCharacteristics): Deleted.
1652         * platform/audio/MediaSession.h:
1653         (WebCore::MediaSessionClient::mediaStateDidChange): Deleted.
1654         * platform/audio/ios/AudioDestinationIOS.h:
1655         * platform/audio/mac/AudioDestinationMac.h:
1656
1657 2014-10-29  Chris Dumez  <cdumez@apple.com>
1658
1659         Clean up virtual functions in html/
1660         https://bugs.webkit.org/show_bug.cgi?id=138166
1661
1662         Reviewed by Andreas Kling.
1663
1664         Clean up virtual functions in html/ by:
1665         - Making virtual functions final when possible
1666         - Making classes final when possible
1667         - Using 'override' when appropriate
1668         - Explicitly marking functions / destructors as virtual when they are
1669           inherently virtual
1670         - Dropping virtual destructors when the class does not have subclasses
1671           and mark the class as final, to get rid of unnecessary vtables
1672         - Making isXXX() virtual functions private on XXX classes to avoid
1673           unnecessary type checks
1674         - De-virtualizing some functions that do not need to be virtual
1675         - Dropping final for virtual functions in classes already marked as
1676           final
1677
1678         No new tests, no behavior change.
1679
1680         * html/ButtonInputType.h:
1681         * html/CheckboxInputType.h:
1682         * html/ColorInputType.h:
1683         * html/DOMSettableTokenList.h:
1684         * html/DateInputType.h:
1685         * html/DateTimeInputType.h:
1686         * html/DateTimeLocalInputType.h:
1687         * html/EmailInputType.h:
1688         * html/FTPDirectoryDocument.h:
1689         * html/HTMLAnchorElement.h:
1690         * html/HTMLDetailsElement.cpp:
1691         * html/HTMLFormControlElement.h:
1692         * html/HTMLFormControlsCollection.h:
1693         * html/HTMLFrameElement.h:
1694         * html/HTMLFrameElementBase.h:
1695         * html/HTMLFrameOwnerElement.h:
1696         * html/HTMLInputElement.h:
1697         * html/HTMLMarqueeElement.h:
1698         * html/HTMLMediaElement.h:
1699         * html/HTMLMediaSession.h:
1700         (WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring): Deleted.
1701         * html/HTMLMeterElement.h:
1702         * html/HTMLNameCollection.h:
1703         * html/HTMLObjectElement.h:
1704         * html/HTMLOptGroupElement.h:
1705         * html/HTMLOptionElement.h:
1706         * html/HTMLSpanElement.h:
1707         * html/HTMLStyleElement.h:
1708         * html/HTMLSummaryElement.cpp:
1709         * html/HTMLSummaryElement.h:
1710         * html/HTMLUnknownElement.h:
1711         * html/HTMLVideoElement.h:
1712         * html/HiddenInputType.h:
1713         * html/ImageInputType.h:
1714         * html/MediaKeyEvent.h:
1715         * html/MonthInputType.h:
1716         * html/NumberInputType.h:
1717         * html/PasswordInputType.h:
1718         * html/PublicURLManager.h:
1719         * html/RadioInputType.h:
1720         * html/ResetInputType.h:
1721         * html/SubmitInputType.h:
1722         * html/TelephoneInputType.h:
1723         * html/TextInputType.h:
1724         * html/TimeInputType.h:
1725         * html/URLInputType.h:
1726         * html/WeekInputType.h:
1727         * html/canvas/ANGLEInstancedArrays.h:
1728         * html/canvas/CanvasRenderingContext2D.h:
1729         * html/canvas/DOMPath.h:
1730         * html/canvas/EXTShaderTextureLOD.h:
1731         * html/canvas/EXTTextureFilterAnisotropic.h:
1732         * html/canvas/OESElementIndexUint.h:
1733         * html/canvas/OESStandardDerivatives.h:
1734         * html/canvas/OESTextureFloat.h:
1735         * html/canvas/OESTextureFloatLinear.h:
1736         * html/canvas/OESTextureHalfFloat.h:
1737         * html/canvas/OESTextureHalfFloatLinear.h:
1738         * html/canvas/OESVertexArrayObject.h:
1739         * html/canvas/WebGLBuffer.h:
1740         * html/canvas/WebGLCompressedTextureATC.h:
1741         * html/canvas/WebGLCompressedTexturePVRTC.h:
1742         * html/canvas/WebGLCompressedTextureS3TC.h:
1743         * html/canvas/WebGLContextAttributes.h:
1744         * html/canvas/WebGLContextEvent.h:
1745         * html/canvas/WebGLDebugRendererInfo.h:
1746         * html/canvas/WebGLDebugShaders.h:
1747         * html/canvas/WebGLDepthTexture.h:
1748         * html/canvas/WebGLDrawBuffers.h:
1749         * html/canvas/WebGLFramebuffer.h:
1750         (WebCore::WebGLFramebuffer::isFramebuffer): Deleted.
1751         * html/canvas/WebGLLoseContext.h:
1752         * html/canvas/WebGLProgram.h:
1753         * html/canvas/WebGLRenderbuffer.h:
1754         * html/canvas/WebGLRenderingContext.h:
1755         * html/canvas/WebGLShader.h:
1756         * html/canvas/WebGLSharedObject.h:
1757         (WebCore::WebGLSharedObject::isFramebuffer): Deleted.
1758         * html/canvas/WebGLTexture.h:
1759         * html/canvas/WebGLVertexArrayObjectOES.h:
1760         (WebCore::WebGLVertexArrayObjectOES::isVertexArray): Deleted.
1761         * html/shadow/ImageControlsRootElement.h:
1762         * html/shadow/InsertionPoint.h:
1763         * html/shadow/MediaControlElementTypes.h:
1764         * html/shadow/MediaControlElements.h:
1765         * html/shadow/MediaControls.h:
1766         * html/shadow/MediaControlsApple.h:
1767         * html/shadow/SpinButtonElement.h:
1768         * html/track/AudioTrack.h:
1769         * html/track/AudioTrackList.h:
1770         * html/track/DataCue.h:
1771         (WebCore::DataCue::cueType): Deleted.
1772         * html/track/InbandDataTextTrack.h:
1773         * html/track/InbandGenericTextTrack.h:
1774         * html/track/InbandTextTrack.h:
1775         * html/track/InbandWebVTTTextTrack.h:
1776         * html/track/LoadableTextTrack.h:
1777         * html/track/TextTrackList.h:
1778         * html/track/TrackEvent.h:
1779         * html/track/VTTCue.h:
1780         (WebCore::VTTCueBox::setFontSizeFromCaptionUserPrefs):
1781         * html/track/VTTRegion.h:
1782         * html/track/VideoTrack.h:
1783         * html/track/VideoTrackList.h:
1784         * html/track/WebVTTParser.h:
1785         (WebCore::WebVTTCueData::~WebVTTCueData): Deleted.
1786
1787 2014-10-17  Sergio Villar Senin  <svillar@igalia.com>
1788
1789         ASSERTION FAILED: growthShare > 0 in WebCore::RenderGrid::distributeSpaceToTracks
1790         https://bugs.webkit.org/show_bug.cgi?id=137772
1791
1792         Reviewed by Andreas Kling.
1793
1794         We're hitting the ASSERTION because if the number of tracks an
1795         item spans does greatly exceed the available logical space, then
1796         the result of the division availableLogicalSpace/numberOfTracks is
1797         truncated to 0. So the ASSERTION was theoretically right because
1798         the result has to be always >0 (as the dividend > 0) but the fact
1799         that the result is a LayoutUnit forces us to accept 0 as a valid
1800         outcome of the operation.
1801
1802         Test: fast/css-grid-layout/tracks-number-greatly-exceeding-available-size-crash.html
1803
1804         * rendering/RenderGrid.cpp:
1805         (WebCore::RenderGrid::distributeSpaceToTracks):
1806
1807 2014-10-29  Chris Dumez  <cdumez@apple.com>
1808
1809         Crash in CachedRawResource::canReuse() when reloading http://dnd.wizards.com/dungeons-and-dragons/story
1810         https://bugs.webkit.org/show_bug.cgi?id=138164
1811
1812         Reviewed by Andreas Kling.
1813
1814         This patch fixes a crash when reloading the following URL:
1815         http://dnd.wizards.com/dungeons-and-dragons/story
1816
1817         We were crashing in CachedRawResource::canReuse() because header.key
1818         would sometimes be a null String and we would call
1819         HashMap::get(nullString).
1820
1821         The real issue was that header.key was null in the first place, which
1822         means that even though the HTTPHeaderMap iterator is valid, it->key
1823         is a null String, which should never happen. There was a bug in the
1824         HTTPHeaderMapConstIterator() constructor that would cause the
1825         iterator key/value pair to not get initialized if the HTTPHeaderMap
1826         contained *only* uncommon HTTP headers. This patch updates the
1827         constructor so that we fall back to updating the key/value from the
1828         uncommon header map, if we failed to initialized from the common
1829         header map (because it was empty).
1830
1831         Test: http/tests/cache/xhr-uncommon-header.html
1832
1833         * platform/network/HTTPHeaderMap.h:
1834         (WebCore::HTTPHeaderMap::HTTPHeaderMapConstIterator::HTTPHeaderMapConstIterator):
1835
1836 2014-10-28  Benjamin Poulain  <benjamin@webkit.org>
1837
1838         CSS4 Selectors: Add the pseudo class :any-link
1839         https://bugs.webkit.org/show_bug.cgi?id=138128
1840
1841         Reviewed by Andreas Kling.
1842
1843         Defined here: http://dev.w3.org/csswg/selectors4/#the-any-link-pseudo
1844
1845         After :link and :-webkit-any-link were fixed, :any-link behaves
1846         exactly like :-webkit-any-link. All I had left to do here was
1847         make them synonyms when evaluating selectors.
1848
1849         Defined here: http://dev.w3.org/csswg/selectors4/#the-any-link-pseudo
1850
1851         After :link and :-webkit-any-link were fixed, :any-link behaves
1852         exactly like :-webkit-any-link. All I had left to do here was
1853         make them synonyms when evaluating selectors.
1854
1855         Tests: fast/selectors/any-link-basics-2.html
1856                fast/selectors/any-link-basics.html
1857                fast/selectors/any-link-styling.html
1858
1859         * css/CSSSelector.cpp:
1860         (WebCore::CSSSelector::selectorText):
1861         * css/CSSSelector.h:
1862         * css/RuleSet.cpp:
1863         (WebCore::RuleSet::addRule):
1864         * css/SelectorChecker.cpp:
1865         (WebCore::SelectorChecker::checkOne):
1866         * css/SelectorChecker.h:
1867         (WebCore::SelectorChecker::isCommonPseudoClassSelector):
1868         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
1869         * cssjit/SelectorCompiler.cpp:
1870         (WebCore::SelectorCompiler::addPseudoClassType):
1871         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementLinkMatching):
1872
1873 2014-10-28  Jer Noble  <jer.noble@apple.com>
1874
1875         [EME][Mac] Adopt new AVStreamSession API: pass storageDirectoryAtURL at creation-time
1876         https://bugs.webkit.org/show_bug.cgi?id=138149
1877
1878         Reviewed by Brent Fulgham.
1879
1880         AVStreamSession now requires its storage location at creation-time, rather than post-creation. This requires
1881         us to move storage location code from CDMSessionMediaSourceAVFObjC to MediaPlayerPrivateMediaSourceAVFObjC.
1882
1883         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1884         (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]): Renamed.
1885         (WebCore::CDMSessionMediaSourceAVFObjC::update):
1886         (WebCore::sessionStorageDirectory): Deleted.
1887         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1888         (WebCore::sessionStorageDirectory):
1889         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
1890
1891 2014-10-28  Geoffrey Garen  <ggaren@apple.com>
1892
1893         All networking crashes on Mac 32bit
1894         https://bugs.webkit.org/show_bug.cgi?id=138157
1895
1896         Reviewed by Andy Estes.
1897
1898         NEFilterSource content filtering is not available on 32bit, so
1899         soft-linking fails at runtime. The simplest solution is just to disable
1900         it at compile time.
1901
1902         * platform/ContentFilter.h:
1903
1904 2014-10-28  Jeremy Jones  <jeremyj@apple.com>
1905
1906         Add optimized fullscreen mode.
1907         https://bugs.webkit.org/show_bug.cgi?id=138044
1908
1909         Reviewed by Jer Noble.
1910
1911         Enable different types of fullscreen video behavior.
1912         Add an enum parameter to enterVideoFullscreenForVideoElement for alternate types of fullscreen.
1913         Add gesture for alternate fullscreen.
1914
1915         * Modules/mediacontrols/MediaControlsHost.cpp:
1916         (WebCore::MediaControlsHost::enterFullscreenOptimized): added
1917         * Modules/mediacontrols/MediaControlsHost.h: added enterFullscreenOptimized
1918         * Modules/mediacontrols/MediaControlsHost.idl: added enterFullscreenOptimized
1919         * Modules/mediacontrols/mediaControlsiOS.js:
1920         (ControllerIOS.prototype.handleBaseGestureChange): recognize alternate gesture
1921         * WebCore.exp.in: added parameter to setupFullscreen
1922         * html/HTMLMediaElement.cpp:
1923         (WebCore::HTMLMediaElement::removedFrom) : replace m_isInVideoFullscreen with m_videoFullscreenType
1924         (WebCore::HTMLMediaElement::stop) : ditto
1925         (WebCore::HTMLMediaElement::isFullscreen) : ditto
1926         (WebCore::HTMLMediaElement::enterFullscreen): add parameter to enterVideoFullscreenForVideoElement
1927         (WebCore::HTMLMediaElement::exitFullscreen): replace m_isInVideoFullscreen with m_videoFullscreenType
1928         (WebCore::HTMLMediaElement::enterFullscreenOptimized): added
1929         * html/HTMLMediaElement.h: added enterFullscreenOptimized
1930         * page/ChromeClient.h:
1931         (WebCore::ChromeClient::enterVideoFullscreenForVideoElement): added parameter
1932         * platform/ios/WebVideoFullscreenControllerAVKit.h: add parameter
1933         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1934         (-[WebVideoFullscreenController enterFullscreen:type:]): add parameter
1935         (-[WebVideoFullscreenController enterFullscreen:]): Deleted.
1936         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: reorder protected to after public
1937         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1938         (-[WebAVPlayerController player]): this stub is now required
1939         (-[WebAVPlayerController layoutSublayersOfLayer:]): this is a better way to update video frames
1940         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): implement optimized fullscreen interface 
1941         (WebVideoFullscreenInterfaceAVKit::enterFullscreen): ditto
1942         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): ditto
1943         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): ditto
1944
1945 2014-10-28  Chris Dumez  <cdumez@apple.com>
1946
1947         Clean up virtual functions in accessibility/
1948         https://bugs.webkit.org/show_bug.cgi?id=138148
1949
1950         Reviewed by Chris Fleizach.
1951
1952         Clean up virtual functions in accessibility/ by:
1953         - Marking classes as final when suitable
1954         - Marking virtual functions as final when suitable
1955         - Dropping final on virtual functions in classes that are already final
1956         - Make isXXX() virtual type checking functions in XXX classes to avoid
1957           useless type checks
1958
1959         No new tests, no behavior change.
1960
1961         * accessibility/AccessibilityARIAGrid.h:
1962         * accessibility/AccessibilityARIAGridCell.h:
1963         * accessibility/AccessibilityARIAGridRow.h:
1964         * accessibility/AccessibilityImageMapLink.h:
1965         * accessibility/AccessibilityList.h:
1966         * accessibility/AccessibilityListBox.h:
1967         * accessibility/AccessibilityListBoxOption.h:
1968         * accessibility/AccessibilityMediaControls.h:
1969         * accessibility/AccessibilityMenuList.h:
1970         * accessibility/AccessibilityMenuListOption.h:
1971         * accessibility/AccessibilityMenuListPopup.h:
1972         * accessibility/AccessibilityMockObject.h:
1973         (WebCore::AccessibilityMockObject::setParent):
1974         * accessibility/AccessibilityNodeObject.h:
1975         * accessibility/AccessibilityProgressIndicator.h:
1976         * accessibility/AccessibilityRenderObject.h:
1977         * accessibility/AccessibilitySVGRoot.h:
1978         * accessibility/AccessibilityScrollView.h:
1979         * accessibility/AccessibilityScrollbar.h:
1980         * accessibility/AccessibilitySearchFieldButtons.h:
1981         * accessibility/AccessibilitySlider.h:
1982         * accessibility/AccessibilitySpinButton.h:
1983         * accessibility/AccessibilityTable.h:
1984         * accessibility/AccessibilityTableCell.h:
1985         * accessibility/AccessibilityTableColumn.h:
1986         * accessibility/AccessibilityTableHeaderContainer.h:
1987         * accessibility/AccessibilityTableRow.h:
1988
1989 2014-10-24  Jeffrey Pfau  <jpfau@apple.com>
1990
1991         FrameProgressTracker expects Page to not have detached
1992         https://bugs.webkit.org/show_bug.cgi?id=138061
1993
1994         Reviewed by Alexey Proskuryakov.
1995
1996         In some cases, a Page may be detached from a Frame before its
1997         FrameLoader is torn down, causing FrameProgressTracker's destructor
1998         to hit a null pointer.
1999
2000         No new tests; it is impossible to reliably simulate the null pointer
2001         case without intrusive code changes.
2002
2003         * loader/FrameLoader.cpp:
2004         (WebCore::FrameLoader::FrameProgressTracker::~FrameProgressTracker):
2005
2006 2014-10-27  Ada Chan  <adachan@apple.com>
2007
2008         Introduce a new abstract class called AudioProducer and keep a set of AudioProducers
2009         rather than the active MediaSessions in Document
2010         https://bugs.webkit.org/show_bug.cgi?id=138107
2011
2012         Reviewed by Eric Carlson.
2013
2014         No new tests, no behavior change.
2015
2016         * WebCore.xcodeproj/project.pbxproj:
2017         Add AudioProducer.h to the project.
2018         * dom/Document.cpp:
2019         (WebCore::Document::addAudioProducer):
2020         (WebCore::Document::removeAudioProducer):
2021         (WebCore::Document::updateIsPlayingAudio):
2022         Go through the set of AudioProducers and see if any is playing audio.
2023         Now that this method no longer refers to MediaSessions directly, this code
2024         does not need to be guarded by #if ENABLE(VIDEO).
2025         (WebCore::Document::registerMediaSession): Deleted.
2026         (WebCore::Document::unregisterMediaSession): Deleted.
2027         * dom/Document.h:
2028         * html/HTMLMediaElement.cpp:
2029         (WebCore::HTMLMediaElement::registerWithDocument):
2030         (WebCore::HTMLMediaElement::unregisterWithDocument):
2031         (WebCore::HTMLMediaElement::isPlayingAudio):
2032         Return whether this element is playing audio.
2033         * html/HTMLMediaElement.h:
2034         * page/AudioProducer.h: Added.
2035         (WebCore::AudioProducer::~AudioProducer):
2036         * page/Page.cpp:
2037         (WebCore::Page::updateIsPlayingAudio):
2038         This is no longer guarded with #if ENABLE(VIDEO) since the Document methods it calls
2039         are no longer guarded.
2040         * page/Page.h:
2041
2042 2014-10-28  Chris Dumez  <cdumez@apple.com>
2043
2044         Unreviewed comment fix from r175267.
2045
2046         Fix namespace name in comment.
2047
2048         * css/StyleBuilderCustom.h:
2049
2050 2014-10-28  Jer Noble  <jer.noble@apple.com>
2051
2052         REGRESSION(r171593) [Mac] Media controls create a large (and unnecessary) backing store
2053         https://bugs.webkit.org/show_bug.cgi?id=137757
2054
2055         Reviewed by Eric Carlson.
2056
2057         In r171593, a <div> was added to the media controls which is only ever used on iOS. Instead
2058         of creating and adding this <div> in mediaControlsApple.js (which is used on OS X), this 
2059         <div> should be created and added in mediaControlsiOS.js, which requires overloading
2060         Controller.addControls.
2061
2062         * Modules/mediacontrols/mediaControlsApple.css:
2063         (audio::-webkit-media-controls-panel.hidden): Drive-by fix: allow the panel itself to be hidden.
2064         (video::-webkit-media-controls-panel-composited-parent): Deleted.
2065         * Modules/mediacontrols/mediaControlsApple.js:
2066         (Controller.prototype.createControls): Remove the composited parent.
2067         (Controller.prototype.addControls): Ditto.
2068         * Modules/mediacontrols/mediaControlsiOS.js:
2069         (ControllerIOS.prototype.createControls): Create the composited parent.
2070         (ControllerIOS.prototype.addControls): Copied from (previous) apple.js.
2071
2072 2014-10-28  Chris Dumez  <cdumez@apple.com>
2073
2074         Move "Number" CSS properties to the new StyleBuilder
2075         https://bugs.webkit.org/show_bug.cgi?id=138125
2076
2077         Reviewed by Antti Koivisto.
2078
2079         Move "Number" CSS properties from DeprecatedStyleBuilder to the new
2080         StyleBuilder:
2081         -webkit-hyphenate-limit-after
2082         -webkit-hyphenate-limit-before
2083         -webkit-shape-image-threshold
2084         -webkit-hyphenate-limit-lines
2085
2086         They are now generated from CSSPropertyNames.in
2087
2088         For -webkit-hyphenate-limit-lines, I used custom code instead of
2089         the Number converter as it required special handling for the id
2090         value. This patch thus adds support for [Custom=Value] to
2091         CSSPropertyNames.in and the custom code goes into
2092         css/StyleBuilderCustom.h.
2093
2094         No new tests, no behavior change.
2095
2096         * WebCore.xcodeproj/project.pbxproj:
2097         * css/CSSPropertyNames.in:
2098         * css/DeprecatedStyleBuilder.cpp:
2099         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
2100         (WebCore::ApplyPropertyNumber::setValue): Deleted.
2101         (WebCore::ApplyPropertyNumber::applyValue): Deleted.
2102         (WebCore::ApplyPropertyNumber::createHandler): Deleted.
2103         * css/StyleBuilderConverter.h:
2104         (WebCore::StyleBuilderConverter::convertNumber):
2105         * css/StyleBuilderCustom.h: Added.
2106         (WebCore::StyleBuilderFunctions::applyValueWebkitHyphenateLimitLines):
2107         * css/makeprop.pl:
2108
2109 2014-10-28  Zan Dobersek  <zdobersek@igalia.com>
2110
2111         [WebCore] Remove uses of WTF::bind() in the Media Stream module
2112         https://bugs.webkit.org/show_bug.cgi?id=138016
2113
2114         Reviewed by Eric Carlson.
2115
2116         Replace uses of WTF::bind() in the Media Stream module with C++11 lambdas.
2117         Internal helper methods are removed in favor of inlining the code directly
2118         into the lambdas. Range-based for-loops are deployed where appropriate.
2119
2120         * Modules/mediastream/MediaStreamTrack.cpp:
2121         (WebCore::MediaStreamTrack::scheduleEventDispatch):
2122         (WebCore::MediaStreamTrack::dispatchQueuedEvents): Deleted.
2123         * Modules/mediastream/MediaStreamTrack.h:
2124         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
2125         (WebCore::MediaStreamTrackSourcesRequest::didCompleteRequest):
2126         (WebCore::MediaStreamTrackSourcesRequest::callCompletionHandler): Deleted.
2127         * Modules/mediastream/MediaStreamTrackSourcesRequest.h:
2128         * Modules/mediastream/UserMediaRequest.cpp:
2129         (WebCore::UserMediaRequest::constraintsValidated):
2130         (WebCore::UserMediaRequest::userMediaAccessGranted):
2131         (WebCore::UserMediaRequest::didCreateStream):
2132         (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError):
2133         (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError):
2134         (WebCore::UserMediaRequest::requestPermission): Deleted.
2135         (WebCore::UserMediaRequest::createMediaStream): Deleted.
2136         (WebCore::UserMediaRequest::callSuccessHandler): Deleted.
2137         (WebCore::UserMediaRequest::callErrorHandler): Deleted.
2138         * Modules/mediastream/UserMediaRequest.h:
2139
2140 2014-10-28  Pascal Jacquemart  <p.jacquemart@samsung.com>
2141
2142         Abandoned select option is reselected when shift selecting new options
2143         https://bugs.webkit.org/show_bug.cgi?id=137553
2144
2145         Reviewed by Ryosuke Niwa.
2146
2147         Previous active selection is wrongly recorded by HTMLSelectElement after selecting a new item using
2148         typeAhead. Fixed by clearing previously selected options before starting a new active selection.
2149
2150         Test: fast/forms/listbox-selection-after-typeahead.html
2151
2152         * html/HTMLSelectElement.cpp:
2153         (WebCore::HTMLSelectElement::selectOption): Code re-ordering
2154
2155 2014-10-28  Milan Crha  <mcrha@redhat.com>
2156
2157         Use constants from wtf/MathExtras.h
2158         https://bugs.webkit.org/show_bug.cgi?id=137967
2159
2160         Reviewed by Darin Adler.
2161
2162         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2163         (WebCore::rotateCairoMatrixForVerticalOrientation):
2164         * rendering/mathml/RenderMathMLMenclose.cpp:
2165         (WebCore::RenderMathMLMenclose::computePreferredLogicalWidths):
2166         (WebCore::RenderMathMLMenclose::updateLogicalHeight):
2167         * rendering/mathml/RenderMathMLOperator.cpp:
2168         (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator):
2169
2170 2014-10-28  David Hyatt  <hyatt@apple.com>
2171
2172         Selection gap painting is ugly for ruby bases.
2173         https://bugs.webkit.org/show_bug.cgi?id=138136
2174
2175         Reviewed by Dean Jackson.
2176
2177         * rendering/RenderBlock.cpp:
2178         (WebCore::RenderBlock::selectionGaps):
2179         For ruby bases don't fill to the end of the block (in the block direction),
2180         since ideographic baselines push that end below the text baseline.
2181
2182         (WebCore::RenderBlock::blockSelectionGaps):
2183         * rendering/RenderBlockFlow.cpp:
2184         Skip ruby bases for block selection gap filling.
2185
2186 2014-10-28  Zalan Bujtas  <zalan@apple.com>
2187
2188         Speed up line parsing for simple line layout.
2189         https://bugs.webkit.org/show_bug.cgi?id=137275
2190
2191         Reviewed by Antti Koivisto.
2192         
2193         This patch speeds up the line parsing for simple line layout by
2194         reducing the number of text measurement calls.
2195         The parsing logic hasn't changed. We simply walk over
2196         the whitespace/non-whitespace fragments and measure them to
2197         figure out whether they fit.
2198         The performance gain mainly comes from the more efficient line wrapping
2199         so that we don't re-measure the fragment when it is pushed to
2200         the next line.
2201
2202         No change in behaviour. (except the empty line-break run removal.)
2203
2204         * rendering/SimpleLineLayout.cpp:
2205         (WebCore::SimpleLineLayout::skipWhitespace): 
2206         (WebCore::SimpleLineLayout::computeLineLeft):
2207         (WebCore::SimpleLineLayout::TextFragment::TextFragment):
2208         (WebCore::SimpleLineLayout::TextFragment::isEmpty):
2209         (WebCore::SimpleLineLayout::LineState::LineState):
2210         (WebCore::SimpleLineLayout::LineState::commitAndCreateRun): adds uncommitted text to the line and creates a run out of it. 
2211         (WebCore::SimpleLineLayout::LineState::addUncommitted): appends fragment to the uncommitted text. 
2212         (WebCore::SimpleLineLayout::LineState::addUncommittedWhitespace): appends whitespace to the uncommitted text.
2213         (WebCore::SimpleLineLayout::LineState::jumpTo): moves line's current position without committing text. 
2214         (WebCore::SimpleLineLayout::LineState::width): current width of the line including committed and uncommitted text.
2215         (WebCore::SimpleLineLayout::LineState::fits): checks if committed + uncommitted text fits the line. 
2216         (WebCore::SimpleLineLayout::LineState::removeCommittedTrailingWhitespace): 
2217         (WebCore::SimpleLineLayout::removeTrailingWhitespace): post processing the trailing whitespace.
2218         (WebCore::SimpleLineLayout::initializeLine):
2219         (WebCore::SimpleLineLayout::splitFragmentToFitLine): breaks the fragments into 2 so that the first (sub)fragment fits the line.
2220         (WebCore::SimpleLineLayout::nextFragment): returns the next valid fragment of the text.
2221         (WebCore::SimpleLineLayout::createLineRuns): creates runs for the current line and returns when we can't fit more text on the line.
2222         (WebCore::SimpleLineLayout::updateLineConstrains): updates left/right constrains for the current line.
2223         (WebCore::SimpleLineLayout::createTextRuns): creates runs for the whole text.
2224         (WebCore::SimpleLineLayout::isWhitespace): Deleted.
2225         (WebCore::SimpleLineLayout::skipWhitespaces): Deleted.
2226         (WebCore::SimpleLineLayout::measureWord): Deleted.
2227         (WebCore::SimpleLineLayout::adjustRunOffsets): Deleted.
2228         * rendering/SimpleLineLayout.h:
2229         (WebCore::SimpleLineLayout::Run::Run):
2230
2231 2014-10-28  Alexey Proskuryakov  <ap@apple.com>
2232
2233         Windows build fix.
2234
2235         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2236         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use a WTF function
2237         for getting current process ID instead of getpid().
2238
2239 2014-10-28  Mihnea Ovidenie  <mihnea@adobe.com>
2240
2241         Clean up subtrees selection code
2242         https://bugs.webkit.org/show_bug.cgi?id=137740
2243
2244         Reviewed by David Hyatt.
2245
2246         Clean up subtrees selection code. Add a new class SelectionSubtreeData
2247         that keeps only the selection data. Have SelectionSubtreeRoot class embed
2248         a SelectionSubtreeData member and keep the business logic methods.
2249         No functionality changed therefore no new layout tests.
2250
2251         * rendering/RenderObject.cpp:
2252         (WebCore::RenderObject::selectionStartEnd):
2253         * rendering/RenderView.cpp:
2254         (WebCore::RenderView::subtreeSelectionBounds):
2255         (WebCore::RenderView::repaintSubtreeSelection):
2256         (WebCore::RenderView::setSelection):
2257         (WebCore::RenderView::splitSelectionBetweenSubtrees):
2258         (WebCore::RenderView::updateSelectionForSubtrees):
2259         (WebCore::RenderView::clearSubtreeSelection):
2260         (WebCore::RenderView::applySubtreeSelection):
2261         * rendering/RenderView.h:
2262         * rendering/SelectionSubtreeRoot.cpp:
2263         (WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot):
2264         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
2265         * rendering/SelectionSubtreeRoot.h:
2266         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::SelectionSubtreeData):
2267         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStart):
2268         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartPos):
2269         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEnd):
2270         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEndPos):
2271         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionClear):
2272         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartEndPositions):
2273         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionStart):
2274         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionStartPos):
2275         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionEnd):
2276         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionEndPos):
2277         (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::clearSelection):
2278         (WebCore::SelectionSubtreeRoot::selectionData):
2279         (WebCore::SelectionSubtreeRoot::setSelectionData):
2280         (WebCore::SelectionSubtreeRoot::selectionStart): Deleted.
2281         (WebCore::SelectionSubtreeRoot::selectionStartPos): Deleted.
2282         (WebCore::SelectionSubtreeRoot::selectionEnd): Deleted.
2283         (WebCore::SelectionSubtreeRoot::selectionEndPos): Deleted.
2284         (WebCore::SelectionSubtreeRoot::selectionStartEndPositions): Deleted.
2285         (WebCore::SelectionSubtreeRoot::selectionClear): Deleted.
2286         (WebCore::SelectionSubtreeRoot::setSelectionStart): Deleted.
2287         (WebCore::SelectionSubtreeRoot::setSelectionStartPos): Deleted.
2288         (WebCore::SelectionSubtreeRoot::setSelectionEnd): Deleted.
2289         (WebCore::SelectionSubtreeRoot::setSelectionEndPos): Deleted.
2290
2291 2014-10-28  Jer Noble  <jer.noble@apple.com>
2292
2293         [Mac] The first software paint of a <video> element takes up to 2.5s.
2294         https://bugs.webkit.org/show_bug.cgi?id=137754
2295
2296         Reviewed by Brent Fulgham.
2297
2298         It turns out that, if you pass nil to -[AVPlayerItemVideoOutput initWithPixelBufferAttributes:]
2299         the video output will not attempt to conform the resulting pixel buffers into a particular format.
2300         This means that adding such a video output to a AVPlayerItem should have almost no performance
2301         penalty, since the video output does not even copy the resulting buffers, but rather just retains
2302         and returns the ones from the AVPlayerLayer.
2303
2304         Create and attach an AVPlayerItemVideoOutput after creating the AVPlayerItem, but before attaching
2305         the player item to the AVPlayer. This eliminates the reconfigure step which occurs after attaching
2306         a video output to an already attached AVPlayerItem.
2307
2308         When creating the AVPlayerItemVideoOutput, pass in `nil` for the pixelBufferAttributes parameter.
2309
2310         Instead of blocking waiting for output from the AVPlayerItemVideoOutput during creating, block and
2311         whait when asked to paint with the video output.
2312
2313         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2314         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
2315         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
2316         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
2317
2318 2014-10-28  Chris Dumez  <cdumez@apple.com>
2319
2320         Move text decoration CSS properties to the new StyleBuilder
2321         https://bugs.webkit.org/show_bug.cgi?id=138121
2322
2323         Reviewed by Antti Koivisto.
2324
2325         Move text decoration CSS properties from DeprecatedStyleBuilder to the
2326         new StyleBuilder so that they are generated from CSSPropertyNames.in.
2327
2328         No new tests, no behavior change.
2329
2330         * css/CSSPropertyNames.in:
2331         * css/DeprecatedStyleBuilder.cpp:
2332         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
2333         (WebCore::ApplyPropertyTextDecoration::applyValue): Deleted.
2334         (WebCore::ApplyPropertyTextDecoration::createHandler): Deleted.
2335         * css/StyleBuilderConverter.h:
2336         (WebCore::StyleBuilderConverter::convertTextDecoration):
2337
2338 2014-10-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2339
2340         [GTK] Remove GDK dependency from SharedTimerGtk
2341         https://bugs.webkit.org/show_bug.cgi?id=138092
2342
2343         Reviewed by Martin Robinson.
2344
2345         It depends on GDK just to use GDK_PRIORITY_REDRAW constant, we can
2346         use its value directly instead.
2347
2348         * PlatformGTK.cmake:
2349         * platform/gtk/SharedTimerGtk.cpp:
2350         (WebCore::setSharedTimerFireInterval):
2351
2352 2014-10-27  Andreas Kling  <akling@apple.com>
2353
2354         Move RenderBlock::beingDestroyed() to RenderObject.
2355         <https://webkit.org/b/138116>
2356
2357         Reviewed by Antti Koivisto.
2358
2359         Make "is being destroyed" a RenderObject concept instead of restricting
2360         it to RenderBlocks. I'm guessing that this was specific to blocks due to
2361         lack of bitfield space in RenderObject, and that's no longer an issue.
2362
2363         * rendering/RenderBlock.cpp:
2364         (WebCore::RenderBlock::RenderBlock):
2365         (WebCore::RenderBlock::willBeDestroyed):
2366         * rendering/RenderBlock.h:
2367         (WebCore::RenderBlock::beingDestroyed): Deleted.
2368         * rendering/RenderBlockFlow.cpp:
2369         (WebCore::RenderBlockFlow::willBeDestroyed):
2370         * rendering/RenderObject.cpp:
2371         (WebCore::RenderObject::destroy):
2372         * rendering/RenderObject.h:
2373         (WebCore::RenderObject::beingDestroyed):
2374         (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
2375
2376 2014-10-27  Chris Fleizach  <cfleizach@apple.com>
2377
2378         AX: input type=hidden is being exposed when aria-hidden=false
2379         https://bugs.webkit.org/show_bug.cgi?id=138106
2380
2381         Reviewed by Benjamin Poulain.
2382
2383         If an input type=hidden was inside an aria-hidden=false, it would appear because
2384         the lack of a RenderObject behind that object was not blocking its adoption into the AX tree.
2385         We should explicity check for whether the type is hidden and then return an appropriate role. 
2386
2387         Test: accessibility/input-type-hidden-in-aria-hidden-false.html
2388
2389         * accessibility/AccessibilityNodeObject.cpp:
2390         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
2391         (WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored):
2392
2393 2014-10-27  Alexey Proskuryakov  <ap@apple.com>
2394
2395         https://trac.webkit.org/changeset/175233 broke many tests, fixing an incorrect '!'.
2396
2397         * accessibility/AccessibilityRenderObject.cpp:
2398         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2399
2400 2014-10-24  David Hyatt  <hyatt@apple.com>
2401
2402         text-combine needs to center text within the vertical space using glyph bounds
2403         https://bugs.webkit.org/show_bug.cgi?id=138056
2404         <rdar://problem/15403667>
2405
2406         Reviewed by Dean Jackson.
2407
2408         Added fast/text/tatechuyoko.html
2409
2410         * rendering/RenderCombineText.cpp:
2411         (WebCore::RenderCombineText::RenderCombineText):
2412         (WebCore::RenderCombineText::adjustTextOrigin):
2413         (WebCore::RenderCombineText::combineText):
2414         * rendering/RenderCombineText.h:
2415
2416 2014-10-27  Benjamin Poulain  <benjamin@webkit.org>
2417
2418         Cleanup after r175213: fastGetAttribute().isNull() should be fastHasAttribute()
2419
2420         * accessibility/AccessibilityRenderObject.cpp:
2421         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2422         Darin spotted this mistake.
2423
2424 2014-10-27  Alexey Proskuryakov  <ap@apple.com>
2425
2426         http/tests/cookies/third-party-cookie-relaxing.html is flaky on bots
2427         https://bugs.webkit.org/show_bug.cgi?id=138098
2428
2429         Reviewed by Anders Carlsson.
2430
2431         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2432         (WebCore::NetworkStorageSession::switchToNewTestingSession):
2433         Create a separate session for each WKTR/DRT process when testing.
2434
2435 2014-10-27  Chris Dumez  <cdumez@apple.com>
2436
2437         Use separate HashMaps for common and uncommon headers in HTTPHeaderMap
2438         https://bugs.webkit.org/show_bug.cgi?id=138079
2439
2440         Reviewed by Anders Carlsson.
2441
2442         Use separate HashMaps for common and uncommon headers in HTTPHeaderMap:
2443         - a (faster) HashMap<HTTPHeaderMap, String> for common HTTP headers
2444         - a HashMap<String, String, CaseFoldingHash> for uncommon ones
2445
2446         This avoids having to construct Strings from HTTPHeaderMap values for
2447         storing. This also means we have less isolated String copies to do when
2448         creating cross-thread data. The common headers HashMap should also be
2449         a bit more efficient due to faster hashing and faster key comparison in
2450         case of collision.
2451
2452         Some calls sites can also benefit from having direct access to common
2453         headers of the request in HTTPHeaderName type.
2454
2455         This patch adds a new HTTPHeaderMapConstIterator iterator type for
2456         HTTPHeaderMap so that call sites that do not need / want to distinguish
2457         common / uncommon headers still do not need to. They can keep using
2458         modern C++ loops over HTTPHeaderMap objects and get <String, String>
2459         key/value pairs.
2460
2461         No new tests, no behavior change.
2462
2463         * loader/CrossOriginAccessControl.cpp:
2464         (WebCore::isOnAccessControlSimpleRequestHeaderWhitelist):
2465         Have isOnAccessControlSimpleRequestHeaderWhitelist() take a
2466         HTTPHeaderName in argument instead of a String as only common headers
2467         are in the whitelist.
2468
2469         (WebCore::isSimpleCrossOriginAccessRequest):
2470         Call isOnAccessControlSimpleRequestHeaderWhitelist() only for common
2471         HTTP headers.
2472
2473         * loader/CrossOriginAccessControl.h:
2474         Have isOnAccessControlSimpleRequestHeaderWhitelist() take a
2475         HTTPHeaderName in argument instead of a String as only common headers
2476         are in the whitelist.
2477
2478         * loader/CrossOriginPreflightResultCache.cpp:
2479         (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders):
2480         Call isOnAccessControlSimpleRequestHeaderWhitelist() only for common
2481         HTTP headers.
2482
2483         * loader/DocumentLoader.cpp:
2484         (WebCore::DocumentLoader::responseReceived):
2485         Call httpHeaderFields().commonHeaders().find() instead of
2486         httpHeaderFields().find() as we are looking for a common header.
2487         HTTPHeaderMap::find(HTTPHeaderName) was removed now that we have a
2488         HashMap dedicated to common headers.
2489
2490         * loader/cache/CachedRawResource.cpp:
2491         (WebCore::shouldIgnoreHeaderForCacheReuse):
2492         Update argument type to be a HTTPHeaderName instead of a String as
2493         only common HTTP headers can be ignored for cache reuse. The
2494         implementation already dealt with HTTPHeaderName type and had to
2495         call findHTTPHeaderName(). This is no longer needed now that the
2496         call site now has direct access to common headers in HTTPHeaderName
2497         type.
2498
2499         (WebCore::CachedRawResource::canReuse):
2500         - Only call shouldIgnoreHeaderForCacheReuse() for common HTTP headers.
2501         - Slightly optimize the second loop (the one over oldHeaderMap) to only
2502           check that the key is present in newHeaderMap, without actually
2503           comparing the String values. If the String values were different, the
2504           first loop would have seen it already and we would have returned
2505           early.
2506
2507 2014-10-27  Andreas Kling  <akling@apple.com>
2508
2509         Devirtualize RenderDeprecatedFlexibleBox::isStretchingChildren().
2510         <https://webkit.org/b/138096>
2511
2512         Reviewed by Chris Dumez.
2513
2514         This function is only ever called on a renderer after we've checked
2515         that it's a RenderDeprecatedFlexibleBox, so make it non-virtual.
2516
2517         * rendering/RenderBox.cpp:
2518         (WebCore::RenderBox::computeLogicalHeight):
2519         * rendering/RenderDeprecatedFlexibleBox.h:
2520         * rendering/RenderObject.h:
2521
2522 2014-10-27  Chris Dumez  <cdumez@apple.com>
2523
2524         Reintroduce null check removed in r175222
2525         https://bugs.webkit.org/show_bug.cgi?id=138087
2526
2527         Reviewed by Andreas Kling.
2528
2529         Reintroduce null check removed in r175222 as several layout tests are
2530         crashing on the bots without them. At least the Pair pointer can be
2531         null according to the assertion hits on the bots.
2532
2533         * css/StyleBuilderConverter.h:
2534         (WebCore::StyleBuilderConverter::convertRadius):
2535
2536 2014-10-27  Chris Dumez  <cdumez@apple.com>
2537
2538         Move radius CSS properties to the new StyleBuilder
2539         https://bugs.webkit.org/show_bug.cgi?id=138087
2540
2541         Reviewed by Andreas Kling.
2542
2543         Move radius CSS properties from DeprecatedStyleBuilder to the new
2544         StyleBuilder so that they are now generated from CSSPropertyNames.in.
2545
2546         No new tests, no behavior change.
2547
2548         * css/CSSPropertyNames.in:
2549         * css/DeprecatedStyleBuilder.cpp:
2550         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
2551         (WebCore::ApplyPropertyBorderRadius::setValue): Deleted.
2552         (WebCore::ApplyPropertyBorderRadius::applyValue): Deleted.
2553         (WebCore::ApplyPropertyBorderRadius::createHandler): Deleted.
2554         * css/StyleBuilderConverter.h:
2555         (WebCore::StyleBuilderConverter::convertRadius):
2556
2557 2014-10-27  Zan Dobersek  <zdobersek@igalia.com>
2558
2559         Shrink MathMLOperatorDictionary::dictionary table
2560         https://bugs.webkit.org/show_bug.cgi?id=137914
2561
2562         Reviewed by Darin Adler.
2563
2564         Improve packing of the Entry structure that's used for elements
2565         of the MathMLOperatorDictionary::dictionary table. This drops the
2566         size of the struct from 16 bytes to just 4 bytes, and shrinks the
2567         size of the dictionary table from rougly 16 kB down to 4 kB.
2568
2569         * rendering/mathml/RenderMathMLOperator.cpp:
2570         (WebCore::MathMLOperatorDictionary::ExtractKey):
2571         (WebCore::RenderMathMLOperator::setOperatorProperties):
2572         * rendering/mathml/RenderMathMLOperator.h:
2573
2574 2014-10-27  Andreas Kling  <akling@apple.com>
2575
2576         Move canContainFixedPositionObjects() to RenderElement.
2577         <https://webkit.org/b/138088>
2578
2579         Reviewed by Mihnea Ovidenie.
2580
2581         Only RenderElement can contain other renderers, so it's not really
2582         natural to answer this question on RenderObject anyway.
2583
2584         Moving it to RenderElement lets it access more efficient getters
2585         that don't have to handle the RenderText case.
2586
2587         * rendering/RenderElement.h:
2588         (WebCore::RenderElement::canContainFixedPositionObjects):
2589         * rendering/RenderObject.h:
2590         (WebCore::RenderObject::canContainFixedPositionObjects): Deleted.
2591
2592 2014-10-26  Benjamin Poulain  <benjamin@webkit.org>
2593
2594         Images with usemap should not have a link state
2595         https://bugs.webkit.org/show_bug.cgi?id=138071
2596
2597         Reviewed by Andreas Kling.
2598
2599         Image tags were incorrectly getting a link state if a usemap is defined.
2600         The <area> of the usemap is supposed to get the link state, but never the image.
2601
2602         Unfortunately, the Accessibility code was relying on the wrong behavior
2603         to set the ImageMapRole, most of the patch is updating that code to get
2604         the correct role without the link state.
2605
2606         Test: fast/selectors/images-with-usemap-should-not-match-link.html
2607
2608         The accessibility code is covered by a few tests in accessibility/.
2609         The test accessibility/aria-used-on-image-maps.html ensure the <area>
2610         elements also get the correct role.
2611
2612         * dom/Node.h:
2613         (WebCore::Node::setIsLink):
2614         (WebCore::Node::clearIsLink): Deleted.
2615         Unused code.
2616
2617         (WebCore::Node::isLink):
2618         Move with its setter for clarity.
2619
2620         * html/HTMLImageElement.cpp:
2621         (WebCore::HTMLImageElement::parseAttribute):
2622         This is the bug.
2623
2624         * accessibility/AccessibilityRenderObject.cpp:
2625         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2626         Here the branches for the role ImageMap where behind isLink() which would
2627         never be valid after the fix.
2628
2629         My fix here was to use the same definition previously set by HTMLImageElement::parseAttribute(),
2630         any usemap attribute qualifies the node for ImageMapRole.
2631
2632         (WebCore::AccessibilityRenderObject::anchorElement):
2633         (WebCore::AccessibilityRenderObject::linkedUIElements):
2634         (WebCore::AccessibilityRenderObject::url):
2635
2636         * accessibility/AccessibilityObject.h:
2637         (WebCore::AccessibilityObject::isAnchor): Deleted.
2638         Something funny I discovered is the Accessibility code worked around the bug
2639         by defining isAnchor() that exclude images from isLink().
2640
2641         Since isLink() will no longer be true for images, the hack can be removed.
2642
2643         * accessibility/AccessibilityNodeObject.cpp:
2644         (WebCore::AccessibilityNodeObject::anchorElement):
2645         (WebCore::AccessibilityNodeObject::isAnchor): Deleted.
2646         * accessibility/AccessibilityNodeObject.h:
2647         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2648         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
2649
2650 2014-10-26  Benjamin Poulain  <benjamin@webkit.org>
2651
2652         Replace Element::didAffectSelector() by setNeedsStyleRecalc()
2653         https://bugs.webkit.org/show_bug.cgi?id=138080
2654
2655         Reviewed by Andreas Kling.
2656
2657         Element::didAffectSelector() was probably an optimization at some point,
2658         with the current code is does nothing more than setNeedsStyleRecalc().
2659
2660         * dom/Document.cpp:
2661         (WebCore::Document::setCSSTarget):
2662         * dom/Element.cpp:
2663         (WebCore::Element::didAffectSelector): Deleted.
2664         * dom/Element.h:
2665         * html/HTMLAnchorElement.cpp:
2666         (WebCore::HTMLAnchorElement::parseAttribute):
2667         * html/HTMLFormControlElement.cpp:
2668         (WebCore::HTMLFormControlElement::disabledStateChanged):
2669         * html/HTMLInputElement.cpp:
2670         (WebCore::HTMLInputElement::setChecked):
2671         (WebCore::HTMLInputElement::setIndeterminate):
2672         * html/HTMLLinkElement.cpp:
2673         (WebCore::HTMLLinkElement::parseAttribute):
2674         * html/HTMLOptGroupElement.cpp:
2675         (WebCore::HTMLOptGroupElement::parseAttribute):
2676         * html/HTMLOptionElement.cpp:
2677         (WebCore::HTMLOptionElement::parseAttribute):
2678         (WebCore::HTMLOptionElement::setSelectedState):
2679         * html/HTMLProgressElement.cpp:
2680         (WebCore::HTMLProgressElement::didElementStateChange):
2681
2682 2014-10-26  Andreas Kling  <akling@apple.com>
2683
2684         Move some RenderObject member functions to RenderElement.
2685         <https://webkit.org/b/138085>
2686
2687         Reviewed by Chris Dumez.
2688
2689         Move these two functions to RenderElement:
2690
2691             - handleDynamicFloatPositionChange()
2692             - removeAnonymousWrappersForInlinesIfNecessary()
2693
2694         Also make childBecameNonInline() take a RenderElement& since
2695         that's all we ever pass to it.
2696
2697         * rendering/RenderBlock.cpp:
2698         (WebCore::RenderBlock::childBecameNonInline):
2699         * rendering/RenderBlock.h:
2700         * rendering/RenderBoxModelObject.h:
2701         (WebCore::RenderBoxModelObject::childBecameNonInline):
2702         * rendering/RenderElement.cpp:
2703         (WebCore::RenderElement::handleDynamicFloatPositionChange):
2704         (WebCore::RenderElement::removeAnonymousWrappersForInlinesIfNecessary):
2705         * rendering/RenderElement.h:
2706         * rendering/RenderInline.cpp:
2707         (WebCore::RenderInline::childBecameNonInline):
2708         * rendering/RenderInline.h:
2709         * rendering/RenderObject.cpp:
2710         (WebCore::RenderObject::handleDynamicFloatPositionChange): Deleted.
2711         (WebCore::RenderObject::removeAnonymousWrappersForInlinesIfNecessary): Deleted.
2712         * rendering/RenderObject.h:
2713
2714 2014-10-26  Andreas Kling  <akling@apple.com>
2715
2716         Move continuation teardown from subclasses to RenderBoxModelObject.
2717         <https://webkit.org/b/138081>
2718
2719         Reviewed by Antti Koivisto.
2720
2721         Let RenderBoxModelObject::willBeDestroyed() tear down any continuation
2722         instead of having every subclass do this themselves.
2723
2724         Also added a RenderElement bit tracking whether the renderer has a
2725         continuation. This avoids a hash lookup every time we destroy a
2726         RenderBoxModelObject that didn't have a continuation.
2727
2728         * rendering/RenderBlock.cpp:
2729         (WebCore::RenderBlock::willBeDestroyed):
2730         * rendering/RenderBlockFlow.cpp:
2731         (WebCore::RenderBlockFlow::willBeDestroyed):
2732         * rendering/RenderBoxModelObject.cpp:
2733         (WebCore::continuationMap):
2734         (WebCore::RenderBoxModelObject::willBeDestroyed):
2735         (WebCore::RenderBoxModelObject::continuation):
2736         (WebCore::RenderBoxModelObject::setContinuation):
2737         * rendering/RenderElement.cpp:
2738         (WebCore::RenderElement::RenderElement):
2739         * rendering/RenderElement.h:
2740         (WebCore::RenderElement::setHasContinuation):
2741         (WebCore::RenderElement::hasContinuation):
2742         * rendering/RenderInline.cpp:
2743         (WebCore::RenderInline::willBeDestroyed):
2744
2745 2014-10-25  Benjamin Poulain  <benjamin@webkit.org>
2746
2747         Remove a useless variable from SelectorCodeGenerator::generateElementMatchesSelectorList()
2748         https://bugs.webkit.org/show_bug.cgi?id=138076
2749
2750         Reviewed by Alexey Proskuryakov.
2751
2752         * cssjit/SelectorCompiler.cpp:
2753         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
2754         The variable elementAddressRegisterIndex was just needed for debugging, it is useless now.
2755
2756 2014-10-18  Brian J. Burg  <burg@cs.washington.edu>
2757
2758         Web Inspector: timelines should not count time elapsed while paused in the debugger
2759         https://bugs.webkit.org/show_bug.cgi?id=136351
2760
2761         Reviewed by Timothy Hatcher.
2762
2763         To avoid counting time elapsed while the debugger is paused, timeline records should
2764         keep track of time elapsed since the start of timeline capturing, rather than wall clock
2765         timestamps. We can easily compute elapsed time by sharing a Stopwatch instance through the
2766         inspector environment. The stopwatch runs with timelines and is paused with the debugger,
2767         so subsequent time measurements will not include time elapsed while the debugger is paused.
2768
2769         This refactoring is safe because start and end times are only used to graph records; the
2770         timestamp's actual value is irrelevant and is not displayed in the user interface. Date
2771         timestamps are still included with network-related records as part of their header data.
2772
2773         No new tests, because we cannot reliably test timing changes induced by debugger pauses.
2774         It is possible for records to accrue time before the debugger pauses or after it resumes.
2775
2776         * inspector/InspectorCSSAgent.cpp: Remove unnecessary include.
2777         * inspector/InspectorController.cpp:
2778         (WebCore::InspectorController::InspectorController):
2779         (WebCore::InspectorController::executionStopwatch): Add a shared stopwatch.
2780         * inspector/InspectorController.h:
2781         * inspector/InspectorPageAgent.cpp:
2782         (WebCore::InspectorPageAgent::timestamp): Redirect to the shared stopwatch.
2783         (WebCore::InspectorPageAgent::domContentEventFired):
2784         (WebCore::InspectorPageAgent::loadEventFired):
2785         * inspector/InspectorPageAgent.h:
2786         * inspector/InspectorResourceAgent.cpp:
2787         (WebCore::InspectorResourceAgent::timestamp): Redirect to the shared stopwatch.
2788         (WebCore::InspectorResourceAgent::willSendRequest):
2789         (WebCore::InspectorResourceAgent::didReceiveResponse):
2790         (WebCore::InspectorResourceAgent::didReceiveData):
2791         (WebCore::InspectorResourceAgent::didFinishLoading):
2792         (WebCore::InspectorResourceAgent::didFailLoading):
2793         (WebCore::InspectorResourceAgent::didLoadResourceFromMemoryCache):
2794         (WebCore::InspectorResourceAgent::willSendWebSocketHandshakeRequest):
2795         (WebCore::InspectorResourceAgent::didReceiveWebSocketHandshakeResponse):
2796         (WebCore::InspectorResourceAgent::didCloseWebSocket):
2797         (WebCore::InspectorResourceAgent::didReceiveWebSocketFrame):
2798         (WebCore::InspectorResourceAgent::didSendWebSocketFrame):
2799         (WebCore::InspectorResourceAgent::didReceiveWebSocketFrameError):
2800         * inspector/InspectorResourceAgent.h:
2801         * inspector/InspectorTimelineAgent.cpp:
2802         (WebCore::InspectorTimelineAgent::internalStart): Start and stop the stopwatch with timelines.
2803         (WebCore::InspectorTimelineAgent::internalStop):
2804         (WebCore::InspectorTimelineAgent::timestamp): Redirect to the shared stopwatch.
2805         (WebCore::startProfiling):
2806         (WebCore::InspectorTimelineAgent::startFromConsole):
2807         (WebCore::InspectorTimelineAgent::willCallFunction):
2808         (WebCore::InspectorTimelineAgent::willEvaluateScript):
2809         (WebCore::TimelineTimeConverter::reset): Deleted.
2810         * inspector/InspectorTimelineAgent.h:
2811         (WebCore::TimelineTimeConverter::TimelineTimeConverter): Deleted.
2812         (WebCore::TimelineTimeConverter::fromMonotonicallyIncreasingTime): Deleted.
2813         (WebCore::InspectorTimelineAgent::timeConverter): Deleted.
2814         * inspector/TimelineRecordFactory.cpp:
2815         * inspector/WorkerInspectorController.cpp:
2816         (WebCore::WorkerInspectorController::WorkerInspectorController):
2817         (WebCore::WorkerInspectorController::executionStopwatch): Add a shared stopwatch.
2818         * inspector/WorkerInspectorController.h:
2819
2820 2014-10-25  Dan Bernstein  <mitz@apple.com>
2821
2822         Fix builds using the public SDK.
2823
2824         * platform/spi/cocoa/NSExtensionSPI.h:
2825
2826 2014-10-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
2827
2828         Clamp wordSpacing percentage value.
2829         https://bugs.webkit.org/show_bug.cgi?id=129350.
2830
2831         Reviewed by Zalan Bujtas.
2832
2833         When the CSS wordSpacing property is percentage, its value has to be within the
2834         pre-defined min/max values for the CSS length type. This is done the same way
2835         the wordSpacing of type <length> is handled.
2836
2837         Tests: css3/infinite-word-spacing.html.
2838
2839         Move the definitions of minValueForCssLength and maxValueForCssLength from the
2840         .cpp file to the .h file.
2841         * css/CSSPrimitiveValue.cpp:
2842         * css/CSSPrimitiveValue.h:
2843
2844         Clamp the wordSpacing value to minValueForCssLength and maxValueForCssLength when
2845         its type is percentage.
2846         * css/DeprecatedStyleBuilder.cpp:
2847         (WebCore::ApplyPropertyWordSpacing::applyValue):
2848
2849 2014-10-24  Chris Dumez  <cdumez@apple.com>
2850
2851         [Mac] Use modern loops in ResourceRequestCocoa.mm
2852         https://bugs.webkit.org/show_bug.cgi?id=138052
2853
2854         Reviewed by Darin Adler.
2855
2856         Use modern loops in ResourceRequestCocoa.mm and leverage Objective-C's
2857         fast enumeration.
2858
2859         No new tests, no behavior change.
2860
2861         * platform/network/cocoa/ResourceRequestCocoa.mm:
2862         (WebCore::ResourceRequest::doUpdateResourceRequest):
2863         - Use NSDictionary's block-based enumeration as we enumerate both keys
2864           and values and this is faster than using fast enumeration of the keys
2865           then calling [NSDictionary objectForKey:]
2866         - Use Objective C's fast enumeration for
2867           contentDispositionEncodingFallbackArray as this is faster and shorter
2868           than index based access. Also use reserveCapacity() /
2869           uncheckedAppend() for m_responseContentDispositionEncodingFallbackArray
2870           as we know how many elements were are going to append in the common
2871           case.
2872
2873         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2874         - Use fast enumeration for [nsRequest allHTTPHeaderFields] dictionary
2875           keys instead of calling [NSDictionary allKeys] and then doing
2876           index-based iteration, to avoid copying the keys to a new array.
2877           Also do a forward enumeration instead of a reverse one. I don't see
2878           why a backward enumeration would be necessary here. We are not
2879           modifying the NSDictionary we are iterating over as
2880           [nsRequest allHTTPHeaderFields] makes a copy.
2881         - Use a modern C++ loop for
2882           m_responseContentDispositionEncodingFallbackArray.
2883
2884 2014-10-24  Zalan Bujtas  <zalan@apple.com>
2885
2886         Replace INT_MIN/MAX / kFixedPointDenominator with intMin/MaxForLayoutUnit.
2887         https://bugs.webkit.org/show_bug.cgi?id=138047
2888
2889         Reviewed by Andreas Kling.
2890
2891         No change in functionality.
2892
2893         * css/CSSPrimitiveValue.cpp:
2894
2895 2014-10-24  Alexey Proskuryakov  <ap@apple.com>
2896
2897         REGRESSION(r174877): WebProcess sends an empty Cookies HTTP header
2898         https://bugs.webkit.org/show_bug.cgi?id=138053
2899
2900         Reviewed by Chris Dumez.
2901
2902         Fixes existing tests.
2903
2904         * platform/network/mac/CookieJarMac.mm: (WebCore::cookiesForSession): Restore the 
2905         behavior of returning a null string when there are no cookies.
2906
2907 2014-10-24  Chris Dumez  <cdumez@apple.com>
2908
2909         [Mac] Use NSString API in QuickLookMac::computeNeedsQuickLookResourceCachingQuirks()
2910         https://bugs.webkit.org/show_bug.cgi?id=138039
2911
2912         Reviewed by Darin Adler.
2913
2914         Use NSString API in QuickLookMac::computeNeedsQuickLookResourceCachingQuirks()
2915         for case-insensitive string comparison instead of converting to UTF-8 and then
2916         using strcasecmp().
2917
2918         No new tests, no behavior change.
2919
2920         * platform/mac/QuickLookMac.mm:
2921         (WebCore::QuickLookMac::computeNeedsQuickLookResourceCachingQuirks):
2922
2923 2014-10-24  Chris Dumez  <cdumez@apple.com>
2924
2925         Avoid unnecessary NSURLRequest copies in ResourceRequest::doUpdatePlatformRequest() / doUpdatePlatformHTTPBody()
2926         https://bugs.webkit.org/show_bug.cgi?id=138049
2927
2928         Reviewed by Alexey Proskuryakov.
2929
2930         Avoid unnecessary NSURLRequest copies in ResourceRequest::doUpdatePlatformRequest()
2931         / doUpdatePlatformHTTPBody(). It turns out that about half the time, the
2932         m_nsRequest member is already mutable so it is unnecessary to call
2933         [NSURLRequest mutableCopy], we can just cast it to an NSMutableURLRequest* and
2934         avoid copying.
2935
2936         This patch also moves the code to a new ensureMutableNSURLRequest() method to
2937         avoid duplicating the logic.
2938
2939         I see that we spend ~21% less time in these 2 functions when loading
2940         http://flickr.com/explore/ (39.6ms -> 31.2ms).
2941
2942         No new tests, no behavior change.
2943
2944         * platform/network/cf/ResourceRequest.h:
2945         * platform/network/cocoa/ResourceRequestCocoa.mm:
2946         (WebCore::ResourceRequest::ensureMutableNSURLRequest):
2947         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2948         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
2949
2950 2014-10-24  Chris Dumez  <cdumez@apple.com>
2951
2952         Move ComputeLength CSS properties to the new StyleBuilder
2953         https://bugs.webkit.org/show_bug.cgi?id=138036
2954
2955         Reviewed by Andreas Kling.
2956
2957         Move ComputeLength CSS properties from DeprecatedStyleBuilder to the
2958         new StyleBuilder so that they are now generated. 3 Converters are
2959         provided for these properties: ComputedLength / LineWidth / Spacing.
2960
2961         This is inspired by the following Blink revision by
2962         <timloh@chromium.org>:
2963         https://src.chromium.org/viewvc/blink?view=rev&revision=154012
2964
2965         No new tests, no behavior change.
2966
2967         * css/CSSPropertyNames.in:
2968         * css/DeprecatedStyleBuilder.cpp:
2969         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
2970         (WebCore::ApplyPropertyComputeLength::setValue): Deleted.
2971         (WebCore::ApplyPropertyComputeLength::applyValue): Deleted.
2972         (WebCore::ApplyPropertyComputeLength::createHandler): Deleted.
2973         * css/StyleBuilderConverter.h:
2974         (WebCore::StyleBuilderConverter::convertComputedLength):
2975         (WebCore::StyleBuilderConverter::convertLineWidth):
2976         (WebCore::StyleBuilderConverter::convertSpacing):
2977
2978 2014-10-24  Chris Dumez  <cdumez@apple.com>
2979
2980         Make ScriptWrappable's destructor protected instead of public
2981         https://bugs.webkit.org/show_bug.cgi?id=138037
2982
2983         Reviewed by Andreas Kling.
2984
2985         Make ScriptWrappable's destructor protected instead of public as it is
2986         not virtual and this class is subclassed a lot.
2987
2988         No new tests, no behavior change.
2989
2990         * bindings/js/ScriptWrappable.h:
2991         (WebCore::ScriptWrappable::~ScriptWrappable):
2992
2993 2014-10-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2994
2995         [GTK][Cairo] Remove GTK dependency of WidgetBackingStoreGtkX11
2996         https://bugs.webkit.org/show_bug.cgi?id=138004
2997
2998         Reviewed by Gustavo Noronha Silva.
2999
3000         Rename all WidgetBackingStore* classes as
3001         BackingStoreBackendCairo* since all of them are actually
3002         BackingStore backends based on cairo, and move them from
3003         platform/cairo and platform/gtk to platform/graphics/cairo.
3004         BackingStoreBackendCairo is the base class that contains common
3005         members like the surface and size. BackingStoreBackendCairoImpl is
3006         the implementation using only cairo, and BackingStoreBackendCairoX11
3007         using xlib. BackingStoreBackendCairoX11 receives all the X11
3008         information it needs as constructor parameters, instead of using a
3009         GtkWidget and GTK+ X11 API. BackingStoreBackendCairoImpl receives
3010         the surface already created as constructor parameter, so that it
3011         doesn't have any platform specific code now.
3012
3013         * PlatformEfl.cmake: Update compilation files.
3014         * PlatformGTK.cmake: Ditto.
3015         * platform/cairo/WidgetBackingStoreCairo.cpp: Removed.
3016         * platform/graphics/cairo/BackingStoreBackendCairo.h: Renamed from Source/WebCore/platform/cairo/WidgetBackingStore.h.
3017         (WebCore::BackingStoreBackendCairo::~BackingStoreBackendCairo):
3018         (WebCore::BackingStoreBackendCairo::surface):
3019         (WebCore::BackingStoreBackendCairo::size):
3020         (WebCore::BackingStoreBackendCairo::BackingStoreBackendCairo):
3021         * platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp: Added.
3022         (WebCore::BackingStoreBackendCairoImpl::BackingStoreBackendCairoImpl):
3023         (WebCore::BackingStoreBackendCairoImpl::~BackingStoreBackendCairoImpl):
3024         (WebCore::BackingStoreBackendCairoImpl::scroll):
3025         * platform/graphics/cairo/BackingStoreBackendCairoImpl.h: Renamed from Source/WebCore/platform/cairo/WidgetBackingStoreCairo.h.
3026         * platform/graphics/cairo/BackingStoreBackendCairoX11.cpp: Renamed from Source/WebCore/platform/gtk/WidgetBackingStoreGtkX11.cpp.
3027         (WebCore::BackingStoreBackendCairoX11::BackingStoreBackendCairoX11):
3028         (WebCore::BackingStoreBackendCairoX11::~BackingStoreBackendCairoX11):
3029         (WebCore::BackingStoreBackendCairoX11::scroll):
3030         * platform/graphics/cairo/BackingStoreBackendCairoX11.h: Renamed from Source/WebCore/platform/gtk/WidgetBackingStoreGtkX11.h.
3031         * platform/graphics/cairo/CairoUtilities.cpp:
3032         (WebCore::cairoSurfaceGetDeviceScale):
3033         * platform/graphics/cairo/CairoUtilities.h:
3034
3035 2014-10-23  Zalan Bujtas  <zalan@apple.com>
3036
3037         WebContent crash at WebCore::RenderTextControl::textFormControlElement const.
3038         https://bugs.webkit.org/show_bug.cgi?id=138035
3039
3040         Reviewed by Antti Koivisto.
3041
3042         NULL-check element().renderer() before using it.
3043
3044         * html/SearchInputType.cpp:
3045         (WebCore::SearchInputType::didSetValueByUserEdit):
3046
3047 2014-10-23  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3048
3049         Remove HarfBuzzRun::create() factory function
3050         https://bugs.webkit.org/show_bug.cgi?id=137945
3051
3052         Reviewed by Ryosuke Niwa.
3053
3054         As a step to use std::unique_ptr<>, this patch applies std::unique_ptr<> and std::make_unique<>.
3055         Thus HarfBuzzRun::create() is needed no longer.
3056
3057         No new tests, no behavior changes.
3058
3059         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
3060         (WebCore::HarfBuzzShaper::collectHarfBuzzRuns):
3061         * platform/graphics/harfbuzz/HarfBuzzShaper.h:
3062         (WebCore::HarfBuzzShaper::HarfBuzzRun::create): Deleted.
3063
3064 2014-10-23  Myles C. Maxfield  <mmaxfield@apple.com>
3065
3066         Unreviewed iOS build fix
3067
3068         * editing/FrameSelection.cpp:
3069
3070 2014-10-23  Chris Dumez  <cdumez@apple.com>
3071
3072         [Mac] Optimize URL::createCFURL() for the common case
3073         https://bugs.webkit.org/show_bug.cgi?id=138030
3074
3075         Reviewed by Alexey Proskuryakov.
3076
3077         Optimize URL::createCFURL() for the common case by adding a fast path
3078         for when the URL String is already 8-bit (common case).
3079         When the string is 8-bit, we don't need to copy the bytes into a
3080         temporary buffer and we can construct the CFURLRef directly from it.
3081
3082         This makes URL::createCFURL() ~34% faster on my machine.
3083
3084         No new tests, no behavior change.
3085
3086         * platform/mac/URLMac.mm:
3087         (WebCore::URL::createCFURL):
3088
3089 2014-10-23  Myles C. Maxfield  <mmaxfield@apple.com>
3090
3091         Carets in GMail and iCloud compositions are the foreground text color
3092         https://bugs.webkit.org/show_bug.cgi?id=138029
3093
3094         Reviewed by Simon Fraser.
3095
3096         Previously, we were only checking whether the background colors of the foreground and background
3097         elements were the same, rather than taking validity and opacity into consideration.
3098
3099         Test: editing/caret/color-span-inside-editable-background.html
3100
3101         * editing/FrameSelection.cpp:
3102         (WebCore::disappearsIntoBackground):
3103         (WebCore::CaretBase::paintCaret):
3104
3105 2014-10-23  Joseph Pecoraro  <pecoraro@apple.com>
3106
3107         Web Inspector: Provide a way to have alternate inspector agents
3108         https://bugs.webkit.org/show_bug.cgi?id=137901
3109
3110         Reviewed by Brian Burg.
3111
3112         * Configurations/FeatureDefines.xcconfig:
3113
3114 2014-10-23  Simon Fraser  <simon.fraser@apple.com>
3115
3116         Don't assume that style.overflowX() == style.overflowY()
3117         https://bugs.webkit.org/show_bug.cgi?id=138028
3118
3119         Reviewed by Zalan Bujtas.
3120
3121         WebKit doesn't support independent overflow scroll/hidden on different axes,
3122         but the RenderStyle does report the correct values. So check both overflowX()
3123         and overflowY() in a couple of places where we need to.
3124
3125         * rendering/RenderLayerCompositor.cpp:
3126         (WebCore::styleHasTouchScrolling):
3127         (WebCore::styleChangeRequiresLayerRebuild):
3128
3129 2014-10-23  Chris Dumez  <cdumez@apple.com>
3130
3131         Get rid of unnecessary vtables in WebKit
3132         https://bugs.webkit.org/show_bug.cgi?id=138024
3133
3134         Reviewed by Benjamin Poulain.
3135
3136         Get rid of unnecessary vtables in WebKit by de-virtualizing destructors
3137         when possible and marking the class as final to make sure people don't
3138         subclass it.
3139
3140         No new tests, no behavior change.
3141
3142         * WebCore.exp.in:
3143         * css/WebKitCSSMatrix.h:
3144         * css/WebKitCSSMatrix.idl:
3145         * html/canvas/WebGLContextGroup.h:
3146         * html/canvas/WebGLGetInfo.h:
3147         * html/canvas/WebGLUniformLocation.h:
3148         (WebCore::WebGLUniformLocation::~WebGLUniformLocation): Deleted.
3149         * html/canvas/WebGLUniformLocation.idl:
3150         * inspector/DOMPatchSupport.h:
3151         * inspector/InspectorHistory.h:
3152         * inspector/InspectorStyleSheet.h:
3153         * page/WheelEventDeltaTracker.h:
3154         * page/scrolling/ScrollLatchingState.h:
3155         * platform/audio/Biquad.h:
3156         * platform/graphics/Pattern.h:
3157
3158 2014-10-23  Chris Dumez  <cdumez@apple.com>
3159
3160         Clean up virtual functions in dom/
3161         https://bugs.webkit.org/show_bug.cgi?id=138019
3162
3163         Reviewed by Benjamin Poulain.
3164
3165         Clean up virtual functions in dom/ by:
3166         - Making virtual functions final when possible
3167         - Making classes final when possible
3168         - Using 'override' when appropriate
3169         - Explicitly marking functions / destructors as virtual when they are
3170           inherently virtual
3171         - Making isXXX() virtual functions private on XXX classes to avoid
3172           unnecessary type checks
3173         - Dropping final for virtual functions in classes already marked as
3174           final
3175
3176         No new tests, no behavior change.
3177
3178         * WebCore.exp.in:
3179         * dom/AutocompleteErrorEvent.h:
3180         * dom/BeforeLoadEvent.h:
3181         (WebCore::BeforeLoadEventInit::BeforeLoadEventInit):
3182         * dom/BeforeTextInsertedEvent.h:
3183         * dom/ClipboardEvent.h:
3184         * dom/CompositionEvent.h:
3185         * dom/CustomEvent.h:
3186         * dom/DeviceMotionController.h:
3187         (WebCore::DeviceMotionController::~DeviceMotionController): Deleted.
3188         * dom/DeviceMotionEvent.h:
3189         * dom/DeviceOrientationController.h:
3190         (WebCore::DeviceOrientationController::~DeviceOrientationController): Deleted.
3191         * dom/DeviceOrientationEvent.h:
3192         * dom/Document.h:
3193         * dom/DocumentFragment.h:
3194         * dom/ErrorEvent.h:
3195         * dom/FocusEvent.h:
3196         * dom/HashChangeEvent.h:
3197         * dom/KeyboardEvent.h:
3198         * dom/LiveNodeList.h:
3199         * dom/MessageEvent.h:
3200         * dom/MessagePort.h:
3201         * dom/MouseEvent.h:
3202         * dom/MouseRelatedEvent.h:
3203         * dom/MutationEvent.h:
3204         * dom/NamedFlowCollection.h:
3205         * dom/OverflowEvent.h:
3206         * dom/PageTransitionEvent.h:
3207         * dom/PendingScript.h:
3208         * dom/PopStateEvent.h:
3209         * dom/RawDataDocumentParser.h:
3210         (WebCore::RawDataDocumentParser::finish): Deleted.
3211         (WebCore::RawDataDocumentParser::flush): Deleted.
3212         (WebCore::RawDataDocumentParser::insert): Deleted.
3213         (WebCore::RawDataDocumentParser::append): Deleted.
3214         * dom/ScriptableDocumentParser.h:
3215         * dom/SecurityPolicyViolationEvent.h:
3216         * dom/TextEvent.h:
3217         * dom/TouchEvent.h:
3218         * dom/TransitionEvent.h:
3219         * dom/UIEvent.h:
3220         * dom/WebKitAnimationEvent.h:
3221         * dom/WebKitTransitionEvent.h:
3222         * dom/WheelEvent.h:
3223         * page/DeviceController.h:
3224         (WebCore::DeviceController::~DeviceController):
3225
3226 2014-10-23  Tim Horton  <timothy_horton@apple.com>
3227
3228         Add some SPI headers for NSExtension and NSSharingService{Picker}
3229         https://bugs.webkit.org/show_bug.cgi?id=138027
3230
3231         Reviewed by Anders Carlsson.
3232
3233         * WebCore.xcodeproj/project.pbxproj:
3234         * platform/spi/cocoa/NSExtensionSPI.h: Added.
3235         * platform/spi/mac/NSSharingServicePickerSPI.h: Added.
3236         * platform/spi/mac/NSSharingServiceSPI.h: Added.
3237         Add modern SPI headers for NSExtension, and NSSharingService{Picker}.
3238
3239         * rendering/RenderThemeMac.mm:
3240         Replace redefinitions with an SPI header #import.
3241
3242 2014-10-23  Eric Carlson  <eric.carlson@apple.com>
3243
3244         [Mac] don't update caption user style sheet during parsing
3245         https://bugs.webkit.org/show_bug.cgi?id=137983
3246         rdar://problem/18735366
3247
3248         Reviewed by Jer Noble.
3249
3250         No new tests, existing tests cover the changes.
3251
3252         * page/CaptionUserPreferencesMediaAF.cpp:
3253         (WebCore::CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF): Initialize m_updateStyleSheetTimer.
3254         (WebCore::CaptionUserPreferencesMediaAF::updateTimerFired): Call updateCaptionStyleSheetOveride.
3255         (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges): Prime a timer to update 
3256             the captions style sheet after a slight delay.
3257
3258 2014-10-23  Chris Dumez  <cdumez@apple.com>
3259
3260         Move remaining Length-type properties to the new StyleBuilder
3261         https://bugs.webkit.org/show_bug.cgi?id=138012
3262
3263         Reviewed by Antti Koivisto.
3264
3265         Move remaining Length-type properties from DeprecatedStyleBuilder to
3266         the new StyleBuilder so that they are now generated from
3267         CSSPropertyNames.in as well. The patch introduces a couple of type
3268         converters for those: "LengthSizing / LengthMaxSizing".
3269
3270         No new tests, no behavior change.
3271
3272         * css/CSSPropertyNames.in:
3273         * css/DeprecatedStyleBuilder.cpp:
3274         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
3275         * css/StyleBuilderConverter.h:
3276         (WebCore::StyleBuilderConverter::convertLengthSizing):
3277         (WebCore::StyleBuilderConverter::convertLengthMaxSizing):
3278
3279 2014-10-23  Jer Noble  <jer.noble@apple.com>
3280
3281         [Mac] Safari cannot play 'audio/amr' content.
3282         https://bugs.webkit.org/show_bug.cgi?id=137894
3283
3284         Reviewed by Eric Carlson.
3285
3286         Test: media/media-can-play-case-insensitive.html
3287
3288         Sites are returning 'video/amr' for AMR audio content, but the IANA spec says 'audio/AMR', which is also what
3289         AVFoundation claims to support.  However, MIME types are supposed to be case-insensitive. When creating our
3290         mime type cache, case-fold to lower all MIME types given to us by our media frameworks.
3291
3292         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3293         (WebCore::mimeTypeCache):
3294         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3295         (WebCore::addFileTypesToCache):
3296
3297 2014-10-23  Chris Dumez  <cdumez@apple.com>
3298
3299         Move Length-type CSS properties from DeprecatedStyleBuilder to the new Style Builder
3300         https://bugs.webkit.org/show_bug.cgi?id=138000
3301
3302         Reviewed by Andreas Kling.
3303
3304         Move most Length-type CSS properties from DeprecatedStyleBuilder to the
3305         new Style Builder so that they are now generated. This patch adds
3306         support for a "Converter" option in CSSPropertyNames.in that can be
3307         used to specify a type converter function in
3308         css/StyleBuilderConverter.h. This patch adds support for Length and
3309         LengthOrAuto converters so that most Length-type properties can now be
3310         generated.
3311
3312         Another converter (likely called "LengthSizing") will be needed to
3313         generate the remaining Length-type properties. This will be taken care
3314         of in a follow-up patch.
3315
3316         This patch is inspired by the following Blink revision by
3317         <timloh@chromium.org>:
3318         https://src.chromium.org/viewvc/blink?view=rev&revision=150500
3319
3320         No new tests, no behavior change.
3321
3322         * WebCore.xcodeproj/project.pbxproj:
3323         * css/CSSPropertyNames.in:
3324         * css/DeprecatedStyleBuilder.cpp:
3325         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
3326         * css/SVGCSSPropertyNames.in:
3327         * css/StyleBuilder.h:
3328         * css/StyleBuilderConverter.h: Added.
3329         (WebCore::StyleBuilderConverter::convertLength):
3330         (WebCore::StyleBuilderConverter::convertLengthOrAuto):
3331         * css/StyleResolver.cpp:
3332         (WebCore::StyleResolver::applyProperty):
3333         * css/makeprop.pl:
3334
3335 2014-10-23  Zan Dobersek  <zdobersek@igalia.com>
3336
3337         Const-ify static s_resourceType members in RenderSVGResource* classes
3338         https://bugs.webkit.org/show_bug.cgi?id=137911
3339
3340         Reviewed by Andreas Kling.
3341
3342         Make s_resourceType static members in RenderSVGResource* classes const.
3343         Also update the resourceType() methods, where necessary, so that they
3344         return the s_resourceType constant.
3345
3346         * rendering/svg/RenderSVGResourceClipper.cpp:
3347         * rendering/svg/RenderSVGResourceClipper.h:
3348         * rendering/svg/RenderSVGResourceFilter.cpp:
3349         * rendering/svg/RenderSVGResourceFilter.h:
3350         * rendering/svg/RenderSVGResourceLinearGradient.cpp:
3351         * rendering/svg/RenderSVGResourceLinearGradient.h:
3352         * rendering/svg/RenderSVGResourceMarker.cpp:
3353         * rendering/svg/RenderSVGResourceMarker.h:
3354         * rendering/svg/RenderSVGResourceMasker.cpp:
3355         * rendering/svg/RenderSVGResourceMasker.h:
3356         * rendering/svg/RenderSVGResourcePattern.cpp:
3357         * rendering/svg/RenderSVGResourcePattern.h:
3358         * rendering/svg/RenderSVGResourceRadialGradient.cpp:
3359         * rendering/svg/RenderSVGResourceRadialGradient.h:
3360         * rendering/svg/RenderSVGResourceSolidColor.cpp:
3361         * rendering/svg/RenderSVGResourceSolidColor.h:
3362
3363 2014-10-23  Zan Dobersek  <zdobersek@igalia.com>
3364
3365         [TexMap] Clean up virtual method declarations in GraphicsLayerTextureMapper
3366         https://bugs.webkit.org/show_bug.cgi?id=137957
3367
3368         Reviewed by Martin Robinson.
3369
3370         Added override notation to the GraphicsLayerTextureMapper methods that are
3371         overriding the base methods from the GraphicsLayer class and don't have it yet.
3372         Also reordered these methods to follow the order of declaration in the
3373         GraphicsLayer class.
3374
3375         Removed ::setName() and ::willBeDestroyed() methods since they just called
3376         the base class' methods.
3377
3378         Also removed the ::solidColor() and ::changeMask() methods. The first one was
3379         only called in one place which can reference the m_solidColor member directly,
3380         and the second one wasn't used at all.
3381
3382         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3383         (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
3384         (WebCore::GraphicsLayerTextureMapper::setName): Deleted.
3385         (WebCore::GraphicsLayerTextureMapper::willBeDestroyed): Deleted.
3386         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
3387         (WebCore::GraphicsLayerTextureMapper::solidColor): Deleted.
3388         (WebCore::GraphicsLayerTextureMapper::usesContentsLayer): Deleted.
3389         (WebCore::GraphicsLayerTextureMapper::platformLayer): Deleted.
3390         (WebCore::GraphicsLayerTextureMapper::changeMask): Deleted.
3391
3392 2014-10-23  Krzysztof Czech  <k.czech@samsung.com>
3393
3394         AX: Do the early return when role is different than UnknownRole
3395         https://bugs.webkit.org/show_bug.cgi?id=137880
3396
3397         Reviewed by Chris Fleizach.
3398
3399         We do not need to call ariaRoleAttribute() to check whether m_ariaRole is different than UnknownRole.
3400         Just check m_ariaRole instead.
3401
3402         No new tests, no behavior change, just some cleanup
3403
3404         * accessibility/AccessibilityNodeObject.cpp:
3405         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
3406         * accessibility/AccessibilityRenderObject.cpp:
3407         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3408         * accessibility/AccessibilityTableRow.cpp:
3409         (WebCore::AccessibilityTableRow::determineAccessibilityRole):
3410
3411 2014-10-23  Yusuke Suzuki  <utatane.tea@gmail.com>
3412
3413         CSS JIT: Implement :matches
3414         https://bugs.webkit.org/show_bug.cgi?id=137947
3415
3416         Reviewed by Benjamin Poulain.
3417
3418         Initial patch for supporting :matches in CSS JIT.
3419         In this patch, we implement :matches
3420         by leveraging the generalized nested backtracking implementation.
3421
3422         Tests: fast/selectors/matches-backtracking.html
3423                fast/selectors/matches-complex.html
3424
3425         * cssjit/SelectorCompiler.cpp:
3426         (WebCore::SelectorCompiler::addPseudoClassType):
3427         (WebCore::SelectorCompiler::hasAnyCombinators):
3428         (WebCore::SelectorCompiler::computeBacktrackingMemoryRequirements):
3429         (WebCore::SelectorCompiler::computeBacktrackingInformation):
3430         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
3431         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesMatchesPseudoClass):
3432
3433 2014-10-23  Milan Crha  <mcrha@redhat.com>
3434
3435         RenderThemeGtk::mediaControlsScript() is not defined when VIDEO is disabled.
3436         <https://webkit.org/b/137970>.
3437
3438         Reviewed by Carlos Garcia Campos.
3439
3440         * rendering/RenderThemeGtk.cpp:
3441
3442 2014-10-22  Milan Crha  <mcrha@redhat.com>
3443
3444         Do not include GraphicsContext3D.h when 3D_GRAPHICS is not used.
3445         <https://webkit.org/b/137969>.
3446
3447         Reviewed by Carlos Garcia Campos.
3448
3449         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
3450
3451 2014-10-22  Milan Crha  <mcrha@redhat.com>
3452
3453         Do not build WidgetBackingStoreGtkX11 when not used.
3454         <https://webkit.org/b/137972>.
3455
3456         Reviewed by Carlos Garcia Campos.
3457
3458         * platform/gtk/WidgetBackingStoreGtkX11.cpp:
3459         * platform/gtk/WidgetBackingStoreGtkX11.h:
3460
3461 2014-10-22  Simon Fraser  <simon.fraser@apple.com>
3462
3463         [iOS] Toggling overflow:scroll to hidden on element with -webkit-overflow-scrolling:touch can cause children to disappear
3464         https://bugs.webkit.org/show_bug.cgi?id=137999
3465         rdar://problem/18425550
3466
3467         Reviewed by Zalan Bujtas.
3468         
3469         When toggling overflow from scroll to hidden on an element with -webkit-overflow-scrolling:touch,
3470         we'd fail to do a compositing layer rebuild, which caused various issues like unparented
3471         descendants, and misplaced and unrepainted content.
3472         
3473         This happened because we'd get to RenderLayerBacking::updateConfiguration() via styleChanged
3474         with the view needing layout, so never hit the updateScrollingLayers() code, and the subsequent
3475         updateCompositingLayers() would be a no-op.
3476         
3477         Fix by explicitly triggering a layer rebuild when style changes such that the touch-scrollability
3478         of an element changes, as we do for changes in clip.
3479
3480         Test: compositing/scrolling/touch-scroll-to-clip.html
3481
3482         * rendering/RenderLayerCompositor.cpp:
3483         (WebCore::isScrollableOverflow):
3484         (WebCore::styleHasTouchScrolling):
3485         (WebCore::styleChangeRequiresLayerRebuild):
3486
3487 2014-10-22  Chris Dumez  <cdumez@apple.com>
3488
3489         Clean up virtual functions in rendering/
3490         https://bugs.webkit.org/show_bug.cgi?id=137984
3491
3492         Reviewed by Darin Adler.
3493
3494         Clean up virtual functions in rendering/ by:
3495         - Making virtual functions final when possible
3496         - Making classes final when possible
3497         - Using 'override' when appropriate
3498         - Explicitly marking functions / destructors as virtual when they are
3499           inherently virtual
3500         - Dropping virtual destructors when the class does not have subclasses
3501           and mark the class as final, to get rid of unnecessary vtables
3502         - Making isXXX() virtual functions private on XXX classes to avoid
3503           unnecessary type checks
3504         - De-virtualizing some functions that do not need to be virtual
3505         - Dropping final for virtual functions in classes already marked as
3506           final
3507
3508         No new tests, no behavior change.
3509
3510         * html/shadow/SliderThumbElement.cpp:
3511         * rendering/AutoTableLayout.h:
3512         * rendering/ClipPathOperation.h:
3513         (WebCore::ClipPathOperation::type):
3514         (WebCore::ClipPathOperation::isSameType):
3515         * rendering/EllipsisBox.h:
3516         * rendering/FixedTableLayout.h:
3517         * rendering/InlineElementBox.h:
3518         * rendering/RenderBlockFlow.h:
3519         * rendering/RenderCombineText.h:
3520         * rendering/RenderCounter.h:
3521         * rendering/RenderDeprecatedFlexibleBox.h:
3522         * rendering/RenderFlexibleBox.h:
3523         * rendering/RenderFullScreen.h:
3524         * rendering/RenderGrid.h:
3525         * rendering/RenderLayer.h:
3526         * rendering/RenderLayerBacking.h:
3527         * rendering/RenderLayerCompositor.h:
3528         * rendering/RenderLayerFilterInfo.h:
3529         * rendering/RenderLineBreak.h:
3530         * rendering/RenderMarquee.h:
3531         * rendering/RenderMediaControlElements.h:
3532         * rendering/RenderMultiColumnFlowThread.h:
3533         * rendering/RenderMultiColumnSet.h:
3534         * rendering/RenderMultiColumnSpannerPlaceholder.h:
3535         * rendering/RenderNamedFlowFragment.h:
3536         * rendering/RenderNamedFlowThread.h:
3537         * rendering/RenderQuote.h:
3538         * rendering/RenderRegion.h:
3539         (WebCore::RenderRegion::renderName): Deleted.
3540         * rendering/RenderReplica.h:
3541         * rendering/RenderRubyBase.h:
3542         * rendering/RenderRubyRun.h:
3543         * rendering/RenderScrollbar.h:
3544         * rendering/RenderScrollbarPart.h:
3545         * rendering/RenderScrollbarTheme.h:
3546         (WebCore::RenderScrollbarTheme::~RenderScrollbarTheme): Deleted.
3547         (WebCore::RenderScrollbarTheme::scrollbarThickness): Deleted.
3548         (WebCore::RenderScrollbarTheme::buttonsPlacement): Deleted.
3549         (WebCore::RenderScrollbarTheme::supportsControlTints): Deleted.
3550         (WebCore::RenderScrollbarTheme::shouldCenterOnThumb): Deleted.
3551         (WebCore::RenderScrollbarTheme::initialAutoscrollTimerDelay): Deleted.
3552         (WebCore::RenderScrollbarTheme::autoscrollTimerDelay): Deleted.
3553         (WebCore::RenderScrollbarTheme::registerScrollbar): Deleted.
3554         (WebCore::RenderScrollbarTheme::unregisterScrollbar): Deleted.
3555         * rendering/RenderSnapshottedPlugIn.h:
3556         * rendering/RenderTextControlMultiLine.h:
3557         * rendering/RenderTextFragment.h:
3558         * rendering/RenderThemeGtk.h:
3559         * rendering/RenderThemeIOS.h:
3560         * rendering/RenderThemeWin.h:
3561         * rendering/RenderVideo.h:
3562         * rendering/TextAutosizer.h:
3563         * rendering/TrailingFloatsRootInlineBox.h:
3564         * rendering/mathml/RenderMathMLBlock.h:
3565         * rendering/mathml/RenderMathMLMenclose.h:
3566         * rendering/mathml/RenderMathMLOperator.h:
3567         * rendering/mathml/RenderMathMLRadicalOperator.h:
3568         * rendering/mathml/RenderMathMLRoot.h:
3569         * rendering/mathml/RenderMathMLRow.h:
3570         * rendering/mathml/RenderMathMLScripts.h:
3571         * rendering/mathml/RenderMathMLToken.h:
3572         * rendering/mathml/RenderMathMLUnderOver.h:
3573         * rendering/shapes/BoxShape.h:
3574         * rendering/shapes/PolygonShape.h:
3575         * rendering/shapes/RasterShape.h:
3576         * rendering/shapes/RectangleShape.h:
3577         * rendering/style/BasicShapes.h:
3578         * rendering/style/StylePendingImage.h:
3579         (WebCore::StylePendingImage::computeIntrinsicDimensions): Deleted.
3580         * rendering/svg/RenderSVGBlock.h:
3581         * rendering/svg/RenderSVGContainer.h:
3582         * rendering/svg/RenderSVGEllipse.h:
3583         * rendering/svg/RenderSVGForeignObject.h:
3584         * rendering/svg/RenderSVGImage.h:
3585         * rendering/svg/RenderSVGPath.h:
3586         * rendering/svg/RenderSVGRect.h:
3587         * rendering/svg/RenderSVGResourceClipper.h:
3588         * rendering/svg/RenderSVGResourceFilter.h:
3589         * rendering/svg/RenderSVGResourceFilterPrimitive.h:
3590         * rendering/svg/RenderSVGResourceLinearGradient.h:
3591         * rendering/svg/RenderSVGResourceMarker.h:
3592         * rendering/svg/RenderSVGResourceMasker.h:
3593         * rendering/svg/RenderSVGResourcePattern.h:
3594         * rendering/svg/RenderSVGResourceRadialGradient.h:
3595         * rendering/svg/RenderSVGRoot.h:
3596         * rendering/svg/RenderSVGTSpan.h:
3597         * rendering/svg/RenderSVGText.h:
3598         * rendering/svg/RenderSVGTransformableContainer.h:
3599         * rendering/svg/RenderSVGViewportContainer.h:
3600         * rendering/svg/SVGInlineTextBox.h:
3601         * rendering/svg/SVGRootInlineBox.h:
3602
3603 2014-10-22  Jer Noble  <jer.noble@apple.com>
3604
3605         REGRESSION(r175000): Crash in SourceBufferPrivateAVFObjC::destroyParser()
3606         https://bugs.webkit.org/show_bug.cgi?id=137990
3607
3608         Reviewed by Alexey Proskuryakov.
3609
3610         NULL-check m_mediaSource before using.
3611
3612         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3613         (WebCore::SourceBufferPrivateAVFObjC::destroyParser):
3614
3615 2014-10-22  Said Abou-Hallawa  <sabouhallawa@apple.com>
3616
3617         SVG loaded through html <img> can't request to load any external resources.
3618         https://bugs.webkit.org/show_bug.cgi?id=137762.
3619
3620         Reviewed by Daniel Bates.
3621
3622         SVG images have unique security rules that prevent them from loading any external
3623         resources. This patch enforces these rules in CachedResourceLoader::canRequest for
3624         all non-data-uri resources.
3625
3626         The fix and the tests are ported but modified a little from the chromium fix:
3627         http://src.chromium.org/viewvc/blink?view=rev&rev=176084
3628
3629         Test: http/tests/security/svg-image-with-cached-remote-image.html
3630               http/tests/security/svg-image-with-css-cross-domain.html
3631
3632         For the SVG image, prevent loading any external sub-resource except for data urls.
3633         * loader/cache/CachedResourceLoader.cpp:
3634         (WebCore::CachedResourceLoader::canRequest):
3635
3636 2014-10-21  Ada Chan  <adachan@apple.com>
3637
3638         MediaPlayerPrivateAVFoundation::hasAudio() returns false even when there is an audible AVMediaSelectionOption selected
3639         https://bugs.webkit.org/show_bug.cgi?id=137935
3640
3641         Reviewed by Eric Carlson.
3642
3643         Set hasAudio to true if there's a selected audible AVMediaSelectionOption
3644         after the call to updateAudioTracks(). Ditto for video.
3645
3646         Test: http/tests/media/hls/hls-audio-tracks-has-audio.html
3647
3648         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3649         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
3650
3651         * testing/Internals.cpp:
3652         (WebCore::Internals::mediaElementHasCharacteristic):
3653         * testing/Internals.h:
3654         * testing/Internals.idl:
3655         Add internals.mediaElementHasCharacteristic for the new test.
3656
3657 2014-10-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3658
3659         Remove WidgetBackingStoreCairo::create() factory function
3660         https://bugs.webkit.org/show_bug.cgi?id=137943
3661
3662         Reviewed by Darin Adler.
3663
3664         WidgetBackingStoreCairo::create() can be replaced by std::make_unique<>.
3665         Thus this patch removes it, then use std::make_unique<>|std::unique_ptr<>.
3666
3667         No new tests, no behavior changes.
3668
3669         * platform/cairo/WidgetBackingStoreCairo.cpp:
3670         (WebCore::WidgetBackingStoreCairo::create): Deleted.
3671         * platform/cairo/WidgetBackingStoreCairo.h:
3672         * platform/gtk/WidgetBackingStoreGtkX11.cpp:
3673         (WebCore::WidgetBackingStoreGtkX11::create): Deleted.
3674         * platform/gtk/WidgetBackingStoreGtkX11.h:
3675
3676 2014-10-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3677
3678         Remove TextCheckerEnchant::create() factory function
3679         https://bugs.webkit.org/show_bug.cgi?id=137944
3680
3681         Reviewed by Darin Adler.
3682
3683         TextCheckerEnchant::create() can be replaced by std::make_unique<> and std::unique_ptr<>.
3684
3685         No new tests, no behavior change.
3686
3687         * platform/text/enchant/TextCheckerEnchant.h:
3688         (WebCore::TextCheckerEnchant::create): Deleted.
3689
3690 2014-10-22  Chris Dumez  <cdumez@apple.com>
3691
3692         Avoid confusion between AccessibilityObject::isTable() / isAccessibilityTable()
3693         https://bugs.webkit.org/show_bug.cgi?id=137899
3694
3695         Reviewed by Darin Adler.
3696
3697         Avoid confusion between AccessibilityObject::isTable() and
3698         isAccessibilityTable(). isTable() is equivalent to
3699         is<AccessibilityTable>(), while isAccessibilityTable() is an
3700         AccessibilityTable that is exposed as an AccessibilityTable to the
3701         platform.
3702
3703         This patch is renaming isAccessibilityTable() to
3704         isExposableThroughAccessibility(), makes it non-virtual and defines it
3705         on AccessibilityTable only, for clarity.
3706
3707         This patch also renames isTableExposableThroughAccessibility() to
3708         computeIisTableExposableThroughAccessibility() as it is called only
3709         once to initialize the m_isExposableThroughAccessibility data member.
3710
3711         No new tests, no behavior change.
3712
3713         * accessibility/AccessibilityARIAGrid.cpp:
3714         (WebCore::AccessibilityARIAGrid::addChildren):
3715         * accessibility/AccessibilityARIAGrid.h:
3716         * accessibility/AccessibilityARIAGridCell.cpp:
3717         (WebCore::AccessibilityARIAGridCell::parentTable):
3718         (WebCore::AccessibilityARIAGridCell::rowIndexRange):
3719         (WebCore::AccessibilityARIAGridCell::columnIndexRange):
3720         * accessibility/AccessibilityARIAGridRow.cpp:
3721         (WebCore::AccessibilityARIAGridRow::disclosedRows):
3722         (WebCore::AccessibilityARIAGridRow::disclosedByRow):
3723         (WebCore::AccessibilityARIAGridRow::parentTable):
3724         * accessibility/AccessibilityNodeObject.cpp:
3725         (WebCore::shouldUseAccessiblityObjectInnerText):
3726         * accessibility/AccessibilityObject.cpp:
3727         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
3728         (WebCore::appendChildrenToArray):
3729         * accessibility/AccessibilityObject.h:
3730         (WebCore::AccessibilityObject::isAccessibilityTable): Deleted.
3731         * accessibility/AccessibilityRenderObject.cpp:
3732         (WebCore::AccessibilityRenderObject::ariaSelectedRows):
3733         * accessibility/AccessibilityTable.cpp:
3734         (WebCore::AccessibilityTable::AccessibilityTable):
3735         (WebCore::AccessibilityTable::init):
3736         (WebCore::AccessibilityTable::isExposableThroughAccessibility):
3737         (WebCore::AccessibilityTable::computeIsTableExposableThroughAccessibility):
3738         (WebCore::AccessibilityTable::addChildren):
3739         (WebCore::AccessibilityTable::tableLevel):
3740         (WebCore::AccessibilityTable::roleValue):
3741         (WebCore::AccessibilityTable::computeAccessibilityIsIgnored):
3742         (WebCore::AccessibilityTable::title):
3743         (WebCore::AccessibilityTable::isAccessibilityTable): Deleted.
3744         (WebCore::AccessibilityTable::isTableExposableThroughAccessibility): Deleted.
3745         * accessibility/AccessibilityTable.h:
3746         * accessibility/AccessibilityTableCell.cpp:
3747         (WebCore::AccessibilityTableCell::isTableCell):
3748         * accessibility/AccessibilityTableColumn.cpp:
3749         (WebCore::AccessibilityTableColumn::headerObject):
3750         (WebCore::AccessibilityTableColumn::addChildren):
3751         * accessibility/AccessibilityTableHeaderContainer.cpp:
3752         (WebCore::AccessibilityTableHeaderContainer::addChildren):
3753         * accessibility/AccessibilityTableRow.cpp:
3754         (WebCore::AccessibilityTableRow::isTableRow):
3755         (WebCore::AccessibilityTableRow::parentTable):
3756         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3757         (webkitAccessibleGetNChildren):
3758         (webkitAccessibleRefChild):
3759         (webkitAccessibleGetAttributes):
3760         * accessibility/mac/AXObjectCacheMac.mm:
3761         (WebCore::AXObjectCache::postPlatformNotification):
3762         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3763         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
3764         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
3765         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3766         (-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
3767         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
3768         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
3769
3770 2014-10-22  Chris Dumez  <cdumez@apple.com>
3771
3772         Avoid repeated is<MutableStyleProperties>() checks in StyleProperties
3773         https://bugs.webkit.org/show_bug.cgi?id=137978
3774
3775         Reviewed by Andreas Kling.
3776
3777         Reduce the amount of is<MutableStyleProperties>() checks in
3778         StyleProperties by:
3779         - Removing the checks in each method of StyleProperties::PropertyReference,
3780           and replace them by a single check in StyleProperties::propertyAt().
3781         - Providing faster propertyCount() / propertyAt() / isEmpty() methods on
3782           MutableStyleProperties / ImmutableStyleProperties as a lot of callers use
3783           tight typing.
3784         - Using tighter typing at call sites whenever possible.
3785
3786         Ideally, we could be able to use iterators instead of propertyCount() /
3787         propertyAt() but this is not trivial to do efficiently as the
3788         representation in memory is fundamentally different for MutableStyleProperties
3789         / ImmutableStyleProperties. We may be able to do better longer term, but
3790         this is already more efficient short term at least.
3791
3792         No new tests, no behavior change.
3793
3794         * css/StyleProperties.cpp:
3795         (WebCore::MutableStyleProperties::MutableStyleProperties):
3796         (WebCore::StyleProperties::PropertyReference::cssText):
3797         * css/StyleProperties.h:
3798         (WebCore::StyleProperties::PropertyReference::PropertyReference):
3799         (WebCore::StyleProperties::PropertyReference::id):
3800         (WebCore::StyleProperties::PropertyReference::shorthandID):
3801         (WebCore::StyleProperties::PropertyReference::isImportant):
3802         (WebCore::StyleProperties::PropertyReference::isInherited):
3803         (WebCore::StyleProperties::PropertyReference::isImplicit):
3804         (WebCore::StyleProperties::PropertyReference::value):
3805         (WebCore::StyleProperties::PropertyReference::toCSSProperty):
3806         (WebCore::StyleProperties::isEmpty):
3807         (WebCore::ImmutableStyleProperties::isEmpty):
3808         (WebCore::MutableStyleProperties::isEmpty):
3809         (WebCore::ImmutableStyleProperties::propertyAt):
3810         (WebCore::MutableStyleProperties::propertyAt):
3811         (WebCore::StyleProperties::propertyAt):
3812         (WebCore::StyleProperties::propertyCount):
3813         (WebCore::StyleProperties::PropertyReference::propertyMetadata): Deleted.
3814         (WebCore::StyleProperties::PropertyReference::propertyValue): Deleted.
3815         * editing/EditingStyle.cpp:
3816         (WebCore::removePropertiesInStyle):
3817         (WebCore::EditingStyle::removePropertiesInElementDefaultStyle):
3818
3819 2014-10-22  Eric Carlson  <eric.carlson@apple.com>
3820
3821         [Mac][MediaStream] clean up bit rot
3822         https://bugs.webkit.org/show_bug.cgi?id=137976
3823
3824         Reviewed by Jer Noble.
3825
3826         No new tests, this just gets the Mac port compiling again.
3827
3828         * Modules/mediastream/MediaStream.h: Add a virtual destructor to Observer since it has 
3829             a virtual method.
3830
3831         * WebCore.exp.in: Export RTCPeerConnectionHandler::create and RTCPeerConnectionHandlerMock::create(WebCore::RTCPeerConnectionHandlerClient*),
3832             they are both use by Internals for testing.
3833
3834         * WebCore.xcodeproj/project.pbxproj: Add RTC and MediaStream files.
3835
3836         * html/HTMLMediaElement.h: Forward declare MediaStream instead of including MediaStream.h.
3837
3838         * platform/mediastream/RTCPeerConnectionHandler.h: EXPORT the create method.
3839
3840         * platform/mock/MediaConstraintsMock.cpp:
3841         (WebCore::isSupported): Make static.
3842         (WebCore::isValid): Ditto.
3843
3844         * platform/mock/RTCPeerConnectionHandlerMock.h: EXPORT the create method.
3845
3846 2014-10-22  Chris Dumez  <cdumez@apple.com>
3847
3848         [Mac][WK2] Fix applicationIsSafari() detection
3849         https://bugs.webkit.org/show_bug.cgi?id=137893
3850
3851         Reviewed by Alexey Proskuryakov.
3852
3853         I noticed when profiling Safari on Mac that we were exercising a code
3854         path we shouldn't because it is meant for other applications that
3855         Safari.
3856
3857         The detection relies on the applicationIsSafari() function in
3858         RuntimeApplicationChecks.cpp. This was in some cases returning false on
3859         my machine even though I was running Safari so I investigated a bit and
3860         noticed that the check relies on the main bundle identifier string and
3861         is doing:
3862         isSafari = mainBundleIsEqualTo("com.apple.Safari")
3863             || mainBundleIsEqualTo("com.apple.WebProcess");
3864
3865         This WebProcess detection is very unreliable because:
3866         - It matches other apps than Safari's WebProcesses
3867         - The bundle name for the WebProcess is sometimes
3868         "com.apple.WebKit.WebContent" or
3869         "com.apple.WebKit.WebContent.Development".
3870
3871         The solution used in this patch is to move the applicationIsSafari()
3872         check to the UIProcess so that the check actually succeeds reliably.
3873         The call site for applicationIsSafari() was in
3874         ResourceRequest::useQuickLookResourceCachingQuirks(). This match
3875         removes that logic from ResourceRequest and move it to
3876         FrameLoaderClient as only the FrameLoader is interested in this
3877         information. The logic to determine if we should use QuickLook
3878         resource caching quirks is moved to a new QuickLook class under
3879         platform/ as the code needs to be shared between WebKit and WebKit2.
3880         On WebKit2, we make use that code on the UIProcess side and pass
3881         the flag as a parameter when constructing the WebProcess. The flag
3882         is then stored on the WebProcess and queried by WebFrameLoaderClient.
3883
3884         Previously, we would spend ~1% of the WebProcess cpu time (when loading
3885         apple.com) trying to detect if we should use QuickLook resource caching
3886         quirks even though that check was supposed to be disabled and return
3887         early when running Safari.
3888
3889         No new tests, not easily testable.
3890
3891         * WebCore.exp.in:
3892         * WebCore.xcodeproj/project.pbxproj:
3893         * loader/EmptyClients.h:
3894         * loader/FrameLoader.cpp:
3895         (WebCore::FrameLoader::subresourceCachePolicy):
3896         * loader/FrameLoaderClient.h:
3897         * platform/RuntimeApplicationChecks.cpp:
3898         (WebCore::applicationIsSafari):
3899         Remove "com.apple.WebProcess" bundle name matching as this causes false
3900         positives (matches other applications than Safari's WebProcesses) and
3901         it is no longer needed now that applicationIsSafari() is always called
3902         from the UIProcess.
3903
3904         * platform/mac/QuickLookMac.h: Added.
3905         * platform/mac/QuickLookMac.mm: Copied from Source/WebCore/platform/network/mac/ResourceRequestMac.mm.
3906         (WebCore::QuickLookMac::computeNeedsQuickLookResourceCachingQuirks):
3907         * platform/network/cf/ResourceRequest.h:
3908         * platform/network/ios/ResourceRequestIOS.mm:
3909         (WebCore::ResourceRequest::useQuickLookResourceCachingQuirks): Deleted.
3910         * platform/network/mac/ResourceRequestMac.mm:
3911         (WebCore::initQuickLookResourceCachingQuirks): Deleted.
3912         (WebCore::ResourceRequest::useQuickLookResourceCachingQuirks): Deleted.
3913
3914 2014-10-22  Shivakumar JM  <shiva.jm@samsung.com>
3915
3916         XMLHttpRequest should support attribute responseURL as per latest XHR spec.
3917         https://bugs.webkit.org/show_bug.cgi?id=136938
3918
3919         Reviewed by Alexey Proskuryakov.
3920
3921         Tests: http/tests/xmlhttprequest/basic-auth-responseURL.html
3922                http/tests/xmlhttprequest/cross-origin-redirect-responseURL.html
3923                http/tests/xmlhttprequest/redirect-credentials-responseURL.html
3924                http/tests/xmlhttprequest/xmlhttprequest-responseURL.html
3925
3926         XMLHttpRequest should support attribute responseURL
3927
3928         * xml/XMLHttpRequest.cpp:
3929         (WebCore::XMLHttpRequest::responseURL):
3930         * xml/XMLHttpRequest.h:
3931         * xml/XMLHttpRequest.idl:
3932
3933 2014-10-22  Chris Dumez  <cdumez@apple.com>
3934
3935         Add initial support for generating the StyleBuilder from CSSPropertyNames.in
3936         https://bugs.webkit.org/show_bug.cgi?id=137910
3937
3938         Reviewed by Andreas Kling.
3939
3940         Add initial support for generating the StyleBuilder from
3941         CSSPropertyNames.in. This is a first step towards getting rid of the
3942         legacy DeprecatedStyleBuilder class and having everything defined in one
3943         place (CSSPropertyNames.in).
3944
3945         This patch updates makeprop.pl script to generate a StyleBuilder.cpp
3946         file that generate a the StyleBuilder::applyProperty() method
3947         implementation using a huge switch statement for all the CSS
3948         properties. With this patch, we are now generating the new StyleBuilder
3949         code for all the "simple" CSS properties (i.e. those that were using
3950         ApplyPropertyDefault<> in DeprecatedStyleBuilder.cpp). I am using a
3951         "NewStyleBuilder" option in CSSPropertyNames.in for properties that
3952         we generate to help with improving incrementally the generator. Once
3953         we are able to generate all properties, this transition option will
3954         do away and become the default.
3955
3956         By default, the generator will make an educated guess for the type
3957         name, the getter, the setter and the initial function of each property.
3958         For example, for the border-collapse property, it will use:
3959         - TypeName: EBorderCollapse (i.e. 'E' + PropertyId)
3960         - Getter: borderCollapse() (i.e. PropertyId with first letter lowercased)
3961         - Setter: setBorderCollapse() (i.e. 'set' + PropertyId)
3962         - Initial: initialBorderCollapse() (i.e. 'initial' + PropertyId)
3963
3964         This works for most properties. For properties that need
3965         special-casing, developers can use the following options in
3966         CSSPropertyNames.in:
3967         - TypeName: Overrides the type name
3968         - Getter: Overrides the getter name
3969         - Setter: Overrides the setter name
3970         - Initial: Overrides the initial function name
3971         - NameForMethods: Overrides the Getter / Setter / Initial function
3972           names. For e.g. "NameForMethods=OverflowWrap" will use
3973           "overflowWrap() / setOverflowWrap() / initialOverflowWrap()".
3974
3975         The patch is inspired by the following Blink revision by
3976         <timloh@chromium.org>:
3977         https://src.chromium.org/viewvc/blink?view=rev&revision=150424
3978
3979         No new tests, no behavior change.
3980
3981         * CMakeLists.txt:
3982         * DerivedSources.make:
3983         * WebCore.vcxproj/WebCore.vcxproj:
3984         * WebCore.vcxproj/WebCore.vcxproj.filters:
3985         * WebCore.xcodeproj/project.pbxproj:
3986         * css/CSSPropertyNames.in:
3987         * css/DeprecatedStyleBuilder.cpp:
3988         (WebCore::ApplyPropertyVerticalAlign::createHandler):
3989         (WebCore::ApplyPropertyDisplay::applyInitialValue):
3990         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
3991         * css/StyleBuilder.h: Added.
3992         * css/StyleResolver.cpp:
3993         (WebCore::StyleResolver::adjustRenderStyle):
3994         (WebCore::StyleResolver::applyProperty):
3995         * css/makeprop.pl:
3996         * rendering/style/RenderStyle.h:
3997         Move the initialXXX() methods that were in NonInheritedFlags to
3998         RenderStyle class, with the other initialXXX() methods to facilitate
3999         code generation.
4000
4001         * rendering/style/StyleMultiColData.cpp:
4002         (WebCore::StyleMultiColData::StyleMultiColData):
4003         * rendering/style/StyleRareNonInheritedData.cpp:
4004         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
4005
4006 2014-10-22  Carlos Garcia Campos  <cgarcia@igalia.com>
4007
4008         Unreviewed. Fix GStreamer debug build after r175050.
4009
4010         Explicitly include wtf/MainThread.h.
4011
4012         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
4013
4014 2014-10-22  Carlos Garcia Campos  <cgarcia@igalia.com>
4015
4016         [GStreamer] Do not use CachedResourceLoader, SecurityOrigin, ResourceBuffer and other WebCore types
4017         https://bugs.webkit.org/show_bug.cgi?id=137064
4018
4019         Reviewed by Philippe Normand.
4020
4021         Move the media resource loader to a new class in WebCore/loader
4022         that inherits from a PlatformMediaResourceLoader class defined in
4023         the platform layer. The platform specific behaviour is implemented
4024         using a client also defined in the platform layer, implemented by
4025         every media backend, and used by the WebCore MediaResourceLoader.
4026
4027         * CMakeLists.txt: Add new files to compilation.
4028         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
4029         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
4030         * WebCore.xcodeproj/project.pbxproj: Ditto.
4031         * html/HTMLMediaElement.cpp:
4032         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
4033         Create a MediaResourceLoader.
4034         (WebCore::HTMLMediaElement::mediaPlayerCORSMode): Deleted. This is
4035         no longer used.
4036         * html/HTMLMediaElement.h:
4037         * loader/MediaResourceLoader.cpp: Added.
4038         (WebCore::MediaResourceLoader::MediaResourceLoader):
4039         (WebCore::MediaResourceLoader::~MediaResourceLoader):
4040         (WebCore::MediaResourceLoader::start): Start a new load for the
4041         given request and load options.
4042         (WebCore::MediaResourceLoader::stop): Stop the load if needed.
4043         (WebCore::MediaResourceLoader::setDefersLoading):
4044         (WebCore::MediaResourceLoader::responseReceived): Handle CORS
4045         access check and notify the client about the response.