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