The most aggressive form of RegExpTest/RegExpExec should speculate more aggressively...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-03-05  Simon Fraser  <simon.fraser@apple.com>
2
3         Add support for the object-position CSS property
4         https://bugs.webkit.org/show_bug.cgi?id=122811
5         rdar://problem/15836338
6
7         Reviewed by Sam Weinig.
8
9         Take object-position into account when rendering replaced elements.
10         RenderReplaced::replacedContentRect() is the one place where we compute
11         the content rect for replaced elements.
12
13         Also return false from foregroundIsKnownToBeOpaqueInRect() if we have
14         any non-default object-position, as the foreground may no longer fill the box.
15
16         Tests: compositing/video/video-object-position.html
17                fast/css/object-position/object-position-canvas.html
18                fast/css/object-position/object-position-embed.html
19                fast/css/object-position/object-position-img-svg.html
20                fast/css/object-position/object-position-img.html
21                fast/css/object-position/object-position-input-image.html
22                fast/css/object-position/object-position-object.html
23                fast/css/object-position/object-position-video-poster.html
24
25         * rendering/RenderImage.cpp:
26         (WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
27         * rendering/RenderReplaced.cpp:
28         (WebCore::RenderReplaced::replacedContentRect):
29
30 2016-03-05  Simon Fraser  <simon.fraser@apple.com>
31
32         Add parsing support for object-position
33         https://bugs.webkit.org/show_bug.cgi?id=155065
34
35         Reviewed by Sam Weinig.
36         
37         Add parsing support for object-position. This is the first property with
38         CSS <position> values which does not have equivalent -x and -y shorthands,
39         so we can store it as a new LengthPoint type.
40         
41         Per the CSS Values spec, bottom- and right-relative values are translated
42         into calc() expressions, which are exposed via computed style. For example,
43         "right 10px bottom" becomes "calc(100% - 10px) 100%". This also allows transitions
44         between, say, "left 10px bottom" and "right 10px bottom".
45
46         Test: fast/css/object-position/parsing-object-position.html
47
48         * CMakeLists.txt:
49         * WebCore.xcodeproj/project.pbxproj:
50         * css/CSSComputedStyleDeclaration.cpp:
51         (WebCore::ComputedStyleExtractor::propertyValue):
52         * css/CSSParser.cpp:
53         (WebCore::CSSParser::parseValue):
54         * css/CSSPrimitiveValue.h:
55         (WebCore::CSSPrimitiveValue::isPair):
56         * css/CSSPropertyNames.in:
57         * css/CSSValue.h:
58         * css/StyleBuilderConverter.h:
59         (WebCore::StyleBuilderConverter::convertLength):
60         (WebCore::StyleBuilderConverter::convertTo100PercentMinusLength):
61         (WebCore::StyleBuilderConverter::convertPositionComponent):
62         (WebCore::StyleBuilderConverter::convertObjectPosition):
63         * platform/LengthPoint.cpp: Added.
64         (WebCore::operator<<):
65         * platform/LengthPoint.h: Added.
66         (WebCore::LengthPoint::LengthPoint):
67         (WebCore::LengthPoint::operator==):
68         (WebCore::LengthPoint::setX):
69         (WebCore::LengthPoint::x):
70         (WebCore::LengthPoint::setY):
71         (WebCore::LengthPoint::y):
72         (WebCore::LengthPoint::blend):
73         * rendering/style/RenderStyle.cpp:
74         (WebCore::RenderStyle::changeRequiresRepaint):
75         * rendering/style/RenderStyle.h:
76         * rendering/style/StyleRareNonInheritedData.cpp:
77         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
78         (WebCore::StyleRareNonInheritedData::operator==):
79         * rendering/style/StyleRareNonInheritedData.h:
80
81 2016-03-05  Joanmarie Diggs  <jdiggs@igalia.com>
82
83         AX: Implement missing/different accessibility API mappings for SVG
84         https://bugs.webkit.org/show_bug.cgi?id=155034
85
86         Reviewed by Chris Fleizach.
87
88         Create an AccessibilitySVGElement class for the SVG-specific mappings;
89         fix name and description mappings for ATK; add new AccessibilityRole
90         types (SVGTextRole, SVGTSpanRole, SVGTextPathRole) and map them for
91         ATK and AX API.
92
93         Tests: accessibility/w3c-svg-description-calculation.html
94                accessibility/w3c-svg-elements-not-exposed.html
95                accessibility/w3c-svg-name-calculation.html
96                accessibility/w3c-svg-presentational-role.html
97                accessibility/w3c-svg-roles.html
98
99         * CMakeLists.txt:
100         * WebCore.xcodeproj/project.pbxproj:
101         * accessibility/AXObjectCache.cpp:
102         (WebCore::createFromRenderer):
103         * accessibility/AccessibilityAllInOne.cpp:
104         * accessibility/AccessibilityNodeObject.cpp:
105         (WebCore::AccessibilityNodeObject::alternativeText): Deleted.
106         (WebCore::AccessibilityNodeObject::accessibilityDescription): Deleted.
107         * accessibility/AccessibilityObject.h:
108         (WebCore::AccessibilityObject::isAccessibilitySVGElement):
109         * accessibility/AccessibilityRenderObject.cpp:
110         (WebCore::AccessibilityRenderObject::determineAccessibilityRole): Deleted.
111         * accessibility/AccessibilitySVGElement.cpp: Added.
112         (WebCore::AccessibilitySVGElement::AccessibilitySVGElement):
113         (WebCore::AccessibilitySVGElement::~AccessibilitySVGElement):
114         (WebCore::AccessibilitySVGElement::create):
115         (WebCore::AccessibilitySVGElement::targetForUseElement):
116         (WebCore::AccessibilitySVGElement::accessibilityText):
117         (WebCore::AccessibilitySVGElement::accessibilityDescription):
118         (WebCore::AccessibilitySVGElement::helpText):
119         (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored):
120         (WebCore::AccessibilitySVGElement::inheritsPresentationalRole):
121         (WebCore::AccessibilitySVGElement::determineAriaRoleAttribute):
122         (WebCore::AccessibilitySVGElement::determineAccessibilityRole):
123         * accessibility/AccessibilitySVGElement.h: Added.
124         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
125         (webkitAccessibleGetName):
126         (webkitAccessibleGetDescription):
127         (atkRole):
128         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
129         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
130         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
131         (createAccessibilityRoleMap):
132         * rendering/RenderObject.h:
133         (WebCore::RenderObject::isSVGTSpan):
134         * rendering/svg/RenderSVGTSpan.h:
135
136 2016-03-05  Yusuke Suzuki  <utatane.tea@gmail.com>
137
138         [ES6] Support Reflect.construct
139         https://bugs.webkit.org/show_bug.cgi?id=147330
140
141         Reviewed by Saam Barati.
142
143         * Modules/plugins/QuickTimePluginReplacement.mm:
144         (WebCore::QuickTimePluginReplacement::installReplacement):
145         * bindings/js/CallbackFunction.cpp:
146         (WebCore::checkFunctionOnlyCallback):
147         * bindings/js/JSCallbackData.cpp:
148         (WebCore::JSCallbackData::invokeCallback):
149         * bindings/js/JSCustomElementInterface.cpp:
150         (WebCore::JSCustomElementInterface::constructElement):
151         (WebCore::JSCustomElementInterface::attributeChanged):
152         * bindings/js/JSCustomXPathNSResolver.cpp:
153         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
154         * bindings/js/JSDOMBinding.cpp:
155         (WebCore::callFunctionWithCurrentArguments):
156         (WebCore::DOMConstructorObject::getCallData):
157         * bindings/js/JSDOMConstructor.h:
158         (WebCore::JSDOMConstructorNotConstructable::getCallData):
159         (WebCore::JSDOMConstructor<JSClass>::getConstructData):
160         (WebCore::JSDOMNamedConstructor<JSClass>::getConstructData):
161         (WebCore::JSBuiltinConstructor<JSClass>::getConstructData):
162         * bindings/js/JSDOMPromise.cpp:
163         (WebCore::DeferredWrapper::callFunction):
164         * bindings/js/JSDocumentCustom.cpp:
165         (WebCore::JSDocument::defineElement):
166         * bindings/js/JSErrorHandler.cpp:
167         (WebCore::JSErrorHandler::handleEvent):
168         * bindings/js/JSEventListener.cpp:
169         (WebCore::JSEventListener::handleEvent):
170         * bindings/js/JSHTMLAllCollectionCustom.cpp:
171         (WebCore::JSHTMLAllCollection::getCallData):
172         * bindings/js/JSHTMLDocumentCustom.cpp:
173         (WebCore::JSHTMLDocument::open):
174         * bindings/js/JSKeyValueIterator.h:
175         (WebCore::keyValueIteratorForEach):
176         * bindings/js/JSMainThreadExecStateInstrumentation.h:
177         (WebCore::JSMainThreadExecState::instrumentFunctionCall):
178         (WebCore::JSMainThreadExecState::instrumentFunctionConstruct):
179         * bindings/js/JSMutationCallback.cpp:
180         (WebCore::JSMutationCallback::call):
181         * bindings/js/JSMutationObserverCustom.cpp:
182         (WebCore::constructJSMutationObserver):
183         * bindings/js/JSPluginElementFunctions.cpp:
184         (WebCore::callPlugin):
185         (WebCore::pluginElementGetCallData):
186         * bindings/js/ScheduledAction.cpp:
187         (WebCore::ScheduledAction::create):
188         (WebCore::ScheduledAction::executeFunctionInContext):
189         * bindings/objc/WebScriptObject.mm:
190         (-[WebScriptObject callWebScriptMethod:withArguments:]):
191         * bindings/scripts/CodeGeneratorJS.pm:
192         (GenerateConstructorHelperMethods):
193         * bindings/scripts/test/JS/JSFloat64Array.cpp:
194         (WebCore::JSFloat64ArrayConstructor::getConstructData):
195         * bindings/scripts/test/JS/JSTestInterface.cpp:
196         (WebCore::JSTestInterfaceConstructor::getConstructData):
197         * bridge/NP_jsobject.cpp:
198         (_NPN_InvokeDefault):
199         (_NPN_Invoke):
200         (_NPN_Construct):
201         * bridge/objc/objc_runtime.mm:
202         (JSC::Bindings::ObjcFallbackObjectImp::getCallData):
203         * bridge/runtime_method.cpp:
204         (JSC::RuntimeMethod::getCallData):
205         * bridge/runtime_object.cpp:
206         (JSC::Bindings::RuntimeObject::getCallData):
207         (JSC::Bindings::RuntimeObject::getConstructData):
208         * html/HTMLMediaElement.cpp:
209         (WebCore::HTMLMediaElement::updateCaptionContainer):
210         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
211         (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
212         * html/HTMLPlugInImageElement.cpp:
213         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
214         * testing/Internals.cpp:
215         (WebCore::Internals::isReadableStreamDisturbed):
216
217 2016-03-05  Ryosuke Niwa  <rniwa@webkit.org>
218
219         Fix the bindings test after r197611.
220
221         * bindings/scripts/test/TestObj.idl:
222
223 2016-03-05  Ryosuke Niwa  <rniwa@webkit.org>
224
225         Move QualifiedName from CustomElementInfo to JSCustomElementInterface
226         https://bugs.webkit.org/show_bug.cgi?id=155061
227
228         Reviewed by Antti Koivisto.
229
230         Store QualifiedName of custom elements in JSCustomElementInterface instead of CustomElementInfo
231         now that each interface is associated with exactly one custom element as of r197602.
232
233         No new tests since this is a refactoring.
234
235         * bindings/js/JSCustomElementInterface.cpp:
236         (WebCore::JSCustomElementInterface::JSCustomElementInterface): Now takes QualifiedName as the
237         first argument.
238         * bindings/js/JSCustomElementInterface.h:
239         (WebCore::JSCustomElementInterface::create):
240         (WebCore::JSCustomElementInterface::name): Added.
241         * bindings/js/JSDocumentCustom.cpp:
242         (WebCore::JSDocument::defineElement):
243         * bindings/js/JSHTMLElementCustom.cpp:
244         (WebCore::constructJSHTMLElement): Use findInterface instead of the deleted findName.
245         * dom/CustomElementDefinitions.cpp:
246         (WebCore::CustomElementDefinitions::checkName):
247         (WebCore::CustomElementDefinitions::addElementDefinition): Renamed from defineElement.
248         (WebCore::CustomElementDefinitions::findInterface): Add a variant that finds the interface object
249         by a JS constructor.
250         (WebCore::CustomElementDefinitions::containsConstructor):
251         (WebCore::CustomElementDefinitions::findName): Deleted.
252         * dom/CustomElementDefinitions.h:
253         (WebCore::CustomElementDefinitions::CustomElementInfo::CustomElementInfo): Deleted.
254
255 2016-03-04  Ryosuke Niwa  <rniwa@webkit.org>
256
257         Add basic support for attributeChanged lifecycle callback
258         https://bugs.webkit.org/show_bug.cgi?id=155011
259
260         Reviewed by Antti Koivisto.
261
262         Add basic support for attributeChangedCallback in setAttribute, removeAttribute, setAttributeNS,
263         remoteAttributeNS, setAttributeNode, and removeAttributeNS. There are many other DOM APIs that
264         could modify attributes but we would annotate those APIs in a separate patch to limit the scope
265         of this change.
266
267         In order to invoke the lifecycle callback right before returning to the author script, allocate
268         an instance of CustomElementLifecycleProcessingStack in each of these functions' binding code.
269         The stack object's destructor invokes all callbacks enqueued by the DOM API if there are any.
270
271         Spec: https://w3c.github.io/webcomponents/spec/custom/#dfn-attribute-changed-callback
272
273         Tests: fast/custom-elements/attribute-changed-callback.html
274                fast/custom-elements/lifecycle-callback-timing.html
275
276         * CMakeLists.txt:
277         * WebCore.xcodeproj/project.pbxproj:
278         * bindings/js/JSCustomElementInterface.cpp:
279         (WebCore::JSCustomElementInterface::attributeChanged): Added. Invokes attributeChangedCallback.
280         * bindings/js/JSCustomElementInterface.h:
281         * bindings/js/JSMainThreadExecState.h:
282         (JSMainThreadNullState): Allocate an instance of CustomElementLifecycleProcessingStack in GObject
283         and Objective-C binding code for consistency with JavaScript. We can't do this in JavaScript
284         because there is no RAII object all functions, getters, and setters allocate (for a good reason).
285
286         * bindings/scripts/CodeGeneratorJS.pm:
287         (GenerateImplementation): Generate an instance of CustomElementLifecycleProcessingStack when
288         NeedsLifecycleProcessingStack is specified as an extended IDL attribute.
289         * bindings/scripts/IDLAttributes.txt: Added NeedsLifecycleProcessingStack.
290         * bindings/scripts/test/JS/JSTestObj.cpp:
291         (WebCore::jsTestObjPrototypeFunctionMethodWithNeedsLifecycleProcessingStack):
292         * bindings/scripts/test/TestObj.idl: Added a test for NeedsLifecycleProcessingStack.
293
294         * dom/DOMAllInOne.cpp:
295         * dom/Element.cpp:
296         (WebCore::Element::attributeChanged): Enqueue attributeChanged callback if the context object
297         is a custom element and there is a CustomElementLifecycleProcessingStack allocated in the stack.
298         * dom/Element.idl:
299
300         * dom/LifecycleCallbackQueue.cpp: Added.
301         (WebCore::LifecycleQueueItem): Added.
302         (WebCore::LifecycleQueueItem::LifecycleQueueItem): Added.
303         (WebCore::LifecycleQueueItem::invoke): Added.
304         (WebCore::LifecycleCallbackQueue::LifecycleCallbackQueue): Added.
305         (WebCore::LifecycleCallbackQueue::~LifecycleCallbackQueue): Added.
306         (WebCore::LifecycleCallbackQueue::enqueueAttributeChangedCallback): Added.
307         (WebCore::LifecycleCallbackQueue::invokeAll): Added.
308         (WebCore::CustomElementLifecycleProcessingStack::ensureCurrentQueue): Added. As noted in FIXME,
309         the early exit in the code is necessary only because we haven't added NeedsLifecycleProcessingStack
310         in all places. It should go away in a follow up patch.
311         (WebCore::CustomElementLifecycleProcessingStack::processQueue): Added.
312         * dom/LifecycleCallbackQueue.h: Added.
313         (WebCore::CustomElementLifecycleProcessingStack): This is a light weight RAII object the binding
314         code will allocate in order to queue up lifecycle callbacks. We don't use Ref or std::unique_ptr
315         in m_queue to avoid generating the code to destruct LifecycleCallbackQueue everywhere.
316         (WebCore::CustomElementLifecycleProcessingStack::CustomElementLifecycleProcessingStack): Added.
317         (WebCore::CustomElementLifecycleProcessingStack::~CustomElementLifecycleProcessingStack): Added.
318         (WebCore::CustomElementLifecycleProcessingStack::hasCurrentProcessingStack): Added.
319
320 2016-03-04  Carlos Garcia Campos  <cgarcia@igalia.com>
321
322         [GTK] Scrollbars are broken again with GTK+ >= 3.19.11
323         https://bugs.webkit.org/show_bug.cgi?id=154890
324
325         Reviewed by Michael Catanzaro.
326
327         Scrollbar style properties have been deprecated in GTK+, and it
328         seems that now deprecating means keeping the properties but
329         ignoring them. So, this reworks the whole scrollbars theme code
330         again to not cache style properties anymore, but retrieve them
331         from the GtkStyleContext. Previous GTK+ versions still need to
332         query the style properties, so I've added helper functions to get
333         all the style properties with the ifdefs, trying to keep the
334         common render code free of GTK+ versions ifdefs.
335
336         * platform/gtk/ScrollbarThemeGtk.cpp:
337         (WebCore::ScrollbarThemeGtk::backButtonRect):
338         (WebCore::ScrollbarThemeGtk::forwardButtonRect):
339         (WebCore::ScrollbarThemeGtk::trackRect):
340         (WebCore::ScrollbarThemeGtk::thumbRect):
341         (WebCore::ScrollbarThemeGtk::paintTrackBackground):
342         (WebCore::ScrollbarThemeGtk::paintThumb):
343         (WebCore::ScrollbarThemeGtk::paint):
344         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
345         (WebCore::ScrollbarThemeGtk::buttonSize):
346         (WebCore::ScrollbarThemeGtk::stepperSize):
347         (WebCore::ScrollbarThemeGtk::getStepperSpacing):
348         (WebCore::ScrollbarThemeGtk::troughUnderSteppers):
349         (WebCore::ScrollbarThemeGtk::minimumThumbLength):
350         (WebCore::ScrollbarThemeGtk::thumbFatness):
351         (WebCore::ScrollbarThemeGtk::getTroughBorder):
352         (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext):
353         (WebCore::ScrollbarThemeGtk::updateThemeProperties):
354         (WebCore::ScrollbarThemeGtk::handleMousePressEvent):
355         * platform/gtk/ScrollbarThemeGtk.h:
356
357 2016-03-04  Brent Fulgham  <bfulgham@apple.com>
358
359         Resource load statistics are not honoring private browsing
360         https://bugs.webkit.org/show_bug.cgi?id=155054
361         <rdar://problem/24987873>
362
363         Reviewed by Andy Estes.
364
365         Modify the points where we capture resource load statistics to ignore
366         loads made during private browsing. Do this by moving more of the logic
367         about whether to gather statistics into the logging functions, passing
368         the raw input types (frame, ResourceRequest, ResourceResponse) internally
369         so that we don't pay any cost until we decide we want to gather data.s
370
371         * loader/DocumentLoader.cpp:
372         (WebCore::DocumentLoader::willSendRequest): Revise for the new API on
373         ResourceLoadObserver.
374         * loader/ResourceLoadObserver.cpp:
375         (WebCore::ResourceLoadObserver::logFrameNavigation): Revise signature and
376         check for private browsing.
377         (WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
378         (WebCore::ResourceLoadObserver::logUserInteraction): Ditto.
379         * loader/ResourceLoadObserver.h:
380         * loader/SubresourceLoader.cpp:
381         (WebCore::SubresourceLoader::willSendRequestInternal): Ditto.
382
383 2016-03-04  Alex Christensen  <achristensen@webkit.org>
384
385         Fix file mime-types when using NetworkSession
386         https://bugs.webkit.org/show_bug.cgi?id=155058
387
388         Reviewed by Andy Estes.
389
390         This fixes platform/mac/fast/loader/file-url-mimetypes-3.html
391         and platform/mac/fast/loader/file-url-mimetypes.html.
392
393         * platform/network/mac/WebCoreURLResponse.h:
394
395 2016-03-04  Sam Weinig  <sam@webkit.org>
396
397         [WebKit2] Add WebKit2 equivalent of -[WebView _insertNewlineInQuotedContent]
398         <rdar://problem/24943591>
399         https://bugs.webkit.org/show_bug.cgi?id=155057
400
401         Reviewed by Tim Horton.
402
403         Move Editor::insertParagraphSeparatorInQuotedContent() into Editor.cpp
404         and remove the duplicated code in EditorIOS.mm and EditorMac.mm.
405
406         * editing/Editor.cpp:
407         (WebCore::Editor::insertParagraphSeparatorInQuotedContent):
408         * editing/Editor.h:
409         * editing/ios/EditorIOS.mm:
410         (WebCore::Editor::insertParagraphSeparatorInQuotedContent): Deleted.
411         * editing/mac/EditorMac.mm:
412         (WebCore::Editor::insertParagraphSeparatorInQuotedContent): Deleted.
413
414 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
415
416         Convert DOMTimer interval from int to std::chromo::milliseconds
417         https://bugs.webkit.org/show_bug.cgi?id=155051
418
419         Speculative build fix.
420
421         * inspector/TimelineRecordFactory.cpp:
422         (WebCore::TimelineRecordFactory::createTimerInstallData):
423
424 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
425
426         Convert DOMTimer interval from int to std::chromo::milliseconds
427         https://bugs.webkit.org/show_bug.cgi?id=155051
428
429         iOS build fix
430
431         * page/DOMTimer.cpp:
432         (WebCore::DOMTimer::install):
433
434 2016-03-04  Ryosuke Niwa  <rniwa@webkit.org>
435
436         Update defineCustomElement according to the spec rewrite
437         https://bugs.webkit.org/show_bug.cgi?id=155010
438         <rdar://problem/24970878>
439
440         Reviewed by Chris Dumez.
441
442         Updated the implementation of defineCustomElement and HTMLConstructor per recent rewrite of the spec:
443         https://w3c.github.io/webcomponents/spec/custom/#dom-document-defineelement
444         https://w3c.github.io/webcomponents/spec/custom/#htmlelement-constructor
445
446         defineCustomElement is now called defineElement and we disallow defining multiple custom elements with
447         a single class and throw an exception in defineElement.
448
449         Test: fast/custom-elements/Document-defineElement.html
450
451         * bindings/js/JSDocumentCustom.cpp:
452         (WebCore::JSDocument::defineElement): Renamed from defineCustomElement. Throw an exception when the interface
453         already defines another custom element. Also added FIXME's for missing steps.
454
455         * bindings/js/JSHTMLElementCustom.cpp:
456         (WebCore::constructJSHTMLElement): Removed the support for specifying a tag name in the first argument when
457         a single class defines multiple custom elements since that now results in an exception (in defineElement).
458
459         * dom/CustomElementDefinitions.cpp:
460         (WebCore::CustomElementDefinitions::containsConstructor): Added.
461         * dom/CustomElementDefinitions.h:
462         * dom/Document.idl: Renamed defineCustomElement to defineElement.
463         * html/HTMLElement.idl: Removed the optional tag name from the constructor.
464
465 2016-03-04  Tim Horton  <timothy_horton@apple.com>
466
467         Begin implementing <attachment> painting on iOS
468         https://bugs.webkit.org/show_bug.cgi?id=155046
469         <rdar://problem/24805991>
470
471         Reviewed by Enrica Casucci.
472
473         No new tests; there are existing tests that I will unskip and rebaseline
474         in the near future.
475
476         * rendering/RenderThemeIOS.h:
477         * rendering/RenderThemeIOS.mm:
478         (WebCore::AttachmentInfo::addLine):
479         (WebCore::AttachmentInfo::buildTitleLines):
480         (WebCore::AttachmentInfo::buildSingleLine):
481         (WebCore::getAttachmentProgress):
482         (WebCore::iconForAttachment):
483         (WebCore::AttachmentInfo::AttachmentInfo):
484         (WebCore::RenderThemeIOS::attachmentIntrinsicSize):
485         (WebCore::RenderThemeIOS::attachmentBaseline):
486         (WebCore::paintAttachmentIcon):
487         (WebCore::paintAttachmentText):
488         (WebCore::paintAttachmentProgress):
489         (WebCore::paintAttachmentBorder):
490         (WebCore::RenderThemeIOS::paintAttachment):
491         There are still a few missing pieces, but get <attachment> painting a bit on iOS.
492         We will paint an icon, action, title, and subtitle - in that order - depending on what we have.
493         The content is vertically and horizontally centered.
494
495 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
496
497         Convert DOMTimer interval from int to std::chromo::milliseconds
498         https://bugs.webkit.org/show_bug.cgi?id=155051
499
500         Reviewed by Ryosuke Niwa.
501
502         This change is pretty much mechanical, replacing int with std::chrono::milliseconds.
503
504         * inspector/InspectorInstrumentation.cpp:
505         (WebCore::InspectorInstrumentation::willSendXMLHttpRequestImpl):
506         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
507         * inspector/InspectorInstrumentation.h:
508         (WebCore::InspectorInstrumentation::willSendXMLHttpRequest):
509         (WebCore::InspectorInstrumentation::didInstallTimer):
510         * inspector/InspectorTimelineAgent.cpp:
511         (WebCore::InspectorTimelineAgent::didPaint):
512         (WebCore::InspectorTimelineAgent::didInstallTimer):
513         * inspector/InspectorTimelineAgent.h:
514         * inspector/TimelineRecordFactory.cpp:
515         (WebCore::TimelineRecordFactory::createGenericTimerData):
516         (WebCore::TimelineRecordFactory::createTimerInstallData):
517         * inspector/TimelineRecordFactory.h:
518         * page/DOMTimer.cpp:
519         (WebCore::shouldForwardUserGesture):
520         (WebCore::DOMTimer::DOMTimer):
521         (WebCore::DOMTimer::~DOMTimer):
522         (WebCore::DOMTimer::install):
523         (WebCore::DOMTimer::intervalClampedToMinimum):
524         * page/DOMTimer.h:
525         * page/DOMWindow.cpp:
526         (WebCore::DOMWindow::setTimeout):
527         (WebCore::DOMWindow::clearTimeout):
528         (WebCore::DOMWindow::setInterval):
529         (WebCore::DOMWindow::clearInterval):
530         * workers/WorkerGlobalScope.cpp:
531         (WebCore::WorkerGlobalScope::setTimeout):
532         (WebCore::WorkerGlobalScope::clearTimeout):
533         (WebCore::WorkerGlobalScope::setInterval):
534         (WebCore::WorkerGlobalScope::clearInterval):
535
536 2016-03-03  Enrica Casucci  <enrica@apple.com>
537
538         Add a mechanism to customize the long press action.
539         https://bugs.webkit.org/show_bug.cgi?id=154995
540         rdar://problem/24823732
541
542         Reviewed by Tim Horton.
543
544         We want to allow long press on attachment elements as well.
545
546         * WebCore.xcodeproj/project.pbxproj: Making HTMLAttachmentElement.h private.
547         * html/HTMLAttachmentElement.h: Adding exported functions.
548
549 2016-03-04  Andreas Kling  <akling@apple.com>
550
551         [iOS] Throw away compiled RegExp code when navigating to a new page.
552         <https://webkit.org/b/155015>
553
554         Reviewed by Anders Carlsson.
555
556         Discard RegExp code when doing a top-level navigation.
557         This frees up a couple hundred kilobytes on many pages.
558
559         * bindings/js/GCController.cpp:
560         (WebCore::GCController::deleteAllRegExpCode):
561         * bindings/js/GCController.h:
562         * loader/FrameLoader.cpp:
563         (WebCore::FrameLoader::commitProvisionalLoad):
564
565 2016-03-04  Simon Fraser  <simon.fraser@apple.com>
566
567         Use larger tiles when possible to reduce per-tile painting overhead
568         https://bugs.webkit.org/show_bug.cgi?id=154985
569
570         Reviewed by Zalan Bujtas.
571
572         r197541 inadvertently missed FrameView changes that push scrollability data
573         onto the TiledBacking, so didn't actually change behavior (hence the 512x512 tiles
574         in the failing tests).
575
576         Also remove m_tileSizeAtLastRevalidate from TileGrid; it's replaced by a simpler test.
577
578         * page/FrameView.cpp:
579         (WebCore::FrameView::addedOrRemovedScrollbar):
580         * platform/graphics/ca/TileGrid.cpp:
581         (WebCore::TileGrid::revalidateTiles):
582         (WebCore::TileGrid::TileGrid): Deleted.
583         * platform/graphics/ca/TileGrid.h:
584
585 2016-03-04  Simon Fraser  <simon.fraser@apple.com>
586
587         Use BoxExtent instead of EdgeSet in TileController
588         https://bugs.webkit.org/show_bug.cgi?id=155040
589
590         Reviewed by Zalan Bujtas.
591
592         Remove EdgeSet, which was very similar to the existing BoxExtent, and use BoxExtent
593         in TileController.
594
595         * WebCore.xcodeproj/project.pbxproj:
596         * platform/graphics/EdgeSet.h: Removed.
597         (WebCore::EdgeSet::EdgeSet): Deleted.
598         (WebCore::EdgeSet::top): Deleted.
599         (WebCore::EdgeSet::setTop): Deleted.
600         (WebCore::EdgeSet::right): Deleted.
601         (WebCore::EdgeSet::setRight): Deleted.
602         (WebCore::EdgeSet::bottom): Deleted.
603         (WebCore::EdgeSet::setBottom): Deleted.
604         (WebCore::EdgeSet::left): Deleted.
605         (WebCore::EdgeSet::setLeft): Deleted.
606         (WebCore::EdgeSet::operator==): Deleted.
607         (WebCore::EdgeSet::operator!=): Deleted.
608         * platform/graphics/ca/TileController.cpp:
609         (WebCore::TileController::setHasMargins):
610         * platform/graphics/ca/TileController.h:
611
612 2016-03-04  Brent Fulgham  <bfulgham@apple.com>
613
614         [WK2] Gather resource load statistics
615         https://bugs.webkit.org/show_bug.cgi?id=154278
616         <rdar://problem/24702892>
617
618         Reviewed by Andy Estes.
619
620         Tested (now under WK2) by http/tests/navigation/statistics.html
621
622         Split part of the ResourceLoadObserver into a new class (ResourceLoadStatisticsStore)
623         that manages the collection of ResourceLoadStatistic objects, and that can be used
624         in the UIProcess without touching various WebProcess-specific WebCore classes.
625
626         Have the WebProcess only fire a message to the UIProcess if data has been modified. Otherwise,
627         no messages should be sent. When new data is encountered, start a 5 second timer. If more
628         data is found during this delay, just accumulate it. When the timer fires, all data is sent
629         and the timer stops until a new batch of data arrives.
630
631         * CMakeLists.txt: Add the new ResourceLoadStatisticsStore class.
632         * WebCore.xcodeproj/project.pbxproj: Adjust visibility of ResourceLoadStatistics header,
633         and add new ResourceLoadStatisticsStore class.
634         * loader/ResourceLoadObserver.cpp:
635         (WebCore::ResourceLoadObserver::setResourceLoadStatisticsEnabled): Deleted.
636         (WebCore::ResourceLoadObserver::resourceLoadStatisticsEnabled): Deleted.
637         (WebCore::ResourceLoadObserver::setStatisticsStore): Added.
638         (WebCore::ResourceLoadObserver::logFrameNavigation): Tell the ResourceLoadStatisticsStore to fire its 'data changed'
639         handler if necessary.
640         (WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
641         (WebCore::ResourceLoadObserver::logUserInteraction): Ditto.
642         (WebCore::ResourceLoadObserver::statisticsForOrigin): Use new ResourceLoadStatisticsStore.
643         (WebCore::ResourceLoadObserver::isPrevalentResource): Deleted.
644         (WebCore::ResourceLoadObserver::resourceStatisticsForPrimaryDomain): Deleted.
645         (WebCore::ResourceLoadObserver::writeDataToDisk): Deleted.
646         (WebCore::ResourceLoadObserver::setStatisticsStorageDirectory): Deleted.
647         (WebCore::ResourceLoadObserver::persistentStoragePath): Deleted.
648         (WebCore::ResourceLoadObserver::readDataFromDiskIfNeeded): Deleted.
649         (WebCore::ResourceLoadObserver::createDecoderFromDisk): Deleted.
650         (WebCore::ResourceLoadObserver::writeEncoderToDisk): Deleted.
651         * loader/ResourceLoadObserver.h:
652         * loader/ResourceLoadStatistics.cpp:
653         (WebCore::ResourceLoadStatistics::encode): Get rid of unneeded argument.
654         (WebCore::ResourceLoadStatistics::decode): Ditto.
655         (WebCore::mergeHashCountedSet): Added helper function.
656         (WebCore::ResourceLoadStatistics::merge): Added.
657         * loader/ResourceLoadStatistics.h:
658         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
659         * loader/ResourceLoadStatisticsStore.cpp: Added.
660         (WebCore::ResourceLoadStatisticsStore::create):
661         (WebCore::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
662         (WebCore::ResourceLoadStatisticsStore::isPrevalentResource):
663         (WebCore::ResourceLoadStatisticsStore::resourceStatisticsForPrimaryDomain):
664         (WebCore::ResourceLoadStatisticsStore::writeDataToDisk):
665         (WebCore::ResourceLoadStatisticsStore::setStatisticsStorageDirectory):
666         (WebCore::ResourceLoadStatisticsStore::persistentStoragePath):
667         (WebCore::ResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
668         (WebCore::ResourceLoadStatisticsStore::createDecoderFromDisk):
669         (WebCore::ResourceLoadStatisticsStore::writeEncoderToDisk):
670         (WebCore::ResourceLoadStatisticsStore::statisticsForOrigin):
671         (WebCore::ResourceLoadStatisticsStore::takeStatistics):
672         (WebCore::ResourceLoadStatisticsStore::mergeStatistics):
673         (WebCore::ResourceLoadStatisticsStore::setNotificationCallback):
674         (WebCore::ResourceLoadStatisticsStore::fireDataModificationHandler):
675         * loader/ResourceLoadStatisticsStore.h: Added.
676
677 2016-03-04  Konstantin Tokarev  <annulen@yandex.ru>
678
679         Added missing override specifiers under Source/WebCore.
680         https://bugs.webkit.org/show_bug.cgi?id=155021
681
682         Reviewed by Michael Catanzaro.
683
684         No new tests needed.
685
686         * bridge/NP_jsobject.cpp:
687         * css/CSSStyleSheet.cpp:
688         * dom/MutationObserver.cpp:
689         * editing/DictationCommand.cpp:
690         * editing/EditingStyle.cpp:
691         * loader/EmptyClients.cpp:
692         * loader/SinkDocument.cpp:
693         * page/DOMWindow.cpp:
694         * page/animation/CSSPropertyAnimation.cpp:
695         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
696         Also added #if(SOUP) guard to
697         ResourceHandleStreamingClient::getOrCreateReadBuffer
698         because it is not an overridden method otherwise.
699         * platform/text/LineEnding.cpp:
700         * xml/parser/XMLDocumentParserLibxml2.cpp:
701
702 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
703
704         Max out timer throttling immediately for pre-render pages
705         https://bugs.webkit.org/show_bug.cgi?id=155038
706
707         Reviewed by Chris Dumez.
708
709         If a hidden page has never been visible, no need to gently ramp into throttling - treat it
710         the same as a page that has been viewed, but has been in the background for a long time.
711
712         Why? The throttling mechanism scales with the amount of background work by shifting the
713         limit - once all background pages have maxed out the limit, they should no longer be burden
714         of the system. However the mechanism doesn't currently do anything to accelerate towards
715         the limit based on the number of pages in the ramp up phase, and ramp up duration is
716         proportional to limit (so ramping up to a high limit takes a long time). So if you quickly
717         create a large number of hidden pages the system may be under excessive load for a while,
718         as we slowly ramp up to a limit that will adequately constrain resource consumption.
719         In cases where a large number of hidden pages are rapidly generated, many likely remain in
720         the pre-render state, so this mitigation should typically help.
721
722         * page/Page.cpp:
723         (WebCore::Page::updateDOMTimerAlignmentInterval):
724             - if m_isPrerender then m_timerAlignmentInterval is set to the limit.
725         (WebCore::Page::setIsPrerender):
726             - When this changes updateDOMTimerAlignmentInterval().
727
728 2016-03-04  Gavin Barraclough  <barraclough@apple.com>
729
730         Unify determination of page timer alignment
731         https://bugs.webkit.org/show_bug.cgi?id=155031
732
733         Reviewed by Chris Dumez.
734
735         Currently this is scattered throughout Page - sites that call setDOMTimerAlignmentInterval have
736         to determine the correct alignment interval. Instead, replace setDOMTimerAlignmentInterval with
737         updateDOMTimerAlignmentInterval, and unify the policy decision here.
738
739         * page/Page.cpp:
740         (WebCore::Page::setTimerThrottlingState):
741             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
742               Also, to simplify always record the timestamp when the state changes.
743         (WebCore::Page::setTimerAlignmentIntervalIncreaseLimit):
744             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
745         (WebCore::Page::updateDOMTimerAlignmentInterval):
746             - Was setDOMTimerAlignmentInterval, now determines the new alignment value.
747         (WebCore::Page::timerAlignmentIntervalIncreaseTimerFired):
748             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
749         (WebCore::Page::setDOMTimerAlignmentInterval): Deleted.
750             - Removed, became updateDOMTimerAlignmentInterval.
751         * page/Page.h:
752             - setDOMTimerAlignmentInterval -> updateDOMTimerAlignmentInterval
753               m_timerThrottlingEnabledTime -> m_timerThrottlingStateLastChangedTime
754
755 2016-03-04  Simon Fraser  <simon.fraser@apple.com>
756
757         Fix crash seen in iOS simulator tests
758         https://bugs.webkit.org/show_bug.cgi?id=155030
759
760         Reviewed by Tim Horton.
761
762         owningGraphicsLayer() can be null when the tileSizeChangeTimer fires, so null check
763         it and return, as we do for the tileRevalidationTimer.
764
765         * platform/graphics/ca/TileController.cpp:
766         (WebCore::TileController::tileSizeChangeTimerFired):
767
768 2016-03-04  Alex Christensen  <achristensen@webkit.org>
769
770         Remove vcxproj build system
771         https://bugs.webkit.org/show_bug.cgi?id=154388
772
773         Rubber-stamped by Brent Fulgham.
774
775         * WebCore.vcxproj/WebCore.submit.sln: Removed.
776         * WebCore.vcxproj/WebCore.vcxproj: Removed.
777         * WebCore.vcxproj/WebCore.vcxproj.filters: Removed.
778         * WebCore.vcxproj/WebCoreCFNetwork.props: Removed.
779         * WebCore.vcxproj/WebCoreCG.props: Removed.
780         * WebCore.vcxproj/WebCoreCURL.props: Removed.
781         * WebCore.vcxproj/WebCoreCairo.props: Removed.
782         * WebCore.vcxproj/WebCoreCommon.props: Removed.
783         * WebCore.vcxproj/WebCoreDebug.props: Removed.
784         * WebCore.vcxproj/WebCoreDebugWinCairo.props: Removed.
785         * WebCore.vcxproj/WebCoreGenerated.make: Removed.
786         * WebCore.vcxproj/WebCoreGenerated.vcxproj: Removed.
787         * WebCore.vcxproj/WebCoreGenerated.vcxproj.filters: Removed.
788         * WebCore.vcxproj/WebCoreGeneratedCommon.props: Removed.
789         * WebCore.vcxproj/WebCoreGeneratedDebug.props: Removed.
790         * WebCore.vcxproj/WebCoreGeneratedDebugWinCairo.props: Removed.
791         * WebCore.vcxproj/WebCoreGeneratedProduction.props: Removed.
792         * WebCore.vcxproj/WebCoreGeneratedRelease.props: Removed.
793         * WebCore.vcxproj/WebCoreGeneratedReleaseWinCairo.props: Removed.
794         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make: Removed.
795         * WebCore.vcxproj/WebCoreGeneratedWinCairoCommon.props: Removed.
796         * WebCore.vcxproj/WebCoreIncludeCommon.props: Removed.
797         * WebCore.vcxproj/WebCoreMediaQT.props: Removed.
798         * WebCore.vcxproj/WebCorePostBuild.cmd: Removed.
799         * WebCore.vcxproj/WebCorePreBuild.cmd: Removed.
800         * WebCore.vcxproj/WebCoreProduction.props: Removed.
801         * WebCore.vcxproj/WebCoreQuartzCore.props: Removed.
802         * WebCore.vcxproj/WebCoreRelease.props: Removed.
803         * WebCore.vcxproj/WebCoreReleaseWinCairo.props: Removed.
804         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Removed.
805         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Removed.
806         * WebCore.vcxproj/WebCoreTestSupportCommon.props: Removed.
807         * WebCore.vcxproj/WebCoreTestSupportDebug.props: Removed.
808         * WebCore.vcxproj/WebCoreTestSupportDebugWinCairo.props: Removed.
809         * WebCore.vcxproj/WebCoreTestSupportProduction.props: Removed.
810         * WebCore.vcxproj/WebCoreTestSupportRelease.props: Removed.
811         * WebCore.vcxproj/WebCoreTestSupportReleaseWinCairo.props: Removed.
812         * WebCore.vcxproj/build-generated-files.pl: Removed.
813         * WebCore.vcxproj/copyForwardingHeaders.cmd: Removed.
814         * WebCore.vcxproj/copyWebCoreResourceFiles.cmd: Removed.
815         * WebCore.vcxproj/migrate-scripts.pl: Removed.
816
817 2016-03-04  Brady Eidson  <beidson@apple.com>
818
819         Remove use of deprecated sqlite3_expired
820         https://bugs.webkit.org/show_bug.cgi?id=155025
821
822         Reviewed by Tim Horton.
823
824         Since we exclusively use sqlite3_prepare_v2 and don't use sqlite3_prepare,
825         manually checking for expired statements is not necessary.
826
827         * platform/sql/SQLiteStatement.cpp:
828         (WebCore::SQLiteStatement::isExpired): Null check the statement, but don't bother
829           with sqlite3_expired.
830
831 2016-03-04  Daniel Bates  <dabates@apple.com>
832
833         Move CryptoDigest to WebCore/platform
834         https://bugs.webkit.org/show_bug.cgi?id=155008
835         <rdar://problem/24969787>
836
837         Reviewed by Brent Fulgham.
838
839         CryptoDigest provides a platform-independent interface for interacting with platform-
840         specific cryptographic hashing services. We currently make use of this code as part
841         of the implementation of Web Crypto. This code will also be beneficial as part of
842         implementing support for Content Security Policy inline script and inline stylesheet
843         hashes. We should move CryptoDigest to WebCore/platform to convey that it a general
844         purpose platform abstraction.
845
846         * CMakeLists.txt: Add include directory WebCore/platform/crypto.
847         * PlatformEfl.cmake: Add file platform/crypto/gnutls/CryptoDigestGnuTLS.cpp and
848         remove file crypto/gnutls/CryptoDigestGnuTLS.cpp.
849         * PlatformGTK.cmake: Ditto.
850         * PlatformMac.cmake: Add file platform/crypto/mac/CryptoDigestMac.cpp and
851         remove file crypto/mac/CryptoDigestMac.cpp.
852         * WebCore.xcodeproj/project.pbxproj:
853         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
854         (WebCore::CryptoAlgorithmSHA1::digest): Substitute "CryptoDigest::Algorithm" for "CryptoAlgorithmIdentifier".
855         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
856         (WebCore::CryptoAlgorithmSHA224::digest): Ditto.
857         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
858         (WebCore::CryptoAlgorithmSHA256::digest): Ditto.
859         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
860         (WebCore::CryptoAlgorithmSHA384::digest): Ditto.
861         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
862         (WebCore::CryptoAlgorithmSHA512::digest): Ditto.
863         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
864         (WebCore::getCryptoDigestAlgorithm): Converts a CryptoAlgorithmIdentifier enumerator to a
865         CryptoDigest::Algorithm enumerator, if applicable.
866         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign): Write in terms of WebCore::getCryptoDigestAlgorithm().
867         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify): Ditto.
868         * platform/crypto/CryptoDigest.h: Renamed from Source/WebCore/crypto/CryptoDigest.h. Also added enum CryptoDigest::Algorithm
869         and changed constructor to take this enum.
870         * platform/crypto/gnutls/CryptoDigestGnuTLS.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoDigestGnuTLS.cpp.
871         (WebCore::CryptoDigest::CryptoDigest): Substitute "CryptoDigest::Algorithm" for "CryptoAlgorithmIdentifier".
872         (WebCore::CryptoDigest::~CryptoDigest): Ditto.
873         (WebCore::CryptoDigest::create): Ditto.
874         (WebCore::CryptoDigest::addBytes): Ditto.
875         (WebCore::CryptoDigest::computeHash): Ditto.
876         * platform/crypto/mac/CryptoDigestMac.cpp: Renamed from Source/WebCore/crypto/mac/CryptoDigestMac.cpp.
877         (WebCore::toSHA1Context): Ditto.
878         (WebCore::toSHA224Context): Ditto.
879         (WebCore::toSHA256Context): Ditto.
880         (WebCore::toSHA384Context): Ditto.
881         (WebCore::toSHA512Context): Ditto.
882         (WebCore::CryptoDigest::CryptoDigest): Ditto.
883         (WebCore::CryptoDigest::~CryptoDigest): Ditto.
884         (WebCore::CryptoDigest::create): Ditto.
885         (WebCore::CryptoDigest::addBytes): Ditto.
886         (WebCore::CryptoDigest::computeHash): Ditto.
887
888 2016-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
889
890         Whitespace causes font-variant: all-small-caps to synthesize
891         https://bugs.webkit.org/show_bug.cgi?id=155004
892         <rdar://problem/24630796>
893
894         Reviewed by Darin Adler.
895
896         Many fonts (such as Avenir Next) don't report to support whitespace characters under
897         smcp or c2sc. Previously, we were using this as a signal to synthesize small caps
898         instead of true small caps. However, a better solution is for whitespace to never
899         cause synthesis with all-small-caps.
900
901         Test: fast/text/all-small-caps-whitespace.html
902
903         * platform/graphics/mac/ComplexTextController.cpp:
904         (WebCore::shouldSynthesize):
905         (WebCore::ComplexTextController::collectComplexTextRuns):
906
907 2016-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
908
909         [iOS] Crash during font loading when injected bundle cancels load
910         https://bugs.webkit.org/show_bug.cgi?id=155001
911
912         Reviewed by Tim Horton.
913
914         If a injected bundle cancels the load, the fontLoaded() callback will be
915         called twice. We can simply detect this condition.
916
917         Test: CancelLoading.CancelFontSubresource API test
918
919         * css/CSSFontFaceSource.cpp:
920         (WebCore::CSSFontFaceSource::fontLoaded):
921
922 2016-03-03  Ada Chan  <adachan@apple.com>
923
924         The visibility of the airplay menu also depends on whether there's a custom menu item.
925         https://bugs.webkit.org/show_bug.cgi?id=154987
926
927         Reviewed by Darin Adler.
928
929         * html/HTMLMediaElement.cpp:
930         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
931
932 2016-03-04  Timothy Hatcher  <timothy@apple.com>
933
934         Inform WebKit and WebCore if a page is controlled by automation.
935
936         https://bugs.webkit.org/show_bug.cgi?id=154991
937         rdar://problem/24965784
938
939         Reviewed by Joseph Pecoraro.
940
941         * page/Page.h:
942         (WebCore::Page::isControlledByAutomation): Added.
943         (WebCore::Page::setControlledByAutomation): Added.
944
945 2016-03-03  Antti Koivisto  <antti@apple.com>
946
947         ComposedTreeIterator may traverse slotted nodes multiple times
948         https://bugs.webkit.org/show_bug.cgi?id=154983
949
950         Reviewed by Ryosuke Niwa.
951
952         Traversal of slotted nodes can escape to real siblings. Those siblings are then traversed again as slotted nodes.
953
954         Test: fast/shadow-dom/composed-tree-slots.html
955
956         * dom/ComposedTreeIterator.cpp:
957         (WebCore::ComposedTreeIterator::initializeContextStack):
958         (WebCore::ComposedTreeIterator::traverseNextInShadowTree):
959         (WebCore::ComposedTreeIterator::traverseNextLeavingContext):
960         (WebCore::ComposedTreeIterator::advanceInSlot):
961         * dom/ComposedTreeIterator.h:
962         (WebCore::ComposedTreeIterator::Context::Context):
963
964             Include end iterator to the context.
965             For slotted nodes set it up to point to the next sibling of the node.
966
967         (WebCore::ComposedTreeIterator::context):
968         (WebCore::ComposedTreeIterator::traverseNextSkippingChildren):
969
970 2016-03-04  Andreas Kling  <akling@apple.com>
971
972         Drop DocumentSharedObjectPool immediately when going into PageCache.
973         <https://webkit.org/b/154986>
974
975         Reviewed by Antti Koivisto.
976
977         The DocumentSharedObjectPool is a weirdly efficient little optimization
978         that deduplicates ElementData during the first 10s of a Document's lifetime.
979         While it's up, every ElementData created will persist so it can be used for
980         deduplication.
981
982         If a Document goes into the PageCache while its shared object pool is still
983         alive, we can just kill it right away. This will sometimes allow us to free
984         a bunch of ElementData sooner.
985
986         * dom/Document.cpp:
987         (WebCore::Document::Document):
988         (WebCore::Document::setInPageCache):
989         (WebCore::Document::clearSharedObjectPool):
990         (WebCore::Document::sharedObjectPoolClearTimerFired): Deleted.
991         * dom/Document.h:
992
993 2016-03-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
994
995         Remove PassRefPtr from ThreadableLoader and relatives
996         https://bugs.webkit.org/show_bug.cgi?id=154966
997
998         Reviewed by Darin Adler.
999
1000         Covered by existing tests.
1001
1002         * loader/DocumentThreadableLoader.cpp:
1003         (WebCore::DocumentThreadableLoader::create):
1004         * loader/DocumentThreadableLoader.h:
1005         * loader/ThreadableLoader.cpp:
1006         (WebCore::ThreadableLoader::create):
1007         * loader/ThreadableLoader.h:
1008         * loader/WorkerThreadableLoader.cpp:
1009         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
1010         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1011         * loader/WorkerThreadableLoader.h:
1012
1013 2016-03-03  Ryosuke Niwa  <rniwa@webkit.org>
1014
1015         Let XCode have its own way and also sort the file.
1016
1017         * WebCore.xcodeproj/project.pbxproj:
1018
1019 2016-03-03  Chris Dumez  <cdumez@apple.com>
1020
1021         Regression(r196770): Unable to use HipChat Mac app
1022         https://bugs.webkit.org/show_bug.cgi?id=154999
1023         <rdar://problem/24931959>
1024
1025         Reviewed by Darin Adler.
1026
1027         r196770 made [Unforgeable] operations such as Location.reload()
1028         non-writable as per the Web IDL specification. As a result,
1029         trying to set such properties will be ignored in non-strict
1030         mode and will throw an exception is strict mode. This also matches
1031         Firefox and Chrome.
1032
1033         However, this broke the HipChat Mac App (the Web App seems fine)
1034         because it sets Location.reload() and is using strict mode, therefore
1035         causing an exception to be thrown.
1036
1037         This patch adds a quirk to JSLocation::putDelegate() which disable
1038         strict mode when we detect that the application is HipChat. As a
1039         result, we no longer throw when HipChat tries to set Location.reload
1040         and the application is able to connect again.
1041
1042         * bindings/js/JSLocationCustom.cpp:
1043         (WebCore::JSLocation::putDelegate):
1044         Add a quirk which disables strict mode if the application is HipChat.
1045
1046         * platform/RuntimeApplicationChecks.cpp:
1047         (WebCore::mainBundleIdentifier):
1048         Extract this from mainBundleIsEqualTo() so it can be shared with
1049         applicationBundleIdentifier().
1050
1051         (WebCore::applicationBundleIdentifier):
1052         Returns the application bundle identifier, which is a static variable.
1053         For the WebContent / Networking processes, the application bundle
1054         identifier gets set to the UIProcess bundle identifier upon
1055         initialization. If unset, we fall back to using mainBundleIdentifier()
1056         which will do the right thing for the WK2 UIProcess and WK1.
1057
1058         (WebCore::mainBundleIsEqualTo):
1059         Extract part of the code to mainBundleIdentifier() to better share
1060         code.
1061
1062         (WebCore::applicationIsHipChat):
1063         Add utility function that checks if the application is HipChat. This
1064         will do the right thing whether it is called from the UIProcess, the
1065         WebProcess or the UIProcess.
1066
1067         (WebCore::setApplicationBundleIdentifier):
1068         Add utility function to set the application bundle identifier. It gets
1069         called with the UIProcess bundle identifier by the NetworkProcess and
1070         the WebProcess upon initialization.
1071
1072         * platform/RuntimeApplicationChecks.h:
1073
1074 2016-03-03  Keith Miller  <keith_miller@apple.com>
1075
1076         JSArrayBuffers should be collected less aggressively
1077         https://bugs.webkit.org/show_bug.cgi?id=154982
1078
1079         Reviewed by Geoffrey Garen.
1080
1081         We are currently too aggressive in our collection of ArrayBuffer wrappers.
1082         There are three cases where we need to avoid collecting ArrayBuffer wrappers.
1083         1. If the wrapper has custom properties.
1084         2. If the wrapper is a subclass of ArrayBuffer.
1085         3. If the wrapper is in a WeakMap/WeakSet.
1086
1087         Currently, we only pass the first case in WebCore and none in the jsc CLI.
1088         This patch removes some optimizations that cause us to collect when we
1089         should not. Namely, always skipping the object unless it has custom
1090         properties. Additionally, in the case of subclassing, we also need a way
1091         for custom JSArrayBuffer objects to register themselves as the wrapper for
1092         an ArrayBuffer class.
1093
1094         Finally, this patch removes an unnecessary ref() and deref() of
1095         ArrayBuffer objects during the creation/destruction of the wrapper.
1096         Since an ArrayBuffer object's GC lifetime will be at least as long
1097         as the lifetime of the wrapper we are creating for it we don't need
1098         to ref() and deref() the ArrayBuffer object. This lifetime is
1099         guaranteed because ArrayBuffer objects are both GCed and refcounted
1100         and any new wrapper will visit the ArrayBuffer object as long as the
1101         wrapper is still alive.
1102
1103         Test: js/arraybuffer-wrappers.html
1104
1105         * bindings/js/JSDOMBinding.h:
1106         (WebCore::toJS):
1107         * bindings/js/WebCoreTypedArrayController.cpp:
1108         (WebCore::WebCoreTypedArrayController::registerWrapper):
1109         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::finalize):
1110         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots): Deleted.
1111         * bindings/js/WebCoreTypedArrayController.h:
1112
1113 2016-03-03  Simon Fraser  <simon.fraser@apple.com>
1114
1115         Use larger tiles when possible to reduce per-tile painting overhead
1116         https://bugs.webkit.org/show_bug.cgi?id=154985
1117         rdar://problem/23635219
1118
1119         Reviewed by Tim Horton.
1120
1121         There's no reason to use lots of 512x512 tiles on a non-scrollable page. We can reduce
1122         per-tile painting overhead by using one big tile. On vertically scrolling pages, we
1123         can also use wide tiles to reduce tile-crossing when painting. Have FrameView tell
1124         the TiledBacking about scrollability, allowing TileController to make tile size decisions.
1125
1126         Change the "giant tile" code path to just return whether Settings says we're in giant
1127         tile mode, so that tile size decisions can be made in TileController.
1128
1129         TileController now stores a single margin size, and a per-edge margin flag rather than a size
1130         per edge. It computes tile size based on scrollability, but adjusts tile size with some 
1131         hysteresis to avoid size thrashing for content that frequently resizes the document (e.g.
1132         some performance tests).
1133
1134         TileGrid stores a copy of the tile size, so that it remains unchanged from one revalidate
1135         to the next, and the grid can detect when the tile size changes, since it needs to throw away
1136         all tiles in that case.
1137
1138         Tests: tiled-drawing/tile-size-both-scrollable.html
1139                tiled-drawing/tile-size-horizontally-scrollable.html
1140                tiled-drawing/tile-size-unscrollable.html
1141                tiled-drawing/tile-size-vertically-scrollable.html
1142
1143         * WebCore.xcodeproj/project.pbxproj:
1144         * page/FrameView.cpp:
1145         (WebCore::FrameView::addedOrRemovedScrollbar):
1146         (WebCore::FrameView::willStartLiveResize): Tell the tile backing when live resize starts and stops.
1147         (WebCore::FrameView::willEndLiveResize):
1148         * platform/graphics/EdgeSet.h: Added. Template class that just stores some value
1149         per edge.
1150         (WebCore::EdgeSet::EdgeSet):
1151         (WebCore::EdgeSet::top):
1152         (WebCore::EdgeSet::setTop):
1153         (WebCore::EdgeSet::right):
1154         (WebCore::EdgeSet::setRight):
1155         (WebCore::EdgeSet::bottom):
1156         (WebCore::EdgeSet::setBottom):
1157         (WebCore::EdgeSet::left):
1158         (WebCore::EdgeSet::setLeft):
1159         (WebCore::EdgeSet::operator==):
1160         (WebCore::EdgeSet::operator!=):
1161         * platform/graphics/GraphicsLayerClient.h: Rather than have the client return the
1162         tile size, have it return whether we're in giant tile mode.
1163         (WebCore::GraphicsLayerClient::useGiantTiles):
1164         (WebCore::GraphicsLayerClient::tileSize): Deleted.
1165         * platform/graphics/TiledBacking.h:
1166         (WebCore::defaultTileSize): Deleted.
1167         * platform/graphics/ca/GraphicsLayerCA.cpp:
1168         (WebCore::GraphicsLayerCA::platformCALayerUseGiantTiles):
1169         (WebCore::GraphicsLayerCA::platformCALayerTileSize): Deleted.
1170         * platform/graphics/ca/GraphicsLayerCA.h:
1171         * platform/graphics/ca/PlatformCALayerClient.h:
1172         (WebCore::PlatformCALayerClient::platformCALayerUseGiantTiles):
1173         (WebCore::PlatformCALayerClient::platformCALayerTileSize): Deleted.
1174         * platform/graphics/ca/TileController.cpp:
1175         (WebCore::TileController::TileController):
1176         (WebCore::TileController::setScrollability):
1177         (WebCore::TileController::willStartLiveResize):
1178         (WebCore::TileController::didEndLiveResize):
1179         (WebCore::TileController::tileSize):
1180         (WebCore::TileController::setHasMargins):
1181         (WebCore::TileController::setMarginSize):
1182         (WebCore::TileController::hasMargins):
1183         (WebCore::TileController::hasHorizontalMargins):
1184         (WebCore::TileController::hasVerticalMargins):
1185         (WebCore::TileController::topMarginHeight):
1186         (WebCore::TileController::bottomMarginHeight):
1187         (WebCore::TileController::leftMarginWidth):
1188         (WebCore::TileController::rightMarginWidth):
1189         (WebCore::TileController::setTileMargins): Deleted.
1190         * platform/graphics/ca/TileController.h:
1191         * platform/graphics/ca/TileGrid.cpp:
1192         (WebCore::TileGrid::TileGrid):
1193         (WebCore::TileGrid::setNeedsDisplayInRect):
1194         (WebCore::TileGrid::rectForTileIndex):
1195         (WebCore::TileGrid::getTileIndexRangeForRect):
1196         (WebCore::TileGrid::removeAllTiles):
1197         (WebCore::TileGrid::revalidateTiles):
1198         * platform/graphics/ca/TileGrid.h:
1199         (WebCore::TileGrid::tileSize):
1200         * rendering/RenderLayerBacking.cpp:
1201         (WebCore::RenderLayerBacking::setTiledBackingHasMargins):
1202         (WebCore::RenderLayerBacking::useGiantTiles):
1203         (WebCore::RenderLayerBacking::tileSize): Deleted.
1204         * rendering/RenderLayerBacking.h:
1205
1206 2016-03-03  Ryosuke Niwa  <rniwa@webkit.org>
1207
1208         Disallow custom elements inside a window-less documents
1209         https://bugs.webkit.org/show_bug.cgi?id=154944
1210         <rdar://problem/24944875>
1211
1212         Reviewed by Antti Koivisto.
1213
1214         Disallow custom elements inside a window-less documents such as the shared inert document of template elements
1215         and the ones created by DOMImplementation.createDocument and DOMImplementation.createHTMLDocument.
1216
1217         Throw NotSupportedError in defineCustomElement when it's called in such a document as discussed in:
1218         https://github.com/w3c/webcomponents/issues/369
1219
1220         Tests: fast/custom-elements/parser/parser-constructs-custom-element-in-document-write.html
1221                fast/custom-elements/parser/parser-uses-registry-of-owner-document.html
1222
1223         * bindings/js/JSDOMBinding.cpp:
1224         (WebCore::throwNotSupportedError): Added.
1225         * bindings/js/JSDOMBinding.h:
1226         * bindings/js/JSDocumentCustom.cpp:
1227         (WebCore::JSDocument::defineCustomElement): Throw NotSupportedError when the context object's document doesn't
1228         have a browsing context (i.e. window-less).
1229         * html/parser/HTMLDocumentParser.cpp:
1230         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Replaced a FIXME with an assertion now that we
1231         disallow instantiation of custom elements inside a template element.
1232
1233 2016-03-03  Alex Christensen  <achristensen@webkit.org>
1234
1235         Move SPI to CFNetworkSPI.h
1236         https://bugs.webkit.org/show_bug.cgi?id=154992
1237
1238         Reviewed by Andy Estes.
1239
1240         * platform/spi/cf/CFNetworkSPI.h:
1241
1242 2016-03-03  Alex Christensen  <achristensen@webkit.org>
1243
1244         Use CredentialStorage with NetworkSession
1245         https://bugs.webkit.org/show_bug.cgi?id=154939
1246
1247         Reviewed by Darin Adler.
1248
1249         This makes the credential-based http tests pass when using NetworkSession.
1250
1251         * platform/network/CredentialBase.h:
1252         (WebCore::CredentialBase::encodingRequiresPlatformData):
1253         * platform/network/CredentialStorage.h:
1254         WEBCORE_EXPORT more things that are newly used in WebKit2.
1255
1256 2016-03-03  Zalan Bujtas  <zalan@apple.com>
1257
1258         Subpixel rendering: Make collapsed borders painting subpixel aware.
1259         https://bugs.webkit.org/show_bug.cgi?id=154980
1260
1261         Reviewed by David Hyatt.
1262
1263         This patch enables collapsed borders with odd pixel width paint on subpixel position.
1264         Currently borders with odd pixels are split at integral position so that border-width: 3px;
1265         paints 1px on the left(top) and 2px on the right(bottom) side. With this patch
1266         we paint 1.5px on both sides(on 2x display).
1267
1268         Test: fast/table/hidpi-collapsed-border-with-odd-pixel-width.html
1269
1270         * rendering/RenderTableCell.cpp:
1271         (WebCore::RenderTableCell::paintCollapsedBorders):
1272
1273 2016-03-03  Dave Hyatt  <hyatt@apple.com>
1274
1275         Add support for the "last" value of hanging-punctuation
1276         https://bugs.webkit.org/show_bug.cgi?id=154977
1277
1278         Reviewed by Darin Adler and Simon Fraser.
1279
1280         New tests in fast/text.
1281
1282         This patch adds support for the new "last" value and also fixes up both
1283         "first" and "last" to work with leading and trailing whitespace that ends
1284         up getting collapsed away.
1285
1286         * rendering/RenderBlockFlow.cpp:
1287         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
1288         * rendering/RenderBlockLineLayout.cpp:
1289         (WebCore::inlineAncestorHasStartBorderPaddingOrMargin):
1290         (WebCore::inlineAncestorHasEndBorderPaddingOrMargin):
1291         (WebCore::isLastInFlowRun):
1292         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1293         * rendering/RenderText.cpp:
1294         (WebCore::isHangablePunctuationAtLineEnd):
1295         (WebCore::RenderText::hangablePunctuationStartWidth):
1296         (WebCore::RenderText::hangablePunctuationEndWidth):
1297         (WebCore::RenderText::firstCharacterIndexStrippingSpaces):
1298         (WebCore::RenderText::lastCharacterIndexStrippingSpaces):
1299         (WebCore::RenderText::trimmedPrefWidths):
1300         * rendering/RenderText.h:
1301         * rendering/line/BreakingContext.h:
1302         (WebCore::BreakingContext::handleText):
1303
1304 2016-03-03  Andy Estes  <aestes@apple.com>
1305
1306         Adopt CFNetwork storage partitioning SPI
1307         https://bugs.webkit.org/show_bug.cgi?id=154957
1308         rdar://problem/23614620
1309
1310         Reviewed by Darin Adler.
1311
1312         Adopt CFNetwork SPI for creating storage partitions. If Settings::cookieStoragePartitioningEnabled() is true,
1313         create cookie storage partitions for third-party contexts. This feature is disabled by default.
1314
1315         No new tests. Test support is tracked by <https://webkit.org/b/154958>.
1316
1317         * page/Settings.cpp:
1318         (WebCore::Settings::setCookieStoragePartitioningEnabled): Controls whether storage partitioning for cookies is enabled.
1319         * page/Settings.h:
1320         (WebCore::Settings::cookieStoragePartitioningEnabled):
1321         * platform/network/NetworkStorageSession.h:
1322         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1323         (WebCore::cookieStoragePartition): Computes a storage partition identifier by determining the top
1324         privately-controlled domain of the cookie's first-party (main frame document) URL, then determining whether the
1325         cookie's document hostname is a subdomain of it. If is is not, the first-party top domain is the partition name.
1326         Otherwise, there is no partition name.
1327         * platform/network/mac/CookieJarMac.mm:
1328         (WebCore::applyPartitionToCookies): Returns a deep copy of the given cookie array after adding a storage
1329         partition property to each copied cookie.
1330         (WebCore::cookiesInPartitionForURL): Returns cookies for the partition computed by the given URLs. If no
1331         partition can be determined, nil is returned.
1332         (WebCore::cookiesForURL): Returns cookiesInPartitionForURL() if non-nil, otherwise returns wkHTTPCookiesForURL().
1333         (WebCore::cookiesForSession): Started calling cookiesForURL().
1334         (WebCore::setCookiesFromDOM): Called applyPartitionToCookies() if a partition can be computed from the given URLs.
1335         (WebCore::getRawCookies): Started calling cookiesForURL().
1336         * platform/network/mac/ResourceHandleMac.mm:
1337         (WebCore::ResourceHandle::createNSURLConnection): Computed the storage partition identifier for the new request.
1338         If non-empty, set it as a property on the NSURLRequest where CFNetwork knows to find it.
1339         * platform/spi/cf/CFNetworkSPI.h: Declare new SPI for building with the public SDK.
1340
1341 2016-03-03  Manuel Rego Casasnovas  <rego@igalia.com>
1342
1343         [css-grid] Fix order of grid shorthands in CSSPropertyNames.in
1344         https://bugs.webkit.org/show_bug.cgi?id=154915
1345
1346         Reviewed by Darin Adler.
1347
1348         The order of columns and rows in grid and grid-template shorthands
1349         has been swapped recently (r196906 & r196934).
1350         However the order was not updated in CSSPropertyNames.in file.
1351
1352         * css/CSSPropertyNames.in:
1353
1354 2016-03-03  Alexey Proskuryakov  <ap@apple.com>
1355
1356         AllInOne build fix.
1357
1358         * rendering/RenderFlexibleBox.cpp:
1359         * rendering/RenderGrid.cpp:
1360         Don't have two static functions with the same name.
1361
1362 2016-03-03  Chris Dumez  <cdumez@apple.com>
1363
1364         Drop [TreatNullAs=EmptyString] from URL interface attributes
1365         https://bugs.webkit.org/show_bug.cgi?id=154951
1366
1367         Reviewed by Darin Adler.
1368
1369         Drop [TreatNullAs=EmptyString] from URL interface attributes to match
1370         the specification:
1371         - https://url.spec.whatwg.org/#api
1372
1373         Firefox and Chrome both already follow the specification and convert
1374         null to the "null" string.
1375
1376         No new tests, already covered by existing tests.
1377
1378         * html/URLUtils.idl:
1379
1380 2016-03-03  Miguel Gomez  <magomez@igalia.com>
1381
1382         [TextureMapper] Use RGBA format for textures attached to framebuffers
1383         https://bugs.webkit.org/show_bug.cgi?id=154965
1384
1385         Reviewed by Žan Doberšek.
1386
1387         Use RGBA format when allocating textures that will be used as framebuffer
1388         attachments. This means adding a new flag to BitmapTexture and modifying
1389         BitmapTextureGL to use the appropriate format according to the flag. Also,
1390         BitmapTexturePool needs to use two vectors to handle both types of textures
1391         separately, as we want to avoid constantly switching the format of a reused
1392         texture.
1393
1394         No new tests since the behavior change is covered by existing tests.
1395
1396         * platform/graphics/texmap/BitmapTexture.h: Add new flag.
1397         * platform/graphics/texmap/BitmapTextureGL.cpp:
1398         (WebCore::BitmapTextureGL::BitmapTextureGL): Receive flags on constructor and use RGBA
1399         when the FBOAttachment flag is enabled.
1400         (WebCore::BitmapTextureGL::applyFilters): Use FBOAttachemt flag to request a texture.
1401         * platform/graphics/texmap/BitmapTextureGL.h: Add flags to the constructor.
1402         * platform/graphics/texmap/BitmapTexturePool.cpp: Add a new vector of textures to hold
1403         those in RGBA format.
1404         (WebCore::BitmapTexturePool::acquireTexture): Return a texture for the usage specified
1405         in the incoming flags.
1406         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired): Release textures from
1407         both vectors.
1408         (WebCore::BitmapTexturePool::createTexture): Pass the usage flag when creating a new
1409         texture.
1410         * platform/graphics/texmap/BitmapTexturePool.h: Add new texture vector and add flags to
1411         the needed headers.
1412         * platform/graphics/texmap/TextureMapper.cpp:
1413         (WebCore::TextureMapper::acquireTextureFromPool): Pass the received flags to the BitmapTexturePool.
1414         * platform/graphics/texmap/TextureMapperLayer.cpp:
1415         (WebCore::TextureMapperLayer::paintIntoSurface): Use FBOAttachemt flag to request a texture.
1416
1417 2016-03-03  Javier Fernandez  <jfernandez@igalia.com>
1418
1419         [CSS Box Alignment] New CSS Value 'normal' for Content Alignment
1420         https://bugs.webkit.org/show_bug.cgi?id=154282
1421
1422         Reviewed by David Hyatt.
1423
1424         The Box Alignment specification defines a new value 'normal' to be used
1425         as default for the different layout models, which will define the
1426         specific behavior for each case. This patch adds a new CSS value in the
1427         parsing logic and adapts the Content Alignment properties to the new
1428         value.
1429
1430         The 'auto' value is no longer valid and the Computed Value will be
1431         always the specified value. Hence, I removed the StyleResolver logic
1432         because is not required now; the specific behavior of the 'normal'
1433         value will be resolved at layout time.
1434
1435         Computed value of both align-content and justify-content is the
1436         specified value, we don't have to resolve any 'auto' value now.
1437
1438         Additionally, this patch updates the layout logic as well, for both
1439         Flexbox and Grid layout models.
1440
1441         No new tests, since we only need to rebaseline those test cases
1442         affected by the new default computed value.
1443
1444         * css/CSSComputedStyleDeclaration.cpp:
1445         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
1446         (WebCore::ComputedStyleExtractor::propertyValue):
1447         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Deleted.
1448         (WebCore::CSSComputedStyleDeclaration::copyProperties): Deleted.
1449         (WebCore::nodeOrItsAncestorNeedsStyleRecalc): Deleted.
1450         (WebCore::isFlexOrGrid): Deleted.
1451         (WebCore::ComputedStyleExtractor::customPropertyValue): Deleted.
1452         * css/CSSParser.cpp:
1453         (WebCore::CSSParser::parseContentDistributionOverflowPosition):
1454         * css/CSSPrimitiveValueMappings.h:
1455         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1456         (WebCore::CSSPrimitiveValue::operator ContentPosition):
1457         * rendering/RenderFlexibleBox.cpp:
1458         (WebCore::normalValueBehavior):
1459         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
1460         (WebCore::RenderFlexibleBox::layoutColumnReverse):
1461         (WebCore::RenderFlexibleBox::alignFlexLines):
1462         (WebCore::alignContentSpaceBetweenChildren): Deleted.
1463         * rendering/RenderGrid.cpp:
1464         (WebCore::normalValueBehavior):
1465         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
1466         (WebCore::RenderGrid::columnAxisOffsetForChild):
1467         (WebCore::RenderGrid::rowAxisOffsetForChild):
1468         (WebCore::resolveContentDistributionFallback):
1469         (WebCore::contentDistributionOffset):
1470         (WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
1471         * rendering/style/RenderStyle.cpp:
1472         (WebCore::resolvedContentAlignmentPosition):
1473         (WebCore::resolvedContentAlignmentDistribution):
1474         (WebCore::RenderStyle::resolvedJustifyContentPosition):
1475         (WebCore::RenderStyle::resolvedJustifyContentDistribution):
1476         (WebCore::RenderStyle::resolvedAlignContentPosition):
1477         (WebCore::RenderStyle::resolvedAlignContentDistribution):
1478         * rendering/style/RenderStyle.h:
1479         * rendering/style/RenderStyleConstants.h:
1480
1481 2016-03-03  Antti Koivisto  <antti@apple.com>
1482
1483         Slider thumb style should not depend on renderers
1484         https://bugs.webkit.org/show_bug.cgi?id=154961
1485
1486         Reviewed by Andreas Kling.
1487
1488         Currently slider thumb pseudo id is computed based on host element renderer.
1489         Style is the input for building a render tree and should be computable without having one.
1490
1491         * html/shadow/SliderThumbElement.cpp:
1492         (WebCore::SliderThumbElement::hostInput):
1493         (WebCore::SliderThumbElement::customStyleForRenderer):
1494
1495             Compute pseudo id based on the host style.
1496             Return nullptr so style recalc will otherwise proceed normally.
1497
1498         (WebCore::SliderThumbElement::shadowPseudoId):
1499         (WebCore::SliderThumbElement::cloneElementWithoutAttributesAndChildren):
1500         (WebCore::SliderContainerElement::SliderContainerElement):
1501         (WebCore::SliderContainerElement::create):
1502         (WebCore::SliderContainerElement::createElementRenderer):
1503         (WebCore::SliderContainerElement::customStyleForRenderer):
1504
1505             Here too.
1506
1507         (WebCore::SliderContainerElement::shadowPseudoId):
1508         (WebCore::sliderThumbShadowPseudoId): Deleted.
1509         (WebCore::mediaSliderThumbShadowPseudoId): Deleted.
1510         * html/shadow/SliderThumbElement.h:
1511
1512 2016-03-03  Manuel Rego Casasnovas  <rego@igalia.com>
1513
1514         [css-grid] Simplify method to resolve auto-placed items
1515         https://bugs.webkit.org/show_bug.cgi?id=154911
1516
1517         Reviewed by Sergio Villar Senin.
1518
1519         Refactor the method to resolve auto-placed items
1520         as we're only interested in knowing the span size.
1521
1522         Adapt the calls to use the span size instead of a GridSpan.
1523
1524         No new tests, no change of behavior.
1525
1526         * rendering/RenderGrid.cpp:
1527         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
1528         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
1529         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
1530         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
1531         * rendering/style/GridResolvedPosition.cpp:
1532         (WebCore::GridResolvedPosition::spanSizeForAutoPlacedItem):
1533         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
1534         Renamed to spanSizeForAutoPlacedItem().
1535         * rendering/style/GridResolvedPosition.h:
1536
1537 2016-03-02  Chris Dumez  <cdumez@apple.com>
1538
1539         HTMLFormElement's named property getter does not return a RadioNodelist
1540         https://bugs.webkit.org/show_bug.cgi?id=154949
1541
1542         Reviewed by Ryosuke Niwa.
1543
1544         HTMLFormElement's named property getter should return a RadioNodeList
1545         when there are several matches:
1546         https://html.spec.whatwg.org/multipage/forms.html#the-form-element
1547
1548         Previously, WebKit returned a generic NodeList. As a result, users
1549         cannot create a white-and-gold hat in the MAKE A HAT GREAT AGAIN
1550         section at:
1551         https://www.washingtonpost.com/news/the-fix/wp/2015/10/06/hey-lets-all-make-our-own-donald-trump-hats/
1552
1553         Chrome and Firefox already match the specification. Edge will soon.
1554
1555         Test: fast/dom/HTMLFormElement/named-property-getter-radionodelist.html
1556
1557         * bindings/js/JSHTMLFormElementCustom.cpp:
1558         (WebCore::JSHTMLFormElement::nameGetter):
1559
1560 2016-03-02  Chris Dumez  <cdumez@apple.com>
1561
1562         Drop [TreatNullAs=LegacyNullString] from HTMLBaseElement.href
1563         https://bugs.webkit.org/show_bug.cgi?id=154952
1564
1565         Reviewed by Ryosuke Niwa.
1566
1567         Drop [TreatNullAs=LegacyNullString] from HTMLBaseElement.href as this
1568         does not match the specification:
1569         - https://html.spec.whatwg.org/multipage/semantics.html#the-base-element
1570
1571         Firefox and Chrome both convert null to the string "null".
1572
1573         No new tests, updated the following existing test:
1574         fast/dom/HTMLBaseElement/href-attribute-resolves-with-respect-to-document.html
1575
1576         * html/HTMLBaseElement.idl:
1577
1578 2016-03-02  Zalan Bujtas  <zalan@apple.com>
1579
1580         Paint table borders on empty cells even in quirks mode.
1581         https://bugs.webkit.org/show_bug.cgi?id=154928
1582
1583         Reviewed by David Hyatt.
1584
1585         Enable border painting for empty cells unless 'empty-cells: hide' is set. 
1586         This is inline with FF and Chrome behaviour.
1587
1588         Test: fast/table/border-on-empty-table-cells-quirks-mode.html
1589
1590         * rendering/RenderTableCell.cpp:
1591         (WebCore::RenderTableCell::paintBoxDecorations):
1592
1593 2016-03-02  Ryosuke Niwa  <rniwa@webkit.org>
1594
1595         HTML parser instantiates a custom element inside a template element with a wrong owner document
1596         https://bugs.webkit.org/show_bug.cgi?id=154936
1597
1598         Reviewed by Chris Dumez.
1599
1600         The bug was caused by our implementation following the old spec which didn't create a appropriate template
1601         contents owner document [1] for a document without a browsing context. The new spec no longer has this clause,
1602         and we should be always creating the appropriate template contents owner document unless the document itself
1603         is an appropriate template contents owner document for another document (comes up in nested template elements).
1604
1605         No new tests since the behavior change is covered by existing tests.
1606
1607         [1] https://html.spec.whatwg.org/#appropriate-template-contents-owner-document
1608
1609         * dom/Document.h:
1610         (WebCore::Document::templateDocument):
1611
1612 2016-03-02  Gavin Barraclough  <barraclough@apple.com>
1613
1614         PageThrottler should apply hysteresis to media activity
1615         https://bugs.webkit.org/show_bug.cgi?id=154940
1616
1617         Reviewed by Ryosuke Niwa.
1618
1619         Currently PageThrottler keeps a track of audible plugin activity and HTML media element
1620         activity separately. Audible plugin activity also gets an extra 5s hysteresis applied,
1621         so that after audio playback has completed there is a chance to queue up more audio
1622         before timer throttling kicks in. HTML audio does not get this grace. Funnel both
1623         together into a single activity flag, such that the hysteresis is applied to both.
1624
1625         * page/PageThrottler.cpp:
1626         (WebCore::PageThrottler::PageThrottler):
1627         (WebCore::m_mediaActivityHysteresis):
1628             - PageActivityState::AudiblePlugin -> PageActivityState::MediaActivity.
1629         (WebCore::m_mediaActivityCounter):
1630             - when m_mediaActivityCounter value changes call mediaActivityCounterChanged().
1631         (WebCore::PageThrottler::mediaActivityCounterChanged):
1632             - Drive PageActivityState::MediaActivity indirectly via m_mediaActivityHysteresis,
1633               such that a 5s hysteresis is applied.
1634         * page/PageThrottler.h:
1635             - Removed AudiblePlugin (merged in with MediaActivity).
1636         (WebCore::PageThrottler::pluginDidEvaluateWhileAudioIsPlaying):
1637             - m_audiblePluginHysteresis.impulse -> m_mediaActivityHysteresis.impulse.
1638
1639 2016-03-01  Ada Chan  <adachan@apple.com>
1640
1641         Update the media element's presentation mode properly after going in and out of full screen via the Full Screen API
1642         https://bugs.webkit.org/show_bug.cgi?id=154834
1643
1644         Reviewed by Simon Fraser.
1645
1646         * dom/Document.cpp:
1647         (WebCore::Document::webkitWillEnterFullScreenForElement):
1648         * dom/Element.cpp:
1649         (WebCore::Element::willBecomeFullscreenElement):
1650         * dom/Element.h:
1651         (WebCore::Element::ancestorWillEnterFullscreen):
1652         * html/HTMLMediaElement.cpp:
1653         (WebCore::HTMLMediaElement::enterFullscreen):
1654         If the Full Screen API is enabled and this media element is entering a mode other than standard
1655         full screen, see if it's currently contained in a full screen element. If so, exit full screen.
1656         (WebCore::HTMLMediaElement::willBecomeFullscreenElement):
1657         If this media element is going to standard full screen, update its presentation mode. If
1658         this media element also supports presentation mode and it currently has a presentation mode
1659         that's not standard full screen, exit that presentation mode directly without animation.
1660         (WebCore::HTMLMediaElement::willStopBeingFullscreenElement):
1661         Set the presentation mode back to inline unless it's already changed to a different
1662         presentation mode.
1663         * html/HTMLMediaElement.h:
1664         * html/HTMLVideoElement.cpp:
1665         (WebCore::HTMLVideoElement::ancestorWillEnterFullscreen):
1666         Reset this video element's presentation state to inline if its ancestor is going to full screen.
1667         (WebCore::HTMLVideoElement::exitToFullscreenModeWithoutAnimationIfPossible):
1668         If the fullscreen mode the video element is exiting from is supported, exit that mode to the new mode.
1669         * html/HTMLVideoElement.h:
1670         * page/ChromeClient.h:
1671         * platform/mac/WebVideoFullscreenInterfaceMac.h:
1672         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1673         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode):
1674
1675 2016-03-02  Brady Eidson  <beidson@apple.com>
1676
1677         Modern IDB: Close UniqueIDBDatabases once they become unused.
1678         https://bugs.webkit.org/show_bug.cgi?id=154922
1679
1680         Reviewed by Alex Christensen.
1681
1682         Tests: storage/indexeddb/modern/256-open-databases.html
1683                storage/indexeddb/modern/exceed-open-file-limit.html
1684
1685         Without this change, attempts to open a 256th database in the DatabaseProcess will fail on Mac.
1686         
1687         Due to SQLite journal files, this limit could come up as early as 128 databases if they are all
1688         in active use.
1689         
1690         This is because launchd - by default - limits xpc services to having 256 open file handles by default.
1691         
1692         While we should explore raising the limit, we should also close databases we no longer need.
1693         
1694         * Modules/indexeddb/server/IDBBackingStore.h:
1695
1696         * Modules/indexeddb/server/IDBServer.cpp:
1697         (WebCore::IDBServer::IDBServer::closeUniqueIDBDatabase):
1698         (WebCore::IDBServer::IDBServer::deleteUniqueIDBDatabase): Deleted.
1699         * Modules/indexeddb/server/IDBServer.h:
1700
1701         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1702         (WebCore::IDBServer::MemoryBackingStoreTransaction::MemoryBackingStoreTransaction):
1703
1704         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1705         (WebCore::IDBServer::MemoryIDBBackingStore::getOrEstablishDatabaseInfo):
1706         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1707
1708         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1709         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
1710         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1711
1712         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1713         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
1714         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
1715         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation): Handle the case where opening
1716           the backing store failed by firing an error event instead of pretending everything is okay.
1717         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
1718         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
1719         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
1720         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
1721         (WebCore::IDBServer::UniqueIDBDatabase::isCurrentlyInUse):
1722         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired): If the database is not
1723           currently in use, close it.
1724         (WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted):
1725         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1726         (WebCore::IDBServer::UniqueIDBDatabase::deletePending): Deleted.
1727
1728         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
1729         (WebCore::IDBObjectStoreInfo::isolatedCopy): Actually get this right.
1730
1731 2016-03-02  Gavin Barraclough  <barraclough@apple.com>
1732
1733         Disable timer throttling increases for visually idle / active pages.
1734         https://bugs.webkit.org/show_bug.cgi?id=154935
1735
1736         Reviewed by Chris Dumez.
1737
1738         Currently any page that is visually idle can timer throttle, and all are eligible for throttling
1739         allow throttling to increase.
1740
1741         Instead, still allow any visually idle page to timer throttle, but only allow increasing in those
1742         that are fully hidden & inactive (no page loading or media activity).
1743
1744         * page/Page.cpp:
1745         (WebCore::Page::setTimerThrottlingState):
1746             - Updated policy per commet above.
1747         (WebCore::Page::setPageActivityState):
1748         (WebCore::Page::setIsVisible):
1749             - We now may need to updated timer throttling when these change.
1750
1751 2016-03-02  Konstantin Tokarev  <annulen@yandex.ru>
1752
1753         [cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK.
1754         https://bugs.webkit.org/show_bug.cgi?id=154651
1755
1756         Reviewed by Alex Christensen.
1757
1758         No new tests needed.
1759
1760         * CMakeLists.txt: Moved shared code to WEBKIT_FRAMEWORK macro.
1761
1762 2016-03-02  Dave Hyatt  <hyatt@apple.com>
1763
1764         Add support for the "first" value of the hanging-punctuation property.
1765         https://bugs.webkit.org/show_bug.cgi?id=154919
1766
1767         Reviewed by Simon Fraser.
1768
1769         New tests added in fast/text.
1770
1771         Implement the "first" value for hanging-punctuation as described here:
1772         https://drafts.csswg.org/css-text-3/#propdef-hanging-punctuation
1773
1774         * rendering/RenderBlockFlow.cpp:
1775         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
1776         Update the preferred logical width computation to factor in hanging punctuation.
1777         This check is similar to the text-indent logic in that we only want to do it for
1778         the first formatted line.
1779
1780         * rendering/RenderBlockFlow.h:
1781         (WebCore::RenderBlockFlow::simpleLineLayout):
1782         Make sure to turn off simple line layout when hanging punctuation is present. Eventually
1783         it should be feasible to support this in simple line layout, but since the full line
1784         layout model has to work with it anyway, we are starting there.
1785
1786         * rendering/RenderBlockLineLayout.cpp:
1787         (WebCore::inlineAncestorHasStartBorderPaddingOrMargin):
1788         (WebCore::isLastInFlowRun):
1789         Helper functions that are needed to determine whether or not we're allowed to apply
1790         hanging punctuation "first" to a text run.
1791
1792         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1793         This function manipulates logicalLeft and availableWidth when hanging punctuation
1794         is present to shift the line as needed and to expand the availableWidth of the line.
1795
1796         * rendering/RenderText.cpp:
1797         (WebCore::isHangablePunctuationAtLineStart):
1798         (WebCore::isHangablePunctuationAtLineEnd):
1799         (WebCore::RenderText::hangablePunctuationStartWidth):
1800         (WebCore::RenderText::trimmedPrefWidths):
1801         * rendering/RenderText.h:
1802         RenderText has a helper function for handing back the hangable punctuation width. This
1803         is used everywhere line layout wants to apply that offset. There are also helper functions
1804         that detect whether the character is a hangable punctuation character.
1805
1806         * rendering/SimpleLineLayout.cpp:
1807         (WebCore::SimpleLineLayout::canUseForWithReason):
1808         (WebCore::SimpleLineLayout::printReason):
1809         Turn off simple line layout when hanging punctuation is enabled.
1810
1811         * rendering/line/BreakingContext.h:
1812         (WebCore::BreakingContext::handleText):
1813         Modified to expand the available width when hanging punctuation is present so that we
1814         know we have more room on the line.
1815
1816         * rendering/line/LineWidth.h:
1817         (WebCore::LineWidth::isFirstLine):
1818         Add an accessor for whether or not we're the first line.
1819
1820 2016-03-01  Ryosuke Niwa  <rniwa@webkit.org>
1821
1822         Make HTML parser construct custom elements
1823         https://bugs.webkit.org/show_bug.cgi?id=154908
1824         <rdar://problem/24923735>
1825
1826         Reviewed by Antti Koivisto.
1827
1828         Added the support for instantiating custom elements inside the parser. Based on Jan F2F discussion,
1829         the HTML parser is going to synchronously construct custom elements. When a custom element constructor
1830         throws, the HTML parser creates a HTMLUnknownElement instead.
1831
1832         In our implementation, we pause the parser completely and construct custom elements using the same
1833         mechanism used to run author scripts. It's possible that we may want to apply some optimizations to
1834         to make custom element construction but it's probably a good idea to get semantics right first.
1835
1836         Tests: fast/custom-elements/parser/parser-constructs-custom-elements.html
1837                fast/custom-elements/parser/parser-fallsback-to-unknown-element.html
1838                fast/custom-elements/parser/parser-sets-attributes-and-children.html
1839                fast/custom-elements/parser/parser-uses-constructed-element.html
1840
1841         * bindings/js/JSCustomElementInterface.cpp:
1842         (WebCore::JSCustomElementInterface::constructElement): Added ShouldClearException as an argument
1843         to be used by the HTML parser since the parser can't re-throw to anywhere or fail parsing.
1844
1845         * bindings/js/JSCustomElementInterface.h:
1846         (WebCore::JSCustomElementInterface::ShouldClearException): Added.
1847
1848         * dom/Document.cpp:
1849         (WebCore::createHTMLElementWithNameValidation): Do not clear the exception here since createElement
1850         must re-throw the exception thrown by a custom element constructor.
1851         (WebCore::Document::createElementForBindings):
1852
1853         * dom/make_names.pl:
1854         (printFactoryCppFile): Added ConstructorFunctionMapEntry which contains the constructor function
1855         as well as the qualified name.
1856         (printFactoryHeaderFile): Added a variant of createKnownElement and createElement that takes
1857         AtomicString instead of QualifiedName.
1858
1859         * html/parser/HTMLConstructionSite.cpp:
1860         (WebCore::setAttributes): Added a variant that takes Vector<Attribute>.
1861         (WebCore::HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface): Added. Returns a
1862         custom element interface when the element doesn't match any builtin element and there is a custom
1863         element definition that matches the specified name.
1864         (WebCore::HTMLConstructionSite::insertCustomElement): Added. Like insertElement but also sets the
1865         attributes on the newly created custom element.
1866         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): Extracted from
1867         createHTMLElement. When customElementInterface is not nullptr, we optionally find the custom
1868         element interface and return nullptr.
1869         (WebCore::HTMLConstructionSite::createHTMLElement):
1870         * html/parser/HTMLConstructionSite.h:
1871
1872         * html/parser/HTMLDocumentParser.cpp:
1873         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Create a custom element when there
1874         is a pending custom element to create (i.e. m_customElementToConstruct is not empty).
1875         (WebCore::HTMLDocumentParser::isWaitingForScripts):
1876
1877         * html/parser/HTMLStackItem.h:
1878         (WebCore::HTMLStackItem::create): Added a variant used for custom elements.
1879         (WebCore::HTMLStackItem::HTMLStackItem): Ditto.
1880
1881         * html/parser/HTMLTreeBuilder.cpp:
1882         (WebCore::CustomElementConstructionData::CustomElementConstructionData): Added. It needs to be in
1883         the cpp file to avoid introducing more header dependencies in HTMLTreeBuilder.h.
1884         (WebCore::CustomElementConstructionData::~CustomElementConstructionData): Ditto.
1885         (WebCore::HTMLTreeBuilder::processStartTagForInBody): Use insertGenericHTMLElement when creating
1886         a generic element that could be custom elements.
1887         (WebCore::HTMLTreeBuilder::insertGenericHTMLElement): Added. Create and insert a new element
1888         or set m_customElementToConstruct so that the HTMLDocumentParser will create a custom element later.
1889         (WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement): Added. Called by HTMLDocumentParser
1890         when it finishes creating a new custom element.
1891
1892         * html/parser/HTMLTreeBuilder.h:
1893         (WebCore::HTMLTreeBuilder::takeCustomElementConstructionData): Added.
1894         (WebCore::HTMLTreeBuilder::hasParserBlockingScriptWork): Renamed from hasParserBlockingScript.
1895         Checks the existence of m_customElementToConstruct as well as m_scriptToProcess.
1896
1897 2016-03-02  Zalan Bujtas  <zalan@apple.com>
1898
1899         Use IndentTextOrNot instead of passing isFirstLine/shouldIndentText as bool.
1900         https://bugs.webkit.org/show_bug.cgi?id=154628
1901
1902         Reviewed by Simon Fraser.
1903
1904         No change in behaviour.
1905
1906         * rendering/RenderBlock.cpp:
1907         (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
1908         (WebCore::RenderBlock::logicalLeftSelectionOffset):
1909         (WebCore::RenderBlock::logicalRightSelectionOffset):
1910         * rendering/RenderBlock.h:
1911         (WebCore::RenderBlock::availableLogicalWidthForLineInRegion):
1912         (WebCore::RenderBlock::logicalRightOffsetForLineInRegion):
1913         (WebCore::RenderBlock::logicalLeftOffsetForLineInRegion):
1914         (WebCore::RenderBlock::startOffsetForLineInRegion):
1915         (WebCore::RenderBlock::endOffsetForLineInRegion):
1916         (WebCore::RenderBlock::availableLogicalWidthForLine):
1917         (WebCore::RenderBlock::logicalRightOffsetForLine):
1918         (WebCore::RenderBlock::logicalLeftOffsetForLine):
1919         (WebCore::RenderBlock::startOffsetForLine):
1920         (WebCore::RenderBlock::endOffsetForLine):
1921         * rendering/RenderBlockFlow.cpp:
1922         (WebCore::RenderBlockFlow::getClearDelta):
1923         * rendering/RenderBlockLineLayout.cpp:
1924         (WebCore::updateLogicalInlinePositions):
1925         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1926         (WebCore::RenderBlockFlow::deleteEllipsisLineBoxes):
1927         (WebCore::RenderBlockFlow::checkLinesForTextOverflow):
1928         (WebCore::RenderBlockFlow::startAlignedOffsetForLine):
1929         * rendering/RenderBox.cpp:
1930         (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
1931         (WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):
1932         * rendering/RenderDeprecatedFlexibleBox.cpp:
1933         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
1934         * rendering/RenderListItem.cpp:
1935         (WebCore::RenderListItem::positionListMarker):
1936         * rendering/RootInlineBox.cpp:
1937         (WebCore::RootInlineBox::selectionTop):
1938         (WebCore::RootInlineBox::selectionBottom):
1939         * rendering/SimpleLineLayout.cpp:
1940         (WebCore::SimpleLineLayout::canUseForWithReason):
1941         (WebCore::SimpleLineLayout::updateLineConstrains):
1942         * rendering/line/LineBreaker.cpp:
1943         (WebCore::LineBreaker::skipLeadingWhitespace):
1944         * rendering/line/LineWidth.cpp:
1945         (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
1946         (WebCore::availableWidthAtOffset):
1947         * rendering/line/LineWidth.h:
1948         (WebCore::LineWidth::shouldIndentText):
1949
1950 2016-03-02  Beth Dakin  <bdakin@apple.com>
1951
1952         Add support for playbackControlsManager
1953         https://bugs.webkit.org/show_bug.cgi?id=154742
1954         -and corresponding-
1955         rdar://problem/23833753
1956
1957         Reviewed by Jer Noble.
1958
1959         Make AVKitSPI.h private so that it can be used from other projects.
1960         * WebCore.xcodeproj/project.pbxproj:
1961
1962         Right now, set up a controls manager for a video when it starts playing. In 
1963         the future, this is something that should be handled by the 
1964         PlatformMediaSessionManager since we only want a controls for the 
1965         currentSession.
1966         * html/HTMLMediaElement.cpp:
1967         (WebCore::HTMLMediaElement::playInternal):
1968
1969         New function setUpVideoControlsManager.
1970         * page/ChromeClient.h:
1971
1972         Make these CoreMedia functions available on Mac and iOS instead of just iOS.
1973         * platform/cf/CoreMediaSoftLink.cpp:
1974         * platform/cf/CoreMediaSoftLink.h:
1975
1976         This patch fleshes out an implementation for a bunch of these interface 
1977         functions since they need to communicate to the playbackControlsManager. This 
1978         is also where the playbackControlsManager lives.
1979         * platform/mac/WebVideoFullscreenInterfaceMac.h:
1980
1981         Define an interface and implementation for WebPlaybackControlsManager.
1982         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1983         (-[WebPlaybackControlsManager initWithWebVideoFullscreenInterfaceMac:]):
1984         (-[WebPlaybackControlsManager isSeeking]):
1985         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
1986         (-[WebPlaybackControlsManager audioMediaSelectionOptions]):
1987         (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
1988         (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
1989         (-[WebPlaybackControlsManager legibleMediaSelectionOptions]):
1990         (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
1991         (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
1992         (-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]):
1993
1994         Relay this information to the playbackControlsManager.
1995         (WebCore::WebVideoFullscreenInterfaceMac::setDuration):
1996         (WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
1997         (WebCore::WebVideoFullscreenInterfaceMac::setRate):
1998         (WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
1999         (WebCore::WebVideoFullscreenInterfaceMac::ensureControlsManager):
2000         (WebCore::WebVideoFullscreenInterfaceMac::playBackControlsManager):
2001         (WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):
2002
2003         New SPI needed.
2004         * platform/spi/cocoa/AVKitSPI.h:
2005         * platform/spi/mac/AVFoundationSPI.h:
2006
2007 2016-03-02  Gavin Barraclough  <barraclough@apple.com>
2008
2009         Add Page::TimerThrottlingState
2010         https://bugs.webkit.org/show_bug.cgi?id=154926
2011
2012         Reviewed by Chris Dumez.
2013
2014         Hidden page timer throttling is currently a boolean state, indicated by whether the Optional
2015         m_timerThrottlingEnabledTime is in a set/unset state. When enabled, the increasing mechanism
2016         may or may not be enabled, this is controlled directly by the setting.
2017
2018         Refactor to add an enum tracking timer throttling being in one of three states - disabled,
2019         enabled, or enabled-increasing. This cleans things up, and will enabled up to introduce a
2020         dynamic policy for when enabled-throttling is enabled. (Behavior is unchanged in this patch.)
2021
2022         * page/Page.cpp:
2023         (WebCore::Page::Page):
2024         (WebCore::Page::setIsVisuallyIdleInternal):
2025         (WebCore::Page::hiddenPageDOMTimerThrottlingStateChanged):
2026             - setTimerThrottlingEnabled -> updateTimerThrottlingState.
2027         (WebCore::Page::updateTimerThrottlingState):
2028             - policy decision (currently enabled if visually-idle) was scattered across
2029               all call sites to setTimerThrottlingState. Unify in one place.
2030         (WebCore::Page::setTimerThrottlingState):
2031             - Was setTimerThrottlingEnabled.
2032         (WebCore::Page::setTimerAlignmentIntervalIncreaseLimit):
2033         (WebCore::Page::setDOMTimerAlignmentInterval):
2034         (WebCore::Page::timerAlignmentIntervalIncreaseTimerFired):
2035             - updated to check m_timerThrottlingState.
2036         (WebCore::Page::setTimerThrottlingEnabled): Deleted.
2037             - This became updateTimerThrottlingState.
2038         * page/Page.h:
2039         (WebCore::Page::timerThrottlingEnabled): Deleted.
2040             - Removed, it's easy enough now to just check m_timerThrottlingState.
2041
2042 2016-03-02  Chris Dumez  <cdumez@apple.com>
2043
2044         Align HTMLInputElement.maxLength with the specification
2045         https://bugs.webkit.org/show_bug.cgi?id=154906
2046
2047         Reviewed by Ryosuke Niwa.
2048
2049         Align HTMLInputElement.maxLength with the specification:
2050         - https://html.spec.whatwg.org/multipage/forms.html#dom-input-maxlength
2051         - https://html.spec.whatwg.org/multipage/forms.html#attr-input-maxlength
2052
2053         In particular, the following Web-facing change was made:
2054         - HTMLInputElement.maxLength returns -1 instead of 524288 when
2055           the corresponding content attribute is missing, cannot be parsed
2056           or out of range (i.e. negative), as per:
2057           - https://html.spec.whatwg.org/multipage/infrastructure.html#limited-to-only-non-negative-numbers
2058
2059         Note that HTMLTextAreaElement.maxLength was already returning -1 in
2060         this case.
2061
2062         The new behavior matches Firefox. Chrome however, still seems to
2063         return 524288.
2064
2065         Note that we keep using 524288 as a maximum maxLength internally for
2066         performance reasons. However, we stop exposing this arbitrary value to
2067         the Web as this is an internal limitation.
2068
2069         No new tests, already covered by existing tests.
2070
2071         * html/HTMLInputElement.cpp:
2072         (WebCore::HTMLInputElement::HTMLInputElement):
2073         Initialize m_maxLength to -1 initially, instead of 524288.
2074
2075         (WebCore::HTMLInputElement::tooLong):
2076         Call effectiveMaxLength() instead of maxLength(), which no longer
2077         exists. effectiveMaxLength() makes sure of returning a value in
2078         the range [0, 524288].
2079
2080         (WebCore::HTMLInputElement::parseAttribute):
2081
2082         (WebCore::HTMLInputElement::effectiveMaxLength):
2083         Split maxLength() into maxLengthForBindings() and effectiveMaxLength().
2084         effectiveMaxLength() returns a value in the range [0, 524288], while
2085         maxLengthForBindings() returns values in the range [-1, 2147483647].
2086
2087         (WebCore::HTMLInputElement::setMaxLength): Deleted.
2088         The implementation was moved to the parent class so that it can be
2089         shared with HTMLTextAreaElement.
2090
2091         (WebCore::HTMLInputElement::maxLengthAttributeChanged):
2092         Rename for clarity.
2093
2094         * html/HTMLTextAreaElement.cpp:
2095         (WebCore::HTMLTextAreaElement::parseAttribute):
2096         (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
2097         Cache the parsed maxLength when the content attribute changes, similarly
2098         to what is already done in HTMLInputElement.
2099
2100         (WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent):
2101         (WebCore::HTMLTextAreaElement::validationMessage):
2102         (WebCore::HTMLTextAreaElement::tooLong):
2103         Call effectiveMaxLength() instead of maxLength() which no longer exists.
2104         effectiveMaxLength() returns a cached value and is therefore a lot more
2105         efficient.
2106
2107         * html/HTMLTextAreaElement.h:
2108         * html/HTMLTextAreaElement.idl:
2109         * html/HTMLTextFormControlElement.cpp:
2110         (WebCore::HTMLTextFormControlElement::setMaxLengthForBindings):
2111         This was moved up from HTMLInputElement / HTMLTextAreaElement to avoid code
2112         duplication.
2113
2114         * html/HTMLTextFormControlElement.h:
2115
2116         * html/InputType.cpp:
2117         (WebCore::InputType::validationMessage):
2118         * html/TextFieldInputType.cpp:
2119         (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
2120         Call HTMLInputElement::effectiveMaxLength() instead of
2121         HTMLInputElement::maxLength() which no longer exists.
2122
2123 2016-03-02  Commit Queue  <commit-queue@webkit.org>
2124
2125         Unreviewed, rolling out r197434 and r197436.
2126         https://bugs.webkit.org/show_bug.cgi?id=154921
2127
2128         This change caused a LayoutTest assertion in debug (Requested
2129         by ryanhaddad on #webkit).
2130
2131         Reverted changesets:
2132
2133         "Extend CSSFontSelector's lifetime to be longer than the
2134         Document's lifetime"
2135         https://bugs.webkit.org/show_bug.cgi?id=154101
2136         http://trac.webkit.org/changeset/197434
2137
2138         "Unreviewed build fix after r197434."
2139         http://trac.webkit.org/changeset/197436
2140
2141 2016-03-02  Zalan Bujtas  <zalan@apple.com>
2142
2143         Subpixel layout: Enable vertical/horizontal subpixel spacing for tables.
2144         https://bugs.webkit.org/show_bug.cgi?id=154899
2145
2146         Reviewed by Simon Fraser.
2147
2148         This patch enables authors to specify device pixel values for table border spacing.
2149         (see border-spacing)
2150
2151         Test: fast/table/hidpi-vertical-and-horizontal-spacing.html
2152
2153         * css/CSSPropertyNames.in:
2154         * page/animation/CSSPropertyAnimation.cpp:
2155         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2156         * rendering/RenderTable.cpp:
2157         (WebCore::RenderTable::offsetLeftForColumn):
2158         (WebCore::RenderTable::offsetWidthForColumn):
2159         (WebCore::RenderTable::RenderTable): Deleted.
2160         * rendering/RenderTable.h:
2161         * rendering/style/RenderStyle.cpp:
2162         (WebCore::RenderStyle::horizontalBorderSpacing):
2163         (WebCore::RenderStyle::verticalBorderSpacing):
2164         (WebCore::RenderStyle::setHorizontalBorderSpacing):
2165         (WebCore::RenderStyle::setVerticalBorderSpacing):
2166         * rendering/style/RenderStyle.h:
2167         * rendering/style/StyleInheritedData.h:
2168
2169 2016-03-02  Chris Dumez  <cdumez@apple.com>
2170
2171         Have parseHTMLInteger() / parseHTMLNonNegativeInteger() use WTF::Optional
2172         https://bugs.webkit.org/show_bug.cgi?id=154845
2173
2174         Reviewed by Darin Adler.
2175
2176         Take into consideration review comments made after landing r197389.
2177
2178         * html/HTMLElement.cpp:
2179         (WebCore::HTMLElement::parseBorderWidthAttribute):
2180         (WebCore::HTMLElement::parseAttribute):
2181         * html/HTMLInputElement.cpp:
2182         * html/HTMLInputElement.h:
2183         * html/HTMLTextAreaElement.cpp:
2184         (WebCore::HTMLTextAreaElement::maxLength):
2185         * html/ImageInputType.cpp:
2186         (WebCore::ImageInputType::height):
2187         (WebCore::ImageInputType::width):
2188         * html/parser/HTMLParserIdioms.cpp:
2189         (WebCore::parseHTMLNonNegativeInteger):
2190         * html/parser/HTMLParserIdioms.h:
2191         (WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
2192         (WebCore::limitToOnlyHTMLNonNegative):
2193         * svg/SVGElement.cpp:
2194         (WebCore::SVGElement::parseAttribute):
2195
2196 2016-03-01  Ryosuke Niwa  <rniwa@webkit.org>
2197
2198         Unreviewed. Remove the "Partial Support" status from web components since shadow DOM and custom elements
2199         are in active development.
2200
2201         * features.json:
2202
2203 2016-03-01  Ryosuke Niwa  <rniwa@webkit.org>
2204
2205         Unreviewed. Update the feature status for custom elements API.
2206
2207         * features.json:
2208
2209 2016-02-26  Ryosuke Niwa  <rniwa@webkit.org>
2210
2211         Contents inside a shadow host with a negative tabindex should not be tab focusable
2212         https://bugs.webkit.org/show_bug.cgi?id=154769
2213
2214         Reviewed by Antti Koivisto.
2215
2216         Contents inside a shadow host with a negative tabindex content attribute should not be included in
2217         the sequential focus navigation order as discussed on https://github.com/w3c/webcomponents/issues/399.
2218
2219         Test: fast/shadow-dom/negative-tabindex-on-shadow-host.html
2220
2221         * dom/Element.cpp:
2222         (WebCore::Element::tabIndexSetExplicitly): Added.
2223         * dom/Element.h:
2224         * page/FocusController.cpp:
2225         (WebCore::shadowAdjustedTabIndex): Renamed from adjustedTabIndex. Return 0 when tabindex content attribute
2226         is not explicitly set since element.tabIndex() would return -1 for HTML elements in such case.
2227         (WebCore::isFocusableOrHasShadowTreeWithoutCustomFocusLogic): Renamed from shouldVisit.
2228         (WebCore::FocusController::findElementWithExactTabIndex):
2229         (WebCore::nextElementWithGreaterTabIndex):
2230         (WebCore::previousElementWithLowerTabIndex):
2231         (WebCore::FocusController::nextFocusableElement):
2232         (WebCore::FocusController::previousFocusableElement):
2233
2234 2016-03-01  Michael Saboff  <msaboff@apple.com>
2235
2236         REGRESSION (r197426): Missed adding unicode parameter to call to Yarr::parse() in URLFilterParser::addPattern()
2237         https://bugs.webkit.org/show_bug.cgi?id=154898
2238
2239         Reviewed by Saam Barati.
2240
2241         This is a fix for the API tests after r197426.
2242
2243         Added missing bool unicode parameter of "false".
2244
2245         * contentextensions/URLFilterParser.cpp:
2246         (WebCore::ContentExtensions::URLFilterParser::addPattern):
2247
2248 2016-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
2249
2250         Unreviewed build fix after r197434.
2251
2252         Unreviewed
2253
2254         * css/SourceSizeList.cpp:
2255         (WebCore::parseSizesAttribute):
2256
2257 2016-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
2258
2259         Small-caps non-BMP characters are garbled in the complex text codepath
2260         https://bugs.webkit.org/show_bug.cgi?id=154875
2261
2262         Reviewed by Michael Saboff.
2263
2264         We were assuming that all characters able to be capitalized are in BMP. This is not true.
2265
2266         Test: fast/text/complex-small-caps-non-bmp-capitalize.html
2267
2268         * platform/graphics/mac/ComplexTextController.cpp:
2269         (WebCore::capitalized):
2270         (WebCore::ComplexTextController::collectComplexTextRuns):
2271
2272 2016-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
2273
2274         Extend CSSFontSelector's lifetime to be longer than the Document's lifetime
2275         https://bugs.webkit.org/show_bug.cgi?id=154101
2276
2277         Reviewed by Darin Adler.
2278
2279         Rather than destroying the Document's CSSFontSelector, instead, the object should
2280         live for the lifetime of the document, and it should instead be asked to clear its
2281         contents.
2282
2283         This is important for the CSS Font Loading API, where the identity of objects the
2284         CSSFontSelector references needs to persist throughout the lifetime of the
2285         Document. This patch represents the first step to implementing this correctly.
2286         The second step is for the CSSFontSelector to perform a diff instead of a
2287         wholesale clear of its contents. Once this is done, font loading objects can
2288         survive through a call to Document::clearStyleResolver().
2289
2290         This patch gives the CSSFontSelector two states: building underway and building not
2291         underway. The state is building underway in between calls to clearStyleResolver()
2292         and when the style resolver gets built back up. Otherwise, the state is building
2293         not underway. Because of this new design, creation of all FontFace objects can be
2294         postponed until a state transition from building underway to building not underway.
2295         A subsequent patch will perform the diff at this point. An ASSERT() makes sure that
2296         we never service a font lookup request while Building.
2297
2298         No new tests because there is no behavior change.
2299
2300         * css/CSSFontFaceSet.cpp:
2301         (WebCore::CSSFontFaceSet::clear):
2302         * css/CSSFontSelector.cpp:
2303         (WebCore::CSSFontSelector::buildStarted):
2304         (WebCore::CSSFontSelector::buildCompleted):
2305         (WebCore::CSSFontSelector::addFontFaceRule):
2306         (WebCore::CSSFontSelector::fontRangesForFamily):
2307         (WebCore::CSSFontSelector::CSSFontSelector): Deleted.
2308         (WebCore::CSSFontSelector::clearDocument): Deleted.
2309         * css/CSSFontSelector.h:
2310         * css/StyleResolver.cpp:
2311         (WebCore::StyleResolver::appendAuthorStyleSheets):
2312         * dom/Document.cpp:
2313         (WebCore::Document::Document):
2314         (WebCore::Document::~Document):
2315         (WebCore::Document::clearStyleResolver):
2316         (WebCore::Document::fontSelector): Deleted.
2317         * dom/Document.h:
2318         (WebCore::Document::fontSelector):
2319
2320 2016-03-01  Alexey Proskuryakov  <ap@apple.com>
2321
2322         Update Xcode project for InstallAPI
2323         https://bugs.webkit.org/show_bug.cgi?id=154896
2324         rdar://problem/24825992
2325
2326         Patch by Daniel Dunbar, reviewed by me.
2327
2328         * Configurations/WebCore.xcconfig:
2329         * WebCore.xcodeproj/project.pbxproj:
2330
2331 2016-03-01  Ada Chan  <adachan@apple.com>
2332
2333         One more attempt to fix the build.
2334
2335         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2336         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
2337
2338 2016-03-01  Ada Chan  <adachan@apple.com>
2339
2340         Attempt to fix the internal build.
2341
2342         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2343         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
2344
2345 2016-02-29  Ada Chan  <adachan@apple.com>
2346
2347         Adopt the new version of AVOutputDeviceMenuController's showMenuForRect method.
2348         https://bugs.webkit.org/show_bug.cgi?id=154823
2349
2350         Reviewed by Tim Horton.
2351
2352         * Modules/mediasession/WebMediaSessionManager.cpp:
2353         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
2354         (WebCore::WebMediaSessionManager::customPlaybackActionSelected):
2355         Call customPlaybackActionSelected() on the client that requested the picker.
2356         * Modules/mediasession/WebMediaSessionManager.h:
2357         * Modules/mediasession/WebMediaSessionManagerClient.h:
2358         * dom/Document.cpp:
2359         (WebCore::Document::showPlaybackTargetPicker):
2360         (WebCore::Document::customPlaybackActionSelected):
2361         * dom/Document.h:
2362         * html/HTMLMediaElement.cpp:
2363         (WebCore::HTMLMediaElement::customPlaybackActionSelected):
2364         (WebCore::HTMLMediaElement::playbackTargetPickerCustomActionName):
2365         * html/HTMLMediaElement.h:
2366         * html/MediaElementSession.cpp:
2367         (WebCore::MediaElementSession::showPlaybackTargetPicker):
2368         (WebCore::MediaElementSession::customPlaybackActionSelected):
2369         * html/MediaElementSession.h:
2370         * page/ChromeClient.h:
2371         * page/Page.cpp:
2372         (WebCore::Page::showPlaybackTargetPicker):
2373         (WebCore::Page::customPlaybackActionSelected):
2374         * page/Page.h:
2375         * platform/audio/PlatformMediaSession.h:
2376         (WebCore::PlatformMediaSessionClient::customPlaybackActionSelected):
2377         * platform/graphics/MediaPlaybackTargetClient.h:
2378         * platform/graphics/MediaPlaybackTargetPicker.cpp:
2379         (WebCore::MediaPlaybackTargetPicker::pendingActionTimerFired):
2380         (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
2381         * platform/graphics/MediaPlaybackTargetPicker.h:
2382         (WebCore::MediaPlaybackTargetPicker::Client::customPlaybackActionSelected):
2383         (WebCore::MediaPlaybackTargetPicker::customPlaybackActionSelected):
2384         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
2385         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2386         Update the forward declaration of AVOutputDeviceMenuController's showMenuForRect method.
2387         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
2388         Call the new version of showMenuForRect if available.
2389         * platform/mac/WebVideoFullscreenInterfaceMac.h:
2390         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2391         (WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback):
2392         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
2393         (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
2394         * platform/mock/MediaPlaybackTargetPickerMock.h:
2395         * platform/spi/cocoa/AVKitSPI.h:
2396         Updated with the new version of showMenuForRect.
2397
2398 2016-03-01  Daniel Bates  <dabates@apple.com>
2399
2400         com.apple.WebKit.Networking.Development crashes in WebCore::formOpen()
2401         https://bugs.webkit.org/show_bug.cgi?id=154682
2402         <rdar://problem/23550269>
2403
2404         Reviewed by Brent Fulgham.
2405
2406         Speculative fix for a race condition when opening the stream for the next form data element.
2407         Calling CFReadStreamOpen(s) in WebCore::openNextStream() can cause stream s to be closed and
2408         deallocated before CFReadStreamOpen(s) returns.
2409
2410         When WebCore::openNextStream() is called it closes and deallocates the current stream and
2411         then opens a new stream for the next form data element. Calling CFReadStreamOpen() in
2412         WebCore::openNextStream() can lead to WebCore::openNextStream() being re-entered via
2413         WebCore::formEventCallback() from another thread. One example when this can occur is when
2414         the stream being opened has no data (i.e. WebCore::formEventCallback() is called
2415         back with event type kCFStreamEventEndEncountered).
2416
2417         I have been unable to reproduce this crash. We know that it occurs from crash reports.
2418
2419         * platform/network/cf/FormDataStreamCFNet.cpp:
2420         (WebCore::closeCurrentStream): Assert that we had acquired a lock to close the stream.
2421         (WebCore::advanceCurrentStream): Assert that we had acquired a lock to advance the stream.
2422         (WebCore::openNextStream): Acquire a lock before we open the next stream to ensure that
2423         exactly one thread executes this critical section at a time.
2424         (WebCore::formFinalize): Acquire a lock before we close the current stream.
2425         (WebCore::formClose): Ditto.
2426
2427 2016-03-01  Michael Saboff  <msaboff@apple.com>
2428
2429         ASSERT in platform/graphics/mac/ComplexTextController.cpp::capitalize()
2430         https://bugs.webkit.org/show_bug.cgi?id=154875
2431
2432         Reviewed by Myles C. Maxfield.
2433
2434         Change an ASSERT to verify that uper casing a character doesn't change its size.
2435
2436         Test: fast/text/regress-154875.html
2437
2438         * platform/graphics/mac/ComplexTextController.cpp:
2439         (WebCore::capitalized):
2440
2441 2016-03-01  Gavin Barraclough  <barraclough@apple.com>
2442
2443         Timer alignment in separate web processes should not all sync up to the same point.
2444         https://bugs.webkit.org/show_bug.cgi?id=154878
2445
2446         Reviewed by Chris Dumez.
2447
2448         For any given WebContent process it is desirable that timers are synchronized to a single
2449         alignment point, but if all WebContent processes align to the same point then there may
2450         be a thundering herd of processes waking up.
2451
2452         * page/DOMTimer.cpp:
2453         (WebCore::DOMTimer::alignedFireTime):
2454             - align to a randomized point.
2455
2456 2016-03-01  Alex Christensen  <achristensen@webkit.org>
2457
2458         Reduce size of internal windows build output
2459         https://bugs.webkit.org/show_bug.cgi?id=154763
2460
2461         Reviewed by Brent Fulgham.
2462
2463         * WebCore.vcxproj/WebCore.proj:
2464
2465 2016-03-01  Andreas Kling  <akling@apple.com>
2466
2467         REGRESSION (r154616): Accelerated drawing is off during the initial load
2468         <https://webkit.org/b/123812>
2469
2470         Reviewed by Tim Horton.
2471
2472         Robustify the hey-the-Settings-changed callbacks in Page to handle document-less frames.
2473         This is needed because now Settings are changed even before the main Frame has a Document.
2474
2475         * page/Page.cpp:
2476         (WebCore::networkStateChanged):
2477         (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
2478         (WebCore::Page::takeAnyMediaCanStartListener):
2479         (WebCore::Page::setMediaVolume):
2480         (WebCore::Page::setPageScaleFactor):
2481         (WebCore::Page::invalidateStylesForAllLinks):
2482         (WebCore::Page::invalidateStylesForLink):
2483         (WebCore::Page::dnsPrefetchingStateChanged):
2484         (WebCore::Page::storageBlockingStateChanged):
2485         (WebCore::Page::setMuted):
2486         (WebCore::Page::captionPreferencesChanged):
2487         (WebCore::Page::setSessionID):
2488         (WebCore::Page::setPlaybackTarget):
2489         (WebCore::Page::playbackTargetAvailabilityDidChange):
2490         (WebCore::Page::setShouldPlayToPlaybackTarget):
2491         * page/Settings.cpp:
2492         (WebCore::setImageLoadingSettings):
2493
2494 2016-03-01  Commit Queue  <commit-queue@webkit.org>
2495
2496         Unreviewed, rolling out r197056.
2497         https://bugs.webkit.org/show_bug.cgi?id=154870
2498
2499         broke win ews (Requested by alexchristensen on #webkit).
2500
2501         Reverted changeset:
2502
2503         "[cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK."
2504         https://bugs.webkit.org/show_bug.cgi?id=154651
2505         http://trac.webkit.org/changeset/197056
2506
2507 2016-03-01  Brady Eidson  <beidson@apple.com>
2508
2509         Modern IDB: Possible crash deallocating IDBDatabaseInfo/IDBObjectStoreInfo/IDBIndexInfo.
2510         https://bugs.webkit.org/show_bug.cgi?id=154860
2511
2512         Reviewed by Alex Christensen.
2513
2514         Covered by existing tests.
2515
2516         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
2517         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
2518         (WebCore::IDBDatabaseInfo::isolatedCopy):
2519         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
2520
2521         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
2522         (WebCore::IDBTransactionInfo::isolatedCopy): If there's an IDBDatabaseInfo to copy,  that
2523           copy needs to be isolated.
2524
2525 2016-03-01  Tim Horton  <timothy_horton@apple.com>
2526
2527         Expose MediaElement and VideoElement to the Objective-C DOM bindings
2528         https://bugs.webkit.org/show_bug.cgi?id=154830
2529
2530         Reviewed by Sam Weinig.
2531
2532         * Modules/mediasession/HTMLMediaElementMediaSession.idl:
2533         * Modules/mediastream/HTMLMediaElementMediaStream.idl:
2534         * html/HTMLMediaElement.idl:
2535         * html/HTMLVideoElement.idl:
2536         Avoid Objective-C bindings for various extraneous bits, like MediaSource and MediaSession,
2537         to avoid exposing way more than we need to.
2538
2539         * WebCore.xcodeproj/project.pbxproj:
2540         Add a bunch of Derived Sources.
2541
2542 2016-03-01  Antti Koivisto  <antti@apple.com>
2543
2544         Text control shadow element style shouldn't depend on renderers
2545         https://bugs.webkit.org/show_bug.cgi?id=154855
2546
2547         Reviewed by Andreas Kling.
2548
2549         Currently the code for computing style for text control shadow elements lives in render tree.
2550         Style is the input for building a render tree and should be computable without having one.
2551
2552         Fix by moving virtual createInnerTextStyle() from RenderTextControl hierarchy to the DOM side
2553         HTMLTextFormControlElement hierarchy.
2554
2555         * dom/Element.cpp:
2556         (WebCore::Element::didDetachRenderers):
2557         (WebCore::Element::customStyleForRenderer):
2558
2559             Also pass shadow host style as it is needed for text controls.
2560
2561         * dom/Element.h:
2562         * dom/PseudoElement.cpp:
2563         (WebCore::PseudoElement::clearHostElement):
2564         (WebCore::PseudoElement::customStyleForRenderer):
2565         * dom/PseudoElement.h:
2566         * html/HTMLInputElement.cpp:
2567         (WebCore::HTMLInputElement::setRangeText):
2568         (WebCore::HTMLInputElement::createInnerTextStyle):
2569         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
2570         * html/HTMLInputElement.h:
2571         * html/HTMLTextAreaElement.cpp:
2572         (WebCore::HTMLTextAreaElement::willRespondToMouseClickEvents):
2573         (WebCore::HTMLTextAreaElement::createInnerTextStyle):
2574         * html/HTMLTextAreaElement.h:
2575         * html/HTMLTextFormControlElement.cpp:
2576         (WebCore::HTMLTextFormControlElement::directionForFormData):
2577         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle):
2578         * html/HTMLTextFormControlElement.h:
2579         (WebCore::HTMLTextFormControlElement::cachedSelectionDirection):
2580         * html/shadow/TextControlInnerElements.cpp:
2581         (WebCore::TextControlInnerElement::create):
2582         (WebCore::TextControlInnerElement::customStyleForRenderer):
2583         (WebCore::TextControlInnerTextElement::renderer):
2584         (WebCore::TextControlInnerTextElement::customStyleForRenderer):
2585         * html/shadow/TextControlInnerElements.h:
2586         * rendering/RenderTextControl.cpp:
2587         (WebCore::RenderTextControl::styleDidChange):
2588         (WebCore::RenderTextControl::textBlockLogicalHeight):
2589         (WebCore::RenderTextControl::adjustInnerTextStyle): Deleted.
2590         * rendering/RenderTextControl.h:
2591         * rendering/RenderTextControlMultiLine.cpp:
2592         (WebCore::RenderTextControlMultiLine::baselinePosition):
2593         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild):
2594         (WebCore::RenderTextControlMultiLine::createInnerTextStyle): Deleted.
2595
2596             createInnerTextStyle moves to HTMLTextAreaElement::createInnerTextStyle
2597
2598         * rendering/RenderTextControlMultiLine.h:
2599         * rendering/RenderTextControlSingleLine.cpp:
2600         (WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
2601
2602             Remove m_desiredInnerTextLogicalHeight cache. It doesn't work, it is never valid when hit.
2603
2604         (WebCore::RenderTextControlSingleLine::layout):
2605         (WebCore::RenderTextControlSingleLine::styleDidChange):
2606         (WebCore::RenderTextControlSingleLine::computeControlLogicalHeight):
2607         (WebCore::RenderTextControlSingleLine::textShouldBeTruncated):
2608         (WebCore::RenderTextControlSingleLine::createInnerTextStyle): Deleted.
2609         (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Deleted.
2610
2611             - createInnerTextStyle moves to HTMLInputElement::createInnerTextStyle
2612             - createInnerBlockStyle moves to TextControlInnerElement::customStyleForRenderer
2613
2614         * rendering/RenderTextControlSingleLine.h:
2615         (WebCore::RenderTextControlSingleLine::centerContainerIfNeeded):
2616         (WebCore::RenderTextControlSingleLine::containerElement):
2617         * style/StyleTreeResolver.cpp:
2618         (WebCore::Style::TreeResolver::styleForElement):
2619         * svg/SVGElement.cpp:
2620         (WebCore::SVGElement::synchronizeSystemLanguage):
2621         (WebCore::SVGElement::customStyleForRenderer):
2622         * svg/SVGElement.h:
2623
2624 2016-03-01  Manuel Rego Casasnovas  <rego@igalia.com>
2625
2626         [css-grid] Get rid of GridResolvedPosition
2627         https://bugs.webkit.org/show_bug.cgi?id=154818
2628
2629         Reviewed by Darin Adler.
2630
2631         GridResolvedPosition was a small class just wrapping a unsigned.
2632         In the future it should actually wrap an integer,
2633         as we want to support implicit tracks before the explicit grid.
2634
2635         The class itself is not providing any benefit,
2636         so we can get rid of it and store directly 2 unsigned in GridSpan.
2637
2638         This will make simpler future changes related to this task.
2639
2640         We keep the class just as a utility for the methods
2641         that deal with the positions resolution.
2642         But it should be renamed in a follow-up patch.
2643
2644         No new tests, no change of behavior.
2645
2646         * css/CSSGridTemplateAreasValue.cpp:
2647         (WebCore::stringForPosition):
2648         * css/CSSParser.cpp:
2649         (WebCore::CSSParser::parseGridTemplateAreasRow):
2650         * css/StyleBuilderConverter.h:
2651         (WebCore::StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea):
2652         * rendering/RenderGrid.cpp:
2653         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
2654         (WebCore::RenderGrid::findFlexFactorUnitSize):
2655         (WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks):
2656         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
2657         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2658         (WebCore::RenderGrid::insertItemIntoGrid):
2659         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
2660         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
2661         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
2662         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
2663         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
2664         (WebCore::RenderGrid::gridAreaBreadthForChild):
2665         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
2666         (WebCore::RenderGrid::columnAxisOffsetForChild):
2667         (WebCore::RenderGrid::rowAxisOffsetForChild):
2668         * rendering/style/GridCoordinate.h:
2669         (WebCore::GridSpan::definiteGridSpan):
2670         (WebCore::GridSpan::integerSpan):
2671         (WebCore::GridSpan::resolvedInitialPosition):
2672         (WebCore::GridSpan::resolvedFinalPosition):
2673         (WebCore::GridSpan::GridSpanIterator::GridSpanIterator):
2674         (WebCore::GridSpan::GridSpanIterator::operator*):
2675         (WebCore::GridSpan::GridSpanIterator::operator++):
2676         (WebCore::GridSpan::GridSpanIterator::operator!=):
2677         (WebCore::GridSpan::begin):
2678         (WebCore::GridSpan::end):
2679         (WebCore::GridSpan::GridSpan):
2680         * rendering/style/GridResolvedPosition.cpp:
2681         (WebCore::resolveNamedGridLinePositionFromStyle):
2682         (WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
2683         (WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
2684         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
2685         (WebCore::resolveGridPositionAgainstOppositePosition):
2686         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
2687         (WebCore::resolveGridPositionFromStyle):
2688         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
2689         * rendering/style/GridResolvedPosition.h:
2690         (WebCore::GridResolvedPosition::GridResolvedPosition): Deleted.
2691         (WebCore::GridResolvedPosition::operator*): Deleted.
2692         (WebCore::GridResolvedPosition::operator++): Deleted.
2693         (WebCore::GridResolvedPosition::operator==): Deleted.
2694         (WebCore::GridResolvedPosition::operator!=): Deleted.
2695         (WebCore::GridResolvedPosition::operator<): Deleted.
2696         (WebCore::GridResolvedPosition::operator>): Deleted.
2697         (WebCore::GridResolvedPosition::operator<=): Deleted.
2698         (WebCore::GridResolvedPosition::operator>=): Deleted.
2699         (WebCore::GridResolvedPosition::toInt): Deleted.
2700         (WebCore::GridResolvedPosition::next): Deleted.
2701         (WebCore::GridResolvedPosition::prev): Deleted.
2702
2703 2016-03-01  Andreas Kling  <akling@apple.com>
2704
2705         MemoryCache::forEachResource() should guard resources across function invocation.
2706         <https://webkit.org/b/154846>
2707
2708         Reviewed by Antti Koivisto.
2709
2710         It occurred to me that we should protect the CachedResources from being
2711         deleted while invoking the custom function here, lest we create a giant footgun.
2712
2713         * loader/cache/MemoryCache.cpp:
2714         (WebCore::MemoryCache::forEachResource):
2715
2716 2016-03-01  Csaba Osztrogonác  <ossy@webkit.org>
2717
2718         [Mac][cmake] One more unreviewed speculative buildfix after r197375. Just for fun.
2719
2720         * PlatformMac.cmake:
2721
2722 2016-03-01  Csaba Osztrogonác  <ossy@webkit.org>
2723
2724         [Mac][cmake] Unreviewed speculative buildfix after r197375. Just for fun.
2725
2726         * PlatformMac.cmake:
2727
2728 2016-03-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2729
2730         [Fetch API] Support Request and Response blob() when body data is a blob
2731         https://bugs.webkit.org/show_bug.cgi?id=154820
2732
2733         Reviewed by Darin Adler.
2734
2735         Adding support for returning the same Blob that is stored in Body in case JS blob() is called.
2736         Adding support for Blob creation when data is stored as text.
2737         Updated JSDOMBinding and JSDOMPromise to return a JS ArrayBuffer for Vector<char> as well as Vector<unsigned char>.
2738
2739         Covered by added tests.
2740
2741         * Modules/fetch/FetchBody.cpp:
2742         (WebCore::FetchBody::arrayBuffer):
2743         (WebCore::FetchBody::blob):
2744         (WebCore::FetchBody::extractFromText):
2745         * Modules/fetch/FetchBody.h:
2746         * bindings/js/JSDOMBinding.h:
2747         (WebCore::toJS):
2748         * bindings/js/JSDOMPromise.h:
2749         (WebCore::DeferredWrapper::resolve): Deleted.
2750
2751 2016-02-29  Chris Dumez  <cdumez@apple.com>
2752
2753         Have parseHTMLInteger() / parseHTMLNonNegativeInteger() use WTF::Optional
2754         https://bugs.webkit.org/show_bug.cgi?id=154845
2755
2756         Reviewed by Ryosuke Niwa.
2757
2758         Have parseHTMLInteger() / parseHTMLNonNegativeInteger() use
2759         WTF::Optional.
2760
2761         * dom/Element.cpp:
2762         (WebCore::Element::getIntegralAttribute):
2763         (WebCore::Element::getUnsignedIntegralAttribute):
2764         (WebCore::Element::setUnsignedIntegralAttribute): Deleted.
2765         * html/HTMLElement.cpp:
2766         (WebCore::HTMLElement::parseBorderWidthAttribute):
2767         (WebCore::HTMLElement::parseAttribute):
2768         * html/HTMLInputElement.cpp:
2769         (WebCore::HTMLInputElement::parseMaxLengthAttribute):
2770         * html/HTMLInputElement.h:
2771         * html/HTMLOListElement.cpp:
2772         (WebCore::HTMLOListElement::parseAttribute):
2773         * html/HTMLTextAreaElement.cpp:
2774         (WebCore::HTMLTextAreaElement::maxLength):
2775         * html/ImageInputType.cpp:
2776         (WebCore::ImageInputType::height):
2777         (WebCore::ImageInputType::width):
2778         * html/parser/HTMLParserIdioms.cpp:
2779         (WebCore::parseHTMLIntegerInternal):
2780         (WebCore::parseHTMLInteger):
2781         (WebCore::parseHTMLNonNegativeInteger):
2782         * html/parser/HTMLParserIdioms.h:
2783         (WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
2784         (WebCore::limitToOnlyHTMLNonNegative):
2785         * svg/SVGElement.cpp:
2786         (WebCore::SVGElement::parseAttribute):
2787
2788 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
2789
2790         TextureMapperGL: simplify TransformationMatrix copies in draw(), beginClip()
2791         https://bugs.webkit.org/show_bug.cgi?id=154791
2792
2793         Reviewed by Carlos Garcia Campos.
2794
2795         In both functions, the passed-in model-view matrix is first copied, multiplied
2796         against a rect-to-rect TransformationMatrix, and then assigned into a local
2797         TransformationMatrix variable, which causes another copy due to the multiply()
2798         function returning a reference to the modified object.
2799
2800         To avoid the last copy, first copy the model-view matrix into a local variable,
2801         and multiply the rect-to-rect TransformationMatrix into the new object afterwards.
2802
2803         * platform/graphics/texmap/TextureMapperGL.cpp:
2804         (WebCore::TextureMapperGL::draw):
2805         (WebCore::TextureMapperGL::beginClip):
2806
2807 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
2808
2809         ImageBufferCairo should support OpenGL ES 2 configurations
2810         https://bugs.webkit.org/show_bug.cgi?id=154790
2811
2812         Reviewed by Carlos Garcia Campos.
2813
2814         When building with OpenGL ES 2 and with accelerated 2D canvas support,
2815         the GLES2 header should be included instead of the OpenGLShims.h header.
2816
2817         The glTexParameterf() calls targeting GL_TEXTURE_WRAP_S and
2818         GL_TEXTURE_WRAP_T parameters should use the GL_CLAMP_TO_EDGE value.
2819         GL_CLAMP isn't available in OpenGL ES 2 and was dropped in OpenGL 3.
2820
2821         * platform/graphics/cairo/ImageBufferCairo.cpp:
2822         (WebCore::ImageBufferData::createCairoGLSurface):
2823
2824 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
2825
2826         TextureMapperGL: beginPainting() should handle the PaintingMirrored value in PaintFlags
2827         https://bugs.webkit.org/show_bug.cgi?id=154789
2828
2829         Reviewed by Carlos Garcia Campos.
2830
2831         * platform/graphics/texmap/TextureMapperGL.cpp:
2832         (WebCore::TextureMapperGL::beginPainting): The ClipStack should be reset with
2833         a Y-axis mode that corresponds to the presence of the PaintingMirrored value in
2834         the passed-in PaintFlags argument. If present, the default Y-axis mode should be
2835         used, and the inverted Y-axis otherwise.
2836
2837 2016-02-29  Zan Dobersek  <zdobersek@igalia.com>
2838
2839         CoordinatedGraphicsLayer should override the inherited TextureMapperPlatformLayer::Client methods
2840         https://bugs.webkit.org/show_bug.cgi?id=154788
2841
2842         Reviewed by Carlos Garcia Campos.
2843
2844         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2845         Add the override specifiers for the two methods that are inherited
2846         from the TextureMapperPlatformLayer::Client interface.
2847
2848 2016-02-29  Simon Fraser  <simon.fraser@apple.com>
2849
2850         Remove the experimental feature of antialiased font dilation
2851         https://bugs.webkit.org/show_bug.cgi?id=154843
2852
2853         Reviewed by Zalan Bujtas.
2854         
2855         Remove the "antialiased font dilation" code path, and related prefs.
2856
2857         * page/Settings.cpp:
2858         (WebCore::Settings::Settings): Deleted.
2859         (WebCore::Settings::setAntialiasedFontDilationEnabled): Deleted.
2860         * page/Settings.h:
2861         (WebCore::Settings::antialiasedFontDilationEnabled): Deleted.
2862         * platform/graphics/FontCascade.cpp:
2863         (WebCore::FontCascade::setAntialiasedFontDilationEnabled): Deleted.
2864         (WebCore::FontCascade::antialiasedFontDilationEnabled): Deleted.
2865         * platform/graphics/FontCascade.h:
2866         * platform/graphics/GraphicsContext.cpp:
2867         (WebCore::GraphicsContextStateChange::changesFromState): Deleted.
2868         (WebCore::GraphicsContextStateChange::accumulate): Deleted.
2869         (WebCore::GraphicsContextStateChange::apply): Deleted.
2870         (WebCore::GraphicsContextStateChange::dump): Deleted.
2871         (WebCore::GraphicsContext::setAntialiasedFontDilationEnabled): Deleted.
2872         * platform/graphics/GraphicsContext.h:
2873         (WebCore::GraphicsContextState::GraphicsContextState): Deleted.
2874         (WebCore::GraphicsContext::antialiasedFontDilationEnabled): Deleted.
2875         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2876         (PlatformCALayer::drawLayerContents): Deleted.
2877         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2878         (WebCore::dilationSizeForTextColor): Deleted.
2879         (WebCore::FontCascade::drawGlyphs): Deleted.
2880         * platform/graphics/displaylists/DisplayList.cpp:
2881         (WebCore::DisplayList::DisplayList::shouldDumpForFlags): Deleted.
2882
2883 2016-02-29  Jer Noble  <jer.noble@apple.com>
2884
2885         Refactor CoreVideo API access into their own classes so code can be re-used.
2886         https://bugs.webkit.org/show_bug.cgi?id=154544
2887
2888         Reviewed by Eric Carlson.
2889
2890         In order for common CoreVideo code paths to be re-used in other classes, pull those paths
2891         out of MediaPlayerPrivateAVFoundationObjC and into re-usable clasess.
2892
2893         * WebCore.xcodeproj/project.pbxproj:
2894         * platform/cf/CoreMediaSoftLink.cpp:
2895         * platform/cf/CoreMediaSoftLink.h:
2896         * platform/cocoa/CoreVideoSoftLink.cpp: Added.
2897         * platform/cocoa/CoreVideoSoftLink.h: Added.
2898         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2899         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2900         (WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer):
2901         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
2902         (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture):
2903         (WebCore::CVPixelBufferGetBytePointerCallback): Deleted.
2904         (WebCore::CVPixelBufferReleaseBytePointerCallback): Deleted.
2905         (WebCore::CVPixelBufferReleaseInfoCallback): Deleted.
2906         (WebCore::createImageFromPixelBuffer): Deleted.
2907         (WebCore::enumToStringMap): Deleted.
2908         * platform/graphics/cv/PixelBufferConformerCV.cpp: Added.
2909         (WebCore::PixelBufferConformerCV::PixelBufferConformerCV):
2910         (WebCore::CVPixelBufferGetBytePointerCallback):
2911         (WebCore::CVPixelBufferReleaseBytePointerCallback):
2912         (WebCore::CVPixelBufferReleaseInfoCallback):
2913         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
2914         * platform/graphics/cv/PixelBufferConformerCV.h: Added.
2915         * platform/graphics/cv/TextureCacheCV.h: Added.
2916         (WebCore::TextureCacheCV::context):
2917         * platform/graphics/cv/TextureCacheCV.mm: Added.
2918         (WebCore::TextureCacheCV::create):
2919         (WebCore::TextureCacheCV::TextureCacheCV):
2920         (WebCore::TextureCacheCV::textureFromImage):
2921         * platform/graphics/cv/VideoTextureCopierCV.cpp: Added.
2922         (WebCore::VideoTextureCopierCV::VideoTextureCopierCV):
2923         (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV):
2924         (WebCore::enumToStringMap):
2925         (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
2926         * platform/graphics/cv/VideoTextureCopierCV.h: Added.
2927         (WebCore::VideoTextureCopierCV::context):
2928         * platform/mediastream/mac/AVVideoCaptureSource.mm: Move SOFT_LINK declarations into CoreVideoSoftLink.h/cpp.
2929
2930 2016-02-29  Chris Dumez  <cdumez@apple.com>
2931
2932         Use WTF::Optional for HTMLOListElement::m_start
2933         https://bugs.webkit.org/show_bug.cgi?id=154824
2934
2935         Reviewed by Andreas Kling.
2936
2937         Use WTF::Optional for HTMLOListElement::m_start.
2938
2939         * html/HTMLOListElement.cpp:
2940         (WebCore::HTMLOListElement::parseAttribute):
2941         * html/HTMLOListElement.h:
2942
2943 2016-02-29  Gavin Barraclough  <barraclough@apple.com>
2944
2945         RefCounter<T>::Event -> RefCounterEvent
2946         https://bugs.webkit.org/show_bug.cgi?id=154767
2947
2948         Reviewed by Darin Adler.
2949
2950         RefCounter<T>::Event is kinda verbose to use, and there is no need for this
2951         to be specific to a particular typeof RefCounter. Move the enum class up to
2952         the top level & rename to RefCounterEvent.
2953
2954         * page/PageThrottler.cpp:
2955         (WebCore::PageThrottler::PageThrottler):
2956         (WebCore::m_audiblePluginHysteresis):
2957         (WebCore::m_mediaActivityCounter):
2958         (WebCore::m_pageLoadActivityCounter):
2959         * platform/VNodeTracker.cpp:
2960         (WebCore::VNodeTracker::singleton):
2961         (WebCore::VNodeTracker::VNodeTracker):
2962         (WebCore::m_lastWarningTime):
2963
2964 2016-02-29  Chris Dumez  <cdumez@apple.com>
2965
2966         Use HTML parsing rules for textarea.maxLength
2967         https://bugs.webkit.org/show_bug.cgi?id=154805
2968
2969         Reviewed by Andreas Kling.
2970
2971         Use HTML parsing rules for textarea.maxLength:
2972         - https://html.spec.whatwg.org/multipage/forms.html#dom-textarea-maxlength
2973         - https://html.spec.whatwg.org/multipage/infrastructure.html#limited-to-only-non-negative-numbers
2974
2975         No new tests, already covered by existing test.
2976
2977         * html/HTMLTextAreaElement.cpp:
2978         (WebCore::HTMLTextAreaElement::maxLength):
2979
2980 2016-02-29  Chris Dumez  <cdumez@apple.com>
2981
2982         Align td.rowSpan / td.colSpan with the specification
2983         https://bugs.webkit.org/show_bug.cgi?id=154803
2984
2985         Reviewed by Darin Adler.
2986
2987         Align td.rowSpan / td.colSpan with the specification:
2988         - https://html.spec.whatwg.org/multipage/tables.html#htmltablecellelement
2989         - https://html.spec.whatwg.org/multipage/tables.html#dom-tdth-colspan
2990         - https://html.spec.whatwg.org/multipage/tables.html#dom-tdth-rowspan
2991
2992         In particular, the following changes were made:
2993         - Change type from 'long' to 'unsigned long'.
2994         - Use HTML rules for parsing unsigned integers:
2995           - https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-non-negative-integers
2996         - Use 1 as default value when the input value is out of range instead
2997           of 0 when setting.
2998         - rowspan is still clamped to [1, 8190] internally but we now expose the
2999           unclamped value to JS as this is an internal restriction. The same is
3000           done for a colSpan value of 0, we expose 0 to the Web but clamp to 1
3001           internally.
3002
3003         No new tests, already covered by existing test.
3004
3005         * html/HTMLTableCellElement.cpp:
3006         (WebCore::HTMLTableCellElement::colSpan):
3007         (WebCore::HTMLTableCellElement::rowSpan):
3008         (WebCore::HTMLTableCellElement::rowSpanForBindings):
3009         (WebCore::HTMLTableCellElement::setColSpan):
3010         (WebCore::HTMLTableCellElement::setRowSpanForBindings):
3011         (WebCore::HTMLTableCellElement::axis): Deleted.
3012         (WebCore::HTMLTableCellElement::headers): Deleted.
3013         * html/HTMLTableCellElement.h:
3014         * html/HTMLTableCellElement.idl:
3015
3016 2016-02-29  Chris Dumez  <cdumez@apple.com>
3017
3018         [Web IDL] Add support for [TreatNullAs=EmptyString] and use it
3019         https://bugs.webkit.org/show_bug.cgi?id=154654
3020
3021         Reviewed by Darin Adler.
3022
3023         Add support for [TreatNullAs=EmptyString] standard Web IDL extended
3024         attribute:
3025         - http://heycam.github.io/webidl/#TreatNullAs
3026
3027         This replaces the WebKit-specific [TreatNullAs=NullString] IDL
3028         extended attribute. Instead of passing a null String() to the
3029         implementation, emptyString() is passed.
3030
3031         This patch does not cause any web-exposed behavior change. For
3032         case where switching from NullString to EmptyString would change
3033         the behavior (or require changes to the implementation), the old
3034         IDL attribute was kept. However, it was renamed to
3035         [TreatNullAs=LegacyNullString] to discourage its use in new code.
3036         Eventually, this legacy IDL attribute should go away entirely.
3037
3038         [TreatNullAs=EmptyString] should only be used when it is present
3039         in the corresponding specification. Note that there are a lot of
3040         places where we use [TreatNullAs=EmptyString] in our IDL where it
3041         does not match the specification. I have added FIXME comments for
3042         those so we can clean them up later.
3043
3044         No new tests, no web-exposed behavior change.
3045
3046         * Modules/mediastream/RTCPeerConnection.idl:
3047         No behavior change because this is not implemented.
3048
3049         * bindings/js/JSDOMBinding.cpp:
3050         (WebCore::valueToStringTreatingNullAsEmptyString):
3051         * bindings/js/JSDOMBinding.h:
3052         Add new function to convert a JSValue into a String while treating
3053         null as the empty string.
3054
3055         * bindings/scripts/CodeGeneratorJS.pm:
3056         (JSValueToNative):
3057         * bindings/scripts/IDLAttributes.txt:
3058         - Add support for [TreatNullAs=EmptyString].
3059         - Rename NullString to LegacyNullString to discourage its use.
3060
3061         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
3062         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
3063         * bindings/scripts/test/JS/JSTestObj.cpp:
3064         * bindings/scripts/test/ObjC/DOMTestObj.h:
3065         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3066         * bindings/scripts/test/TestObj.idl:
3067         Add bindings tests coverage for [TreatNullAs=EmptyString].
3068
3069         * css/CSSStyleDeclaration.idl:
3070         * dom/CharacterData.idl:
3071         * dom/DOMImplementation.idl:
3072         * dom/Document.idl:
3073         * dom/Element.idl:
3074         * dom/ShadowRoot.idl:
3075         * html/HTMLOutputElement.idl:
3076         * html/HTMLScriptElement.idl:
3077         * html/URLUtils.idl:
3078         * svg/SVGAngle.idl:
3079         * svg/SVGLength.idl:
3080         Use [TreatNullAs=EmptyString] instead of [TreatNullAs=NullString].
3081         There is not behavior change because the implementation does
3082         not distinguish the null string from the empty string.
3083
3084         * html/HTMLBaseElement.idl:
3085         * html/HTMLButtonElement.idl:
3086         * html/HTMLFormElement.idl:
3087         * html/HTMLMediaElement.idl:
3088         * html/HTMLSelectElement.idl:
3089         * svg/SVGElement.idl:
3090         * svg/SVGScriptElement.idl:
3091         Rename [TreatNullAs=NullString] to [TreatNullAs=LegacyNullString],
3092         no behavior change.
3093
3094         * html/HTMLDocument.idl:
3095         - dir and *Color: Rename [TreatNullAs=NullString] to
3096           [TreatNullAs=LegacyNullString].
3097         - designMode: Drop [TreatNullAs=NullString] as per the specification:
3098           - https://html.spec.whatwg.org/multipage/dom.html#the-document-object
3099           null now gets converted to "null" instead of the null String but this
3100           does not change behavior because the implementation only recognizes
3101           "on" / "off" / others. So we still end up using inherit mode when
3102           set to null.
3103
3104         * html/HTMLElement.idl:
3105         - Use [TreatNullAs=EmptyString] instead of [TreatNullAs=NullString] for
3106           innerText / outerText. Does not change behavior because the
3107           implementation does not distinguishes.
3108         - Drop [TreatNullAs=NullString] from contentEditable to match the spec:
3109           - https://html.spec.whatwg.org/multipage/interaction.html#elementcontenteditable
3110           This does not change behavior because the implementation will the a SyntaxError
3111           wether a null String or the string "null" is passed.
3112
3113         * html/HTMLFrameElement.idl:
3114         Drop [TreatNullAs=NullString] from location attribute. This does not
3115         change behavior because the attribute is using a custom setter.
3116
3117         * html/HTMLInputElement.idl:
3118         - formEnctype / formMethod / autocapitalize: Rename [TreatNullAs=NullString] to
3119           [TreatNullAs=LegacyNullString].
3120         - value: Rename [TreatNullAs=NullString] to Rename [TreatNullAs=EmptyString], which
3121           does not change behavior because the implementation does not distinguish. Also
3122           drop the extended attribute for non-JS bindings as it has no impact.
3123
3124         * html/HTMLMediaElement.cpp:
3125         (WebCore::HTMLMediaElement::setMediaGroup):
3126         Drop redundant group.isNull() check as group.isEmpty() already checks for null.
3127
3128         * html/HTMLScriptElement.cpp:
3129         (WebCore::HTMLScriptElement::setText):
3130         Drop useless .impl() call as we have a String and the method requires a String
3131         as input.
3132
3133         * html/HTMLTextAreaElement.cpp:
3134         (WebCore::HTMLTextAreaElement::setValueCommon):
3135         Use emptyString() instead of "" as it is slightly more efficient.
3136
3137         * html/HTMLTextAreaElement.idl:
3138         - value: Use [TreatNullAs=EmptyString] instead of [TreatNullAs=NullString]. No
3139           behavior change because the implementation does not distinguish.
3140         - autocapitalize: Rename [TreatNullAs=NullString] to [TreatNullAs=LegacyNullString].
3141
3142         * html/canvas/CanvasRenderingContext2D.idl:
3143         - globalCompositeOperation / repetitionType: Use [TreatNullAs=EmptyString] instead of
3144           [TreatNullAs=NullString]. No behavior change because the implementation does not
3145           distinguish.
3146         - lineCap / lineJoin: Drop the [TreatNullAs=NullString] to match the spec:
3147           - https://html.spec.whatwg.org/multipage/scripting.html#canvaspathdrawingstyles
3148           There is no behavior change because those are string enumerations and the value
3149           is not recognized either way (String() or String("null")).
3150         - shadowColor: Drop the [TreatNullAs=NullString] to match the spec:
3151           - https://html.spec.whatwg.org/multipage/scripting.html#canvasshadowstyles
3152           No behavior change because this is not a valid color either way.
3153
3154 2016-02-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3155
3156         Refactor FetchBody constructors
3157         https://bugs.webkit.org/show_bug.cgi?id=154721
3158
3159         Reviewed by Sam Weinig and Darin Adler.
3160
3161         Covered by existing tests.
3162
3163         * Modules/fetch/FetchBody.cpp:
3164         (WebCore::FetchBody::extract): Renamed from "fromJSValue"
3165         (WebCore::FetchBody::extractFromBody): Renamed from "fromRequestBody" and making use of move constructor.
3166         * Modules/fetch/FetchBody.h:
3167         (WebCore::FetchBody::FetchBody): Making default constructor public and removing empty static method.
3168         * Modules/fetch/FetchRequest.cpp:
3169         (WebCore::buildBody):
3170         * Modules/fetch/FetchResponse.cpp:
3171         (WebCore::FetchResponse::error):
3172         (WebCore::FetchResponse::redirect):
3173         (WebCore::FetchResponse::initializeWith):
3174         * Modules/fetch/FetchResponse.h:
3175         (WebCore::FetchResponse::create):
3176
3177 2016-02-28  Antti Koivisto  <antti@apple.com>
3178
3179         ::slotted doesn't work in nested shadow trees
3180         https://bugs.webkit.org/show_bug.cgi?id=154765
3181         <rdar://problem/24870995>
3182
3183         Reviewed by Ryosuke Niwa.
3184
3185         See https://github.com/w3c/webcomponents/issues/331#issuecomment-189191593
3186
3187         Test: fast/shadow-dom/css-scoping-shadow-slotted-nested.html
3188
3189         * css/ElementRuleCollector.cpp:
3190         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
3191
3192         Collect ::slotted rules from all the nested shadow trees instead of just the host's.
3193
3194 2016-02-28  Chris Dumez  <cdumez@apple.com>
3195
3196         Parse HTMLOLElement.start as per the HTML spec
3197         https://bugs.webkit.org/show_bug.cgi?id=154802
3198
3199         Reviewed by Andreas Kling.
3200
3201         Parse HTMLOLElement.start as per the HTML spec:
3202         - https://html.spec.whatwg.org/multipage/semantics.html#dom-ol-start
3203         - https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-integers
3204
3205         No new tests, already covered by existing test.
3206
3207         * html/HTMLOListElement.cpp:
3208         (WebCore::HTMLOListElement::parseAttribute):
3209
3210 2016-02-28  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3211
3212         Reduce uses of PassRefPtr in indexeddb
3213         https://bugs.webkit.org/show_bug.cgi?id=154273
3214
3215         Reviewed by Darin Adler.
3216
3217         No new tests, no behavior changes.
3218
3219         * Modules/indexeddb/IDBDatabaseError.h:
3220         (WebCore::IDBDatabaseError::create):
3221         * Modules/indexeddb/IDBKeyData.cpp:
3222         (WebCore::IDBKeyData::maybeCreateIDBKey):
3223         * Modules/indexeddb/IDBKeyData.h:
3224         * Modules/indexeddb/IDBKeyRange.cpp:
3225         (WebCore::IDBKeyRange::create):
3226         (WebCore::IDBKeyRange::IDBKeyRange):
3227         (WebCore::IDBKeyRange::only):
3228         (WebCore::IDBKeyRange::lowerBound):
3229         (WebCore::IDBKeyRange::upperBound):
3230         (WebCore::IDBKeyRange::bound):
3231         * Modules/indexeddb/IDBKeyRange.h:
3232         (WebCore::IDBKeyRange::create):
3233         (WebCore::IDBKeyRange::lower):
3234         (WebCore::IDBKeyRange::upper):
3235         (WebCore::IDBKeyRange::lowerBound):
3236         (WebCore::IDBKeyRange::upperBound):
3237         (WebCore::IDBKeyRange::bound):
3238         * Modules/indexeddb/IDBKeyRangeData.cpp:
3239         (WebCore::IDBKeyRangeData::maybeCreateIDBKeyRange):
3240         * Modules/indexeddb/IDBKeyRangeData.h:
3241         * Modules/indexeddb/IDBServerConnection.h:
3242         * Modules/indexeddb/legacy/IDBCallbacks.h:
3243         * Modules/indexeddb/legacy/IDBCursorBackend.cpp:
3244         (WebCore::IDBCursorBackend::continueFunction):
3245         * Modules/indexeddb/legacy/IDBCursorBackend.h:
3246         * Modules/indexeddb/legacy/IDBCursorBackendOperations.h:
3247         (WebCore::CursorIterationOperation::create):
3248         (WebCore::CursorIterationOperation::CursorIterationOperation):
3249         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
3250         (WebCore::GetOperation::perform):
3251         (WebCore::PutOperation::perform):
3252         * Modules/indexeddb/legacy/LegacyCursor.cpp:
3253         (WebCore::LegacyCursor::continueFunction):
3254         * Modules/indexeddb/legacy/LegacyCursor.h:
3255         * Modules/indexeddb/legacy/LegacyFactory.h:
3256         (WebCore::LegacyFactory::create):
3257         * Modules/indexeddb/legacy/LegacyRequest.cpp:
3258         (WebCore::LegacyRequest::onSuccess):
3259         * Modules/indexeddb/legacy/LegacyRequest.h:
3260         * inspector/InspectorIndexedDBAgent.cpp:
3261
3262 2016-02-28  Tim Horton  <timothy_horton@apple.com>
3263
3264         Switch to application/vnd.apple.folder for <attachment> folder special-case
3265         https://bugs.webkit.org/show_bug.cgi?id=154786
3266         <rdar://problem/24416632>
3267
3268         Reviewed by Anders Carlsson.
3269
3270         No new tests, adjusted an existing test to cover this.
3271
3272         * rendering/RenderThemeMac.mm:
3273         (WebCore::iconForAttachment):
3274         Add a second folder MIME type.
3275
3276 2016-02-28  Tim Horton  <timothy_horton@apple.com>
3277
3278         Variables can resolve to the wrong value when elements differ in nothing but inherited variable value
3279         https://bugs.webkit.org/show_bug.cgi?id=154785
3280
3281         Reviewed by Antti Koivisto.
3282
3283         Test: fast/css/variables/avoid-matched-property-cache.html
3284
3285         * css/StyleResolver.cpp:
3286         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
3287         Disable the matched property cache when a value is variable-dependent, because
3288         they can resolve to inherited values, and the matched property cache could
3289         end up copying the wrong value from another similarly-styled element.
3290
3291 2016-02-28  Konstantin Tokarev  <annulen@yandex.ru>
3292
3293         SVGToOTFFontConversion.cpp does not compile with libstdc++ 4.8
3294         https://bugs.webkit.org/show_bug.cgi?id=154794
3295
3296         Reviewed by Michael Catanzaro.
3297
3298         No new tests needed.
3299
3300         * svg/SVGToOTFFontConversion.cpp:
3301         (WebCore::SVGToOTFFontConverter::appendLigatureSubtable): Added const
3302         qualifiers.
3303
3304 2016-02-27  Chris Dumez  <cdumez@apple.com>
3305
3306         Prevent cross-origin access to Location.assign() / Location.reload()
3307         https://bugs.webkit.org/show_bug.cgi?id=154779
3308
3309         Reviewed by Darin Adler.
3310
3311         Prevent cross-origin access to Location.assign() / Location.reload()
3312         to match the latest specification:
3313         - https://html.spec.whatwg.org/multipage/browsers.html#crossoriginproperties-(-o-)
3314
3315         Firefox and Chrome already prevent this but WebKit allowed it.
3316
3317         No new tests, already covered by existing tests.
3318
3319         * bindings/js/JSLocationCustom.cpp:
3320         (WebCore::JSLocation::getOwnPropertySlotDelegate):
3321         (WebCore::JSLocation::putDelegate): Deleted.
3322
3323 2016-02-27  Andy VanWagoner  <thetalecrafter@gmail.com>
3324
3325         Intl.Collator uses POSIX locale (detected by js/intl-collator.html on iOS Simulator)
3326         https://bugs.webkit.org/show_bug.cgi?id=152448
3327
3328         Reviewed by Darin Adler.
3329
3330         Pass defaultLanguage from Language.h to the globalObjectMethodTable to
3331         ensure Intl objects can be initialized with the correct default locale.
3332
3333         * bindings/js/JSDOMWindowBase.cpp:
3334         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3335
3336 2016-02-27  Chris Dumez  <cdumez@apple.com>
3337
3338         Align HTMLMarqueeElement.scrollAmount / scrollDelay with the specification
3339         https://bugs.webkit.org/show_bug.cgi?id=154781
3340
3341         Reviewed by Darin Adler.
3342
3343         Align HTMLMarqueeElement.scrollAmount / scrollDelay with the
3344         specification:
3345         - https://www.w3.org/TR/html5/obsolete.html#the-marquee-element-0
3346
3347         In particular:
3348         - The attributes should have unsigned long type
3349         - We should not throw for negative values
3350         - Values should be in the range [0, 2147483647] as per:
3351         - https://html.spec.whatwg.org/multipage/infrastructure.html#reflect
3352
3353         No new tests, already covered by existing tests.
3354
3355         * html/HTMLMarqueeElement.cpp:
3356         (WebCore::HTMLMarqueeElement::scrollAmount):
3357         (WebCore::HTMLMarqueeElement::setScrollAmount):
3358         (WebCore::HTMLMarqueeElement::scrollDelay):
3359         (WebCore::HTMLMarqueeElement::setScrollDelay):
3360         (WebCore::HTMLMarqueeElement::loop): Deleted.
3361         * html/HTMLMarqueeElement.h:
3362         * html/HTMLMarqueeElement.idl:
3363
3364 2016-02-27  Commit Queue  <commit-queue@webkit.org>
3365
3366         Unreviewed, rolling out r197204, r197207, r197211, r197217,
3367         r197218, and r197219.
3368         https://bugs.webkit.org/show_bug.cgi?id=154780
3369
3370         Caused crashes in WebVideoFullscreenManagerProxy (Requested by
3371         ap on #webkit).
3372
3373         Reverted changesets:
3374
3375         "Add support for playbackControlsManager"
3376         https://bugs.webkit.org/show_bug.cgi?id=154742
3377         http://trac.webkit.org/changeset/197204
3378
3379         "Attempted build fix."
3380         http://trac.webkit.org/changeset/197207
3381
3382         "Attempted build fix."
3383         http://trac.webkit.org/changeset/197211
3384
3385         "Attempted 32-bit build fix."
3386         http://trac.webkit.org/changeset/197217
3387
3388         "Another 32-bit build fix."
3389         http://trac.webkit.org/changeset/197218
3390
3391         "32-bit!!!"
3392         http://trac.webkit.org/changeset/197219
3393
3394 2016-02-27  Chris Dumez  <cdumez@apple.com>
3395
3396         Optimize parseHTMLInteger()
3397         https://bugs.webkit.org/show_bug.cgi?id=154772
3398
3399         Reviewed by Ryosuke Niwa.
3400
3401         Optimize parseHTMLInteger() a bit now that it is used a lot more and
3402         that it has decent API test coverage. In particular, we now:
3403         - Avoid using a StringBuilder for the digits.
3404         - Get rid of a is8Bit() branch.
3405         - Only traverse the input string once.
3406
3407         * html/parser/HTMLParserIdioms.cpp:
3408         (WebCore::parseHTMLIntegerInternal):
3409         (WebCore::parseHTMLInteger):
3410         (WebCore::parseHTMLNonNegativeInteger): Deleted.
3411
3412 2016-02-27  Andreas Kling  <akling@apple.com>
3413
3414         [iOS] Discard decoded image data on top-level navigation.
3415         <https://webkit.org/b/154776>
3416
3417         Reviewed by Anders Carlsson.
3418
3419         Add a mechanism that destroys decoded data for all CachedImages and invoke it