1841089fd3a788cf3a884ef9810b3223e7ac1ebe
[WebKit.git] / Source / WebCore / ChangeLog
1 2016-01-19  Ryosuke Niwa  <rniwa@webkit.org>
2
3         CharacterData::setData doesn't need ExceptionCode as an out argument
4         https://bugs.webkit.org/show_bug.cgi?id=153225
5
6         Reviewed by Antti Koivisto.
7
8         Removed the ExceptionCode out argument from CharacterData::setData since it's never used.
9
10         * dom/CharacterData.cpp:
11         (WebCore::CharacterData::setData):
12         (WebCore::CharacterData::containsOnlyWhitespace):
13         (WebCore::CharacterData::setNodeValue):
14         (WebCore::CharacterData::setDataAndUpdate):
15         * dom/CharacterData.h:
16         (WebCore::CharacterData::data):
17         (WebCore::CharacterData::dataMemoryOffset):
18         (WebCore::CharacterData::length):
19         * dom/CharacterData.idl:
20         * dom/Range.cpp:
21         (WebCore::Range::processContentsBetweenOffsets):
22         * dom/Text.cpp:
23         (WebCore::Text::replaceWholeText):
24         * editing/markup.cpp:
25         (WebCore::replaceChildrenWithFragment):
26         (WebCore::replaceChildrenWithText):
27         * html/HTMLOptionElement.cpp:
28         (WebCore::HTMLOptionElement::setText):
29         * html/HTMLScriptElement.cpp:
30         (WebCore::HTMLScriptElement::setText):
31         * html/HTMLTitleElement.cpp:
32         (WebCore::HTMLTitleElement::setText):
33
34 2016-01-19  Ryosuke Niwa  <rniwa@webkit.org>
35
36         innerHTML should always add a mutation record for removing all children
37         https://bugs.webkit.org/show_bug.cgi?id=148782
38         <rdar://problem/22571962>
39
40         Reviewed by Antti Koivisto.
41
42         Fixed the bug by disabling WebKit's optimization to avoid the node replacement when the behavior
43         is observable to scripts by either:
44          - Author scripts has a reference to the node
45          - MutationObserver can be observing this subtree
46          - Mutation events can be observing this subtree
47
48         Note that no caller of this function exposes fragment to author scripts so it couldn't be referenced.
49         It also means that we don't need to check DOMNodeInsertedIntoDocument since it doesn't bubble up
50         (it's only relevant if the text node in fragment has its event listener but that's impossible).
51
52         Test: fast/dom/innerHTML-single-text-node.html
53
54         * dom/ChildListMutationScope.h:
55         (WebCore::ChildListMutationScope::canObserve): Added.
56
57         * editing/markup.cpp:
58         (WebCore::hasMutationEventListeners): Added.
59         (WebCore::replaceChildrenWithFragment):
60
61 2016-01-18  Ryosuke Niwa  <rniwa@webkit.org>
62
63         createAttribute should lowercase the attribute name in a HTML document
64         https://bugs.webkit.org/show_bug.cgi?id=153112
65
66         Reviewed by Darin Adler.
67
68         In a HTML document, we should always lowercase localName in document.createAttribute as specified in
69         https://dom.spec.whatwg.org/#dom-document-createattribute:
70
71         1. If localName does not match the Name production in XML, throw an InvalidCharacterError exception.
72         2. If the context object is an HTML document, let localName be converted to ASCII lowercase.
73         3. Return a new attribute whose local name is localName.
74
75         Change WebKit's behavior to match the spec as well as Firefox. document.createAttributeNS will
76         continue to preserve the case as spec'ed.
77
78         No new tests are added since the behavior change is covered by existing tests.
79
80         * dom/Document.cpp:
81         (WebCore::Document::createAttribute):
82
83 2016-01-18  Brady Eidson  <beidson@apple.com>
84
85         Modern IDB: Add private-browsing variant for many IDB tests, and enable private browsing in Modern IDB.
86         https://bugs.webkit.org/show_bug.cgi?id=153179
87
88         Reviewed by Darin Adler.
89
90         Tests: Many private-browsing copies of existing IDB tests.
91
92         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
93         (WebCore::IDBClient::shouldThrowSecurityException): Allow IDB access in private browsing.
94
95 2016-01-18  Eric Carlson  <eric.carlson@apple.com>
96
97         [iOS Simulator WK1] ASSERT loading Blink layout test imported/web-platform-tests/mediacapture-streams/stream-api/mediastream/mediastream-idl.html
98         https://bugs.webkit.org/show_bug.cgi?id=153070
99         <rdar://problem/24183105>
100
101         Reviewed by Darin Adler.
102
103         No new tests, this prevents an existing test from crashing.
104
105         * platform/mock/MockRealtimeVideoSource.cpp:
106         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Create the timer with RunLoop::current
107           instead of RunLoop::main.
108
109 2016-01-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
110
111         Reduce PassRefPtr uses in dom - 3
112         https://bugs.webkit.org/show_bug.cgi?id=153055
113
114         Reviewed by Darin Adler.
115
116         Third patch to reduce uses of PassRefPtr in WebCore/dom.
117
118         * dom/MutationObserverInterestGroup.cpp:
119         (WebCore::MutationObserverInterestGroup::enqueueMutationRecord):
120         * dom/MutationRecord.cpp:
121         (WebCore::MutationRecord::createChildList):
122         (WebCore::MutationRecord::createAttributes):
123         (WebCore::MutationRecord::createCharacterData):
124         (WebCore::MutationRecord::createWithNullOldValue):
125         * dom/MutationRecord.h:
126         * dom/NamedFlowCollection.cpp:
127         (WebCore::NamedFlowCollection::createCSSOMSnapshot):
128         * dom/NamedFlowCollection.h:
129         * dom/PendingScript.cpp:
130         (WebCore::PendingScript::releaseElementAndClear):
131         * dom/PendingScript.h:
132         * dom/ScriptRunner.h:
133         * dom/SecurityContext.h:
134         * dom/ShadowRoot.cpp:
135         (WebCore::ShadowRoot::cloneNode):
136         * dom/ShadowRoot.h:
137         * dom/SpaceSplitString.cpp:
138         (WebCore::SpaceSplitStringData::create):
139         * dom/SpaceSplitString.h:
140         * dom/TreeWalker.cpp:
141         (WebCore::TreeWalker::setCurrent):
142         (WebCore::TreeWalker::parentNode):
143         (WebCore::TreeWalker::previousNode):
144         (WebCore::TreeWalker::nextNode):
145         * dom/TreeWalker.h:
146         * dom/default/PlatformMessagePortChannel.cpp:
147         (WebCore::PlatformMessagePortChannel::entangledChannel):
148         * dom/default/PlatformMessagePortChannel.h:
149
150 2016-01-18  Nan Wang  <n_wang@apple.com>
151
152         AX: [Mac] Implement next/previous text marker functions using TextIterator
153         https://bugs.webkit.org/show_bug.cgi?id=152728
154
155         Reviewed by Chris Fleizach.
156
157         The existing AXTextMarker based calls are implemented using visible position, and that introduced
158         some bugs which make VoiceOver working incorrectly on Mac sometimes. Since TextIterator uses rendering
159         position, we tried to use it to refactor those AXTextMarker based calls.
160         In this patch, I implemented functions to navigate to previous/next text marker using Range and TextIterator.
161         Also added a conversion between visible position and character offset to make sure unconverted text marker
162         related functions are still working correctly.
163
164         Tests: accessibility/mac/previous-next-text-marker.html
165                accessibility/mac/text-marker-with-user-select-none.html
166
167         * accessibility/AXObjectCache.cpp:
168         (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
169         (WebCore::AXObjectCache::traverseToOffsetInRange):
170         (WebCore::AXObjectCache::lengthForRange):
171         (WebCore::AXObjectCache::rangeForNodeContents):
172         (WebCore::characterOffsetsInOrder):
173         (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets):
174         (WebCore::AXObjectCache::setTextMarkerDataWithCharacterOffset):
175         (WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
176         (WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
177         (WebCore::AXObjectCache::nextNode):
178         (WebCore::AXObjectCache::previousNode):
179         (WebCore::AXObjectCache::visiblePositionFromCharacterOffset):
180         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
181         (WebCore::AXObjectCache::accessibilityObjectForTextMarkerData):
182         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
183         * accessibility/AXObjectCache.h:
184         (WebCore::CharacterOffset::CharacterOffset):
185         (WebCore::CharacterOffset::remaining):
186         (WebCore::CharacterOffset::isNull):
187         (WebCore::AXObjectCache::setNodeInUse):
188         (WebCore::AXObjectCache::removeNodeForUse):
189         (WebCore::AXObjectCache::isNodeInUse):
190         * accessibility/AccessibilityObject.cpp:
191         (WebCore::AccessibilityObject::selectionRange):
192         (WebCore::AccessibilityObject::elementRange):
193         (WebCore::AccessibilityObject::selectText):
194         (WebCore::AccessibilityObject::lineRangeForPosition):
195         (WebCore::AccessibilityObject::replacedNodeNeedsCharacter):
196         (WebCore::renderListItemContainerForNode):
197         (WebCore::listMarkerTextForNode):
198         (WebCore::AccessibilityObject::listMarkerTextForNodeAndPosition):
199         (WebCore::AccessibilityObject::stringForRange):
200         (WebCore::AccessibilityObject::stringForVisiblePositionRange):
201         (WebCore::replacedNodeNeedsCharacter): Deleted.
202         * accessibility/AccessibilityObject.h:
203         (WebCore::AccessibilityObject::visiblePositionRange):
204         (WebCore::AccessibilityObject::visiblePositionRangeForLine):
205         (WebCore::AccessibilityObject::boundsForVisiblePositionRange):
206         (WebCore::AccessibilityObject::setSelectedVisiblePositionRange):
207         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
208         (isTextMarkerIgnored):
209         (-[WebAccessibilityObjectWrapper accessibilityObjectForTextMarker:]):
210         (accessibilityObjectForTextMarker):
211         (-[WebAccessibilityObjectWrapper textMarkerRangeFromRange:]):
212         (textMarkerRangeFromRange):
213         (-[WebAccessibilityObjectWrapper startOrEndTextMarkerForRange:isStart:]):
214         (startOrEndTextmarkerForRange):
215         (-[WebAccessibilityObjectWrapper nextTextMarkerForNode:offset:]):
216         (-[WebAccessibilityObjectWrapper previousTextMarkerForNode:offset:]):
217         (-[WebAccessibilityObjectWrapper textMarkerForNode:offset:]):
218         (textMarkerForCharacterOffset):
219         (-[WebAccessibilityObjectWrapper rangeForTextMarkerRange:]):
220         (-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]):
221         (textMarkerForVisiblePosition):
222         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
223
224 2016-01-18  Olivier Blin  <olivier.blin@softathome.com>
225
226         [Mac] Remove unused playerToPrivateMap()
227         https://bugs.webkit.org/show_bug.cgi?id=153203
228
229         Reviewed by Darin Adler.
230
231         This was used in previous EME implementations, but is unnecessary
232         since r163907.
233
234         No new tests since this removes dead code only.
235
236         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
237         (WebCore::globalLoaderDelegateQueue): Deleted.
238         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): Deleted.
239
240 2016-01-18  Simon Fraser  <simon.fraser@apple.com>
241
242         Add TextStream-based logging for Position and VisiblePosition
243         https://bugs.webkit.org/show_bug.cgi?id=153195
244
245         Reviewed by Ryosuke Niwa.
246
247         Make it easy to dump Positions and VisiblePositions with a TextStream.
248
249         * dom/Position.cpp:
250         (WebCore::operator<<):
251         * dom/Position.h:
252         * editing/VisiblePosition.cpp:
253         (WebCore::operator<<):
254         * editing/VisiblePosition.h:
255
256 2016-01-18  Zan Dobersek  <zdobersek@igalia.com>
257
258         Sink the Vector<uint8_t> buffer into the SerializedScriptValue constructor
259         https://bugs.webkit.org/show_bug.cgi?id=142634
260
261         Reviewed by Darin Adler.
262
263         Have the SerializedScriptValue constructor take in the Vector<uint8_t> buffer
264         through an rvalue reference, avoiding the copying into the m_data member. The
265         three-parameter constructor now takes in the Vector<String> blob URL object
266         via const reference, and the std::unique_ptr<> object via a rvalue reference.
267
268         Adjust all the call sites and affected code to now either move or copy a
269         non-movable object into the SerializedScriptValue constructor or the helper
270         methods.
271
272         No new tests -- no change in behavior.
273
274         * bindings/js/IDBBindingUtilities.cpp:
275         (WebCore::deserializeIDBValueDataToJSValue):
276         (WebCore::deserializeIDBValueBuffer):
277         (WebCore::idbValueDataToJSValue):
278         * bindings/js/IDBBindingUtilities.h:
279         * bindings/js/SerializedScriptValue.cpp:
280         (WebCore::SerializedScriptValue::SerializedScriptValue):
281         (WebCore::SerializedScriptValue::create):
282         (WebCore::SerializedScriptValue::numberValue):
283         (WebCore::SerializedScriptValue::undefinedValue):
284         (WebCore::SerializedScriptValue::nullValue):
285         * bindings/js/SerializedScriptValue.h:
286         * testing/Internals.cpp:
287         (WebCore::Internals::deserializeBuffer):
288
289 2016-01-18  Olivier Blin  <olivier.blin@softathome.com>
290
291         [GStreamer] Remove unused m_endTime
292         https://bugs.webkit.org/show_bug.cgi?id=153209
293
294         Reviewed by Michael Catanzaro.
295
296         m_endTime has been unused since r47710 in MediaPlayerPrivateGStreamer.
297
298         No new tests since this is just a member cleanup.
299
300         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
301         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Deleted.
302         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
303
304 2016-01-18  Csaba Osztrogonác  <ossy@webkit.org>
305
306         Fix the --minimal build due to missing VM.h include
307         https://bugs.webkit.org/show_bug.cgi?id=153128
308
309         Reviewed by Michael Catanzaro.
310
311         * bindings/js/WebCoreJSBuiltinInternals.h:
312
313 2016-01-18  Csaba Osztrogonác  <ossy@webkit.org>
314
315         Remove the SKIP_UNUSED_PARAM define
316         https://bugs.webkit.org/show_bug.cgi?id=153129
317
318         Reviewed by Michael Catanzaro.
319
320         * bindings/js/WebCoreJSBuiltinInternals.cpp:
321         (WebCore::JSBuiltinInternalFunctions::visit):
322         (WebCore::JSBuiltinInternalFunctions::initialize):
323         * bindings/js/WebCoreJSBuiltinInternals.h:
324
325 2016-01-17  Simon Fraser  <simon.fraser@apple.com>
326
327         More displaylist tests, and minor cleanup
328         https://bugs.webkit.org/show_bug.cgi?id=153198
329
330         Reviewed by Zalan Bujtas.
331
332         Have the DisplayListRecorder's constructor push the recorder onto the GraphicsContext,
333         and remove that code from GraphicsLayerCA.
334
335         Tests: displaylists/extent-includes-shadow.html
336                displaylists/extent-includes-transforms.html
337
338         * platform/graphics/ca/GraphicsLayerCA.cpp:
339         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
340         * platform/graphics/displaylists/DisplayListRecorder.cpp:
341         (WebCore::DisplayList::Recorder::Recorder):
342
343 2016-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
344
345         Remove TextRun::allowsRoundingHacks()
346         https://bugs.webkit.org/show_bug.cgi?id=153185
347
348         Reviewed by Simon Fraser.
349
350         Rounding hacks are disallowed by default, and are only re-enabled on iOS 4 and
351         earlier, which are not supported OSes. Because they are disallowed on all
352         supported configurations, remove support for them wholesale.
353
354         No new tests.
355
356         * html/canvas/CanvasRenderingContext2D.cpp:
357         (WebCore::CanvasRenderingContext2D::drawTextInternal):
358         * platform/graphics/FontCascade.cpp:
359         * platform/graphics/FontCascade.h:
360         (WebCore::FontCascade::isRoundingHackCharacter): Deleted.
361         * platform/graphics/StringTruncator.cpp:
362         (WebCore::stringWidth):
363         (WebCore::truncateString):
364         (WebCore::StringTruncator::centerTruncate):
365         (WebCore::StringTruncator::rightTruncate):
366         (WebCore::StringTruncator::width):
367         (WebCore::StringTruncator::leftTruncate):
368         (WebCore::StringTruncator::rightClipToCharacter):
369         (WebCore::StringTruncator::rightClipToWord):
370         * platform/graphics/StringTruncator.h:
371         * platform/graphics/TextRun.cpp:
372         (WebCore::TextRun::setAllowsRoundingHacks): Deleted.
373         (WebCore::TextRun::allowsRoundingHacks): Deleted.
374         * platform/graphics/TextRun.h:
375         (WebCore::TextRun::TextRun):
376         (WebCore::TextRun::applyRunRounding): Deleted.
377         (WebCore::TextRun::applyWordRounding): Deleted.
378         (WebCore::TextRun::disableRoundingHacks): Deleted.
379         * platform/graphics/WidthIterator.cpp:
380         (WebCore::WidthIterator::advanceInternal):
381         * platform/graphics/mac/ComplexTextController.cpp:
382         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
383         * platform/mac/DragImageMac.mm:
384         (WebCore::widthWithFont): Deleted.
385         (WebCore::drawAtPoint): Deleted.
386         * rendering/RenderFileUploadControl.cpp:
387         (WebCore::RenderFileUploadControl::fileTextValue):
388         (WebCore::RenderFileUploadControl::paintObject): Deleted.
389         * rendering/RenderListBox.cpp:
390         (WebCore::RenderListBox::paintItemForeground):
391         (WebCore::RenderListBox::updateFromElement): Deleted.
392         * rendering/RenderTextControl.cpp:
393         (WebCore::RenderTextControl::getAverageCharWidth): Deleted.
394         * rendering/RenderTheme.cpp:
395         (WebCore::RenderTheme::fileListNameForWidth):
396         * rendering/RenderThemeMac.mm:
397         (WebCore::RenderThemeMac::fileListNameForWidth):
398         * rendering/svg/SVGInlineTextBox.cpp:
399         (WebCore::SVGInlineTextBox::constructTextRun): Deleted.
400         * rendering/svg/SVGTextMetrics.cpp:
401         (WebCore::SVGTextMetrics::constructTextRun): Deleted.
402         * testing/Internals.cpp:
403         (WebCore::Internals::resetToConsistentState): Deleted.
404         (WebCore::Internals::allowRoundingHacks): Deleted.
405         * testing/Internals.h:
406         * testing/Internals.idl:
407
408 2016-01-16  Andreas Kling  <akling@apple.com>
409
410         Allocate style sheet media queries in BumpArena.
411         <https://webkit.org/b/153188>
412
413         Reviewed by Antti Koivisto.
414
415         Teach the CSS parser to allocate MediaQuery and MediaQueryExp from BumpArena as well.
416
417         * css/CSSGrammar.y.in:
418         * css/MediaQuery.h:
419         * css/MediaQueryExp.h:
420
421 2016-01-16  Michael Catanzaro  <mcatanzaro@igalia.com>
422
423         [GTK] Add a couple comments to ScrollbarThemeGtk
424         https://bugs.webkit.org/show_bug.cgi?id=153184
425
426         Reviewed by Carlos Garcia Campos.
427
428         * platform/gtk/ScrollbarThemeGtk.cpp:
429         (WebCore::ScrollbarThemeGtk::paint):
430
431 2016-01-16  Andreas Kling  <akling@apple.com>
432
433         Give RuleSet a BumpArena and start using it for RuleDataVectors.
434         <https://webkit.org/b/153169>
435
436         Reviewed by Antti Koivisto.
437
438         Since RuleSet only supports appending rules and doesn't need to worry about removing them,
439         it's a great candidate for BumpArena optimizations.
440
441         Give each RuleSet its own BumpArena and teach them how to allocate RuleDataVector objects
442         out of them.
443
444         There are more things that can be done here, ideally all the sub-allocations inside RuleSet
445         that happen via e.g Vector and HashMap would also come out of the BumpArena.
446
447         * css/RuleSet.cpp:
448         (WebCore::RuleSet::RuleSet):
449         (WebCore::RuleSet::addToRuleSet):
450         (WebCore::RuleSet::copyShadowPseudoElementRulesFrom):
451         * css/RuleSet.h:
452         (WebCore::RuleSet::RuleDataVector::create):
453         (WebCore::RuleSet::RuleSet): Deleted.
454
455 2016-01-16  Simon Fraser  <simon.fraser@apple.com>
456
457         Fix flakiness of displaylists/layer-dispay-list.html
458         
459         When toggling "uses display list drawing" on a GraphicsLayerCA, do
460         a repaint.
461
462         * platform/graphics/ca/GraphicsLayerCA.cpp:
463         (WebCore::GraphicsLayerCA::setUsesDisplayListDrawing):
464
465 2016-01-15  Simon Fraser  <simon.fraser@apple.com>
466
467         Remove GraphicsContext::drawConvexPolygon() and GraphicsContext::clipConvexPolygon()
468         https://bugs.webkit.org/show_bug.cgi?id=153174
469
470         Reviewed by Zalan Bujtas.
471
472         GraphicsContext::drawConvexPolygon() and GraphicsContext::clipConvexPolygon() were
473         poorly named (non-convex polygons are allowed), and just syntactic sugar over
474         clipPath() and drawPath().
475         
476         Remove them, but add a convenience function to create a Path from a Vector of 
477         points. For CG, we can use the more efficient CGPathAddLines().
478         
479         Add TextStream dumping for Path.
480
481         * platform/graphics/GraphicsContext.h:
482         * platform/graphics/Path.cpp:
483         (WebCore::Path::polygonPathFromPoints):
484         (WebCore::Path::dump):
485         (WebCore::operator<<):
486         * platform/graphics/Path.h:
487         * platform/graphics/cairo/GraphicsContextCairo.cpp:
488         (WebCore::GraphicsContext::setPlatformShouldAntialias):
489         (WebCore::addConvexPolygonToContext): Deleted.
490         (WebCore::GraphicsContext::drawConvexPolygon): Deleted.
491         (WebCore::GraphicsContext::clipConvexPolygon): Deleted.
492         * platform/graphics/cg/GraphicsContextCG.cpp:
493         (WebCore::addConvexPolygonToPath): Deleted.
494         (WebCore::GraphicsContext::drawConvexPolygon): Deleted.
495         (WebCore::GraphicsContext::clipConvexPolygon): Deleted.
496         * platform/graphics/cg/PathCG.cpp:
497         (WebCore::Path::polygonPathFromPoints):
498         (WebCore::Path::moveTo):
499         (WebCore::Path::addLineTo):
500         (WebCore::Path::addQuadCurveTo):
501         (WebCore::Path::addBezierCurveTo):
502         (WebCore::Path::addArcTo):
503         * platform/graphics/displaylists/DisplayListItems.cpp:
504         (WebCore::DisplayList::Item::sizeInBytes): Deleted.
505         (WebCore::DisplayList::ClipConvexPolygon::ClipConvexPolygon): Deleted.
506         (WebCore::DisplayList::ClipConvexPolygon::apply): Deleted.
507         (WebCore::DisplayList::operator<<): Deleted.
508         (WebCore::DisplayList::addConvexPolygonToPath): Deleted.
509         (WebCore::DisplayList::DrawConvexPolygon::DrawConvexPolygon): Deleted.
510         (WebCore::DisplayList::DrawConvexPolygon::localBounds): Deleted.
511         (WebCore::DisplayList::DrawConvexPolygon::apply): Deleted.
512         * platform/graphics/displaylists/DisplayListItems.h:
513         (WebCore::DisplayList::ClipConvexPolygon::create): Deleted.
514         (WebCore::DisplayList::ClipConvexPolygon::points): Deleted.
515         (WebCore::DisplayList::ClipConvexPolygon::antialias): Deleted.
516         (WebCore::DisplayList::DrawConvexPolygon::create): Deleted.
517         (WebCore::DisplayList::DrawConvexPolygon::points): Deleted.
518         (WebCore::DisplayList::DrawConvexPolygon::antialiased): Deleted.
519         * platform/graphics/displaylists/DisplayListRecorder.cpp:
520         (WebCore::DisplayList::Recorder::drawConvexPolygon): Deleted.
521         (WebCore::DisplayList::Recorder::clipConvexPolygon): Deleted.
522         * platform/graphics/displaylists/DisplayListRecorder.h:
523         * rendering/RenderBoxModelObject.cpp:
524         (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
525         * rendering/RenderElement.cpp:
526         (WebCore::RenderElement::drawLineForBoxSide):
527         * rendering/RenderThemeIOS.mm:
528         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
529         * rendering/RenderThemeMac.mm:
530         (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
531
532 2016-01-16  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
533
534         Add Platform.cpp to ANGLESupport
535
536         https://bugs.webkit.org/show_bug.cgi?id=153120
537
538         Reviewed by Darin Adler.
539
540         No new tests, only addresses a build failure.
541
542         * CMakeLists.txt:
543
544 2016-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>
545
546         [GTK] List box selections stopped working again with GTK+ from current git master
547         https://bugs.webkit.org/show_bug.cgi?id=153122
548
549         Reviewed by Michael Catanzaro.
550
551         The problem is that the ListBox selection implementation is
552         wrong. We are using a similar implementation to GtkEntry, but
553         GtkTreeView doesn't have a child CSS node for selections.
554
555         * rendering/RenderThemeGtk.cpp:
556         (WebCore::styleColor): Don't use a child style context for ListBox selections.
557         (WebCore::createStyleContext): Remove ListBoxSelection.
558
559 2016-01-14  Carlos Garcia Campos  <cgarcia@igalia.com>
560
561         [SOUP] Initialize HTTP version of ResourceResponse
562         https://bugs.webkit.org/show_bug.cgi?id=153088
563
564         Reviewed by Michael Catanzaro.
565
566         * platform/network/soup/ResourceResponseSoup.cpp:
567         (WebCore::ResourceResponse::updateFromSoupMessage):
568
569 2016-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
570
571         Tiny cleanup in FontFaceComparator
572         https://bugs.webkit.org/show_bug.cgi?id=153044
573
574         Reviewed by Zalan Bujtas.
575
576         This is a follow-up patch to r194923.
577
578         No new tests because there is no behavior change.
579
580         * css/CSSFontSelector.cpp:
581         (WebCore::FontFaceComparator::FontFaceComparator):
582         (WebCore::FontFaceComparator::operator()):
583
584 2016-01-15  Jiewen Tan  <jiewen_tan@apple.com>
585
586         FrameLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame() is never called when loading a main resource from the memory cache
587         https://bugs.webkit.org/show_bug.cgi?id=152520
588         <rdar://problem/23305737>
589
590         Reviewed by Andy Estes.
591
592         Test: http/tests/loading/server-redirect-for-provisional-load-caching.html
593
594         * loader/DocumentLoader.cpp:
595         (WebCore::DocumentLoader::responseReceived):
596         Dispatch message to notify client that a cached resource was redirected. So,
597         client can make proper actions to treat server side redirection.
598         * loader/cache/CachedRawResource.h:
599         Add a method to tell whether the cached resource was redirected.
600
601 2016-01-15  Chris Dumez  <cdumez@apple.com>
602
603         Drop obsolete HTMLDocument.width / height attributes
604         https://bugs.webkit.org/show_bug.cgi?id=153144
605
606         Reviewed by Ryosuke Niwa.
607
608         Drop obsolete HTMLDocument.width / height attributes as these are
609         obsolete and already not supported by other major browsers (tested
610         Firefox and Chrome).
611
612         No new tests, already covered by existing tests.
613
614         * html/HTMLDocument.idl:
615
616 2016-01-15  Chris Dumez  <cdumez@apple.com>
617
618         Drop obsolete DocumentType.entities / notations
619         https://bugs.webkit.org/show_bug.cgi?id=153147
620
621         Reviewed by Ryosuke Niwa.
622
623         Drop obsolete DocumentType.entities / notations attributes.
624
625         Firefox and Chrome already dropped those. We already dropped support for
626         entities and notations so these always returned null.
627
628         No new tests, already covered by existing tests.
629
630         * dom/DocumentType.h:
631         * dom/DocumentType.idl:
632
633 2016-01-10  Simon Fraser  <simon.fraser@apple.com>
634
635         Make a way to test display-list drawing
636         https://bugs.webkit.org/show_bug.cgi?id=152956
637
638         Reviewed by Ryosuke Niwa.
639
640         Make it possible to toggle display-list drawing for a given compositing
641         layer via internals, as well as getting a textual representation of the display
642         list, optionally including items with platform-specific behavior.
643         
644         Add one test that uses this.
645
646         Test: displaylists/layer-dispay-list.html
647
648         * platform/graphics/GraphicsLayer.h:
649         (WebCore::GraphicsLayer::displayListAsText):
650         * platform/graphics/ca/GraphicsLayerCA.cpp:
651         (WebCore::GraphicsLayerCA::displayListAsText):
652         * platform/graphics/ca/GraphicsLayerCA.h:
653         * platform/graphics/displaylists/DisplayList.cpp:
654         (WebCore::DisplayList::DisplayList::shouldDumpForFlags):
655         (WebCore::DisplayList::DisplayList::asText):
656         * platform/graphics/displaylists/DisplayList.h:
657         * rendering/RenderLayerBacking.cpp:
658         (WebCore::RenderLayerBacking::setUsesDisplayListDrawing):
659         (WebCore::RenderLayerBacking::displayListAsText):
660         * rendering/RenderLayerBacking.h:
661         * testing/Internals.cpp:
662         (WebCore::Internals::setElementUsesDisplayListDrawing):
663         (WebCore::Internals::displayListForElement):
664         * testing/Internals.h:
665         * testing/Internals.idl:
666
667 2016-01-15  Olivier Blin  <olivier.blin@softathome.com>
668
669         Fix audio build with video disabled
670         https://bugs.webkit.org/show_bug.cgi?id=153134
671
672         Reviewed by Michael Catanzaro.
673
674         Build fails when WebAudio is enabled but VIDEO disabled.
675
676         No new tests since this is a build fix only.
677
678         * platform/audio/PlatformMediaSession.cpp:
679         * platform/audio/PlatformMediaSession.h:
680         * platform/audio/PlatformMediaSessionManager.cpp:
681         * testing/Internals.cpp:
682         (WebCore::Internals::setAudioContextRestrictions):
683
684 2016-01-15  Olivier Blin  <olivier.blin@softathome.com>
685
686         [GTK] Fix build of RenderThemeGtk without VIDEO by including HTMLInputElement
687         https://bugs.webkit.org/show_bug.cgi?id=153133
688
689         Reviewed by Michael Catanzaro.
690
691         Build was fine with VIDEO enabled, since HTMLInputElement.h was
692         included by transitivity through MediaControlElements.h and
693         MediaControlElementTypes.h.
694
695         This seems to be broken since r194847.
696
697         No new tests since this is just a build fix.
698
699         * rendering/RenderThemeGtk.cpp:
700
701 2016-01-15  Ryosuke Niwa  <rniwa@webkit.org>
702
703         createElementNS and createAttributeNS should treat undefined namespaceURI as null string
704         https://bugs.webkit.org/show_bug.cgi?id=153119
705
706         Reviewed by Chris Dumez.
707
708         Treat undefined as null in document.createElementNS and document.createAttributeNS as defined in:
709         https://dom.spec.whatwg.org/#document
710
711         Test: fast/dom/Document/createAttributeNS-undefined-namespace.html
712
713         * dom/Document.idl:
714
715 2016-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
716
717         [Cocoa] Font features are not applied to the system font
718         https://bugs.webkit.org/show_bug.cgi?id=153053
719
720         Reviewed by Dean Jackson.
721
722         We simply need to call preparePlatformFont() on it.
723
724         Test: fast/text/system-font-features.html
725
726         * platform/graphics/cocoa/FontCacheCoreText.cpp:
727         (WebCore::fontWithFamily):
728
729 2016-01-15  Tim Horton  <timothy_horton@apple.com>
730
731         Data detector yellow highlight location is vertically mirrored in WebKit1
732         https://bugs.webkit.org/show_bug.cgi?id=152216
733         <rdar://problem/23848003>
734
735         Reviewed by Beth Dakin.
736
737         No new tests, because we currently have no decent mechanism for testing
738         where TextIndicator/Lookup/DataDetectors actually make it to the screen,
739         nor for synthetic force-click in WebKit1.
740
741         * editing/mac/DictionaryLookup.h:
742         * editing/mac/DictionaryLookup.mm:
743         (WebCore::showPopupOrCreateAnimationController):
744         (WebCore::DictionaryLookup::showPopup):
745         (WebCore::DictionaryLookup::animationControllerForPopup):
746         Add an optional function for converting between root-FrameView and
747         handed-in-NSView coordinates, and use it to convert textBoundingRectInRootViewCoordinates
748         into the coordinates of the WebView.
749
750 2016-01-15  Joseph Pecoraro  <pecoraro@apple.com>
751
752         Media Query (-webkit-video-playable-inline) is failing as an invalid media query expression
753         https://bugs.webkit.org/show_bug.cgi?id=153111
754
755         Reviewed by Dean Jackson.
756
757         Test: fast/media/video-playable-inline-media-query.html
758
759         * css/MediaQueryEvaluator.cpp:
760         (WebCore::video_playable_inlineMediaFeatureEval):
761         (WebCore::isRunningOnIPhoneOrIPod): Deleted.
762         Make the media query work regardless of the platform.
763         It should just check the web view's settings.
764
765         * css/MediaQueryExp.cpp:
766         (WebCore::featureWithoutValue):
767         This media query expects no value, include it in the list
768         so it is not treated as invalid.
769
770 2016-01-15  Zalan Bujtas  <zalan@apple.com>
771
772         ASSERTION FAILED: canHaveChildren() || canHaveGeneratedChildren() in WebCore::RenderElement::insertChildInternal
773         https://bugs.webkit.org/show_bug.cgi?id=123331
774
775         Reviewed by Darin Adler.
776
777         Do not set named flow fragment bit on the flow until after the renderer is attached. Setting/resetting it too early
778         could affect the attach/detach process itself (This is similar to attaching a multi column flow thread).
779
780         Test: fast/regions/input-box-with-region-assert.html
781
782         * rendering/RenderBlockFlow.cpp:
783         (WebCore::RenderBlockFlow::willBeDestroyed):
784         (WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded):
785         (WebCore::RenderBlockFlow::setRenderNamedFlowFragment):
786
787 2016-01-15  Simon Fraser  <simon.fraser@apple.com>
788
789         Add kdebug_trace signposts for a few WebCore operations
790         https://bugs.webkit.org/show_bug.cgi?id=153136
791         rdar://problem/24208487
792
793         Reviewed by Sam Weinig.
794
795         Add trace points for style recalc, layout, view painting and layer painting.
796
797         * dom/Document.cpp:
798         (WebCore::Document::recalcStyle):
799         * page/FrameView.cpp:
800         (WebCore::FrameView::layout):
801         (WebCore::FrameView::paintContents):
802         * platform/graphics/ca/GraphicsLayerCA.cpp:
803         (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
804
805 2016-01-15  Andreas Kling  <akling@apple.com>
806
807         Use BumpArena for style sheet object tree.
808         <https://webkit.org/b/152696>
809
810         Reviewed by Antti Koivisto.
811
812         Give each StyleSheetContents its own BumpArena, and plumb it down through CSSParser
813         to allocate StyleRule, StyleProperties and CSSSelectorList's selector arrays there.
814
815         This basically means that most objects that make up a given style sheet will end up
816         in one (or a few) contiguous region(s) of memory, instead of being scattered all
817         over the malloc heap.
818
819         In the common case (no CSSOM manipulation), the lifetimes of these objects are very
820         predictable: everything tends to die when the StyleSheetContents dies.
821         This dramatically improves space-efficiency in those cases, and allows us to return
822         contiguous chunks of memory to the system once a style sheet is no longer needed.
823
824         One-off CSS parses that don't work within a StyleSheetContents context will have
825         their StyleRules & co allocated through FastMalloc just like before.
826
827         Bonus: give SelectorQueryCache a dedicated BumpArena as well, since it has very
828         predictable lifetime.
829
830         * css/CSSGrammar.y.in:
831         * css/CSSKeyframesRule.h:
832         (WebCore::StyleRuleKeyframes::create):
833         * css/CSSParser.cpp:
834         (WebCore::CSSParser::createStyleProperties):
835         (WebCore::CSSParser::createMediaRule):
836         (WebCore::CSSParser::createSupportsRule):
837         (WebCore::CSSParser::createKeyframesRule):
838         (WebCore::CSSParser::setArena):
839         (WebCore::CSSParser::arena):
840         (WebCore::CSSParser::createStyleRule):
841         (WebCore::CSSParser::createFontFaceRule):
842         (WebCore::CSSParser::createPageRule):
843         (WebCore::CSSParser::createRegionRule):
844         (WebCore::CSSParser::createViewportRule):
845         * css/CSSParser.h:
846         * css/CSSParserValues.cpp:
847         (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
848         (WebCore::CSSParserSelector::adoptSelectorVector):
849         * css/CSSParserValues.h:
850         * css/CSSSelectorList.cpp:
851         (WebCore::CSSSelectorList::CSSSelectorList):
852         (WebCore::CSSSelectorList::adoptSelectorVector):
853         (WebCore::CSSSelectorList::deleteSelectors):
854         * css/CSSSelectorList.h:
855         * css/StyleProperties.cpp:
856         (WebCore::ImmutableStyleProperties::create):
857         (WebCore::StyleProperties::immutableCopyIfNeeded):
858         * css/StyleProperties.h:
859         * css/StyleRule.cpp:
860         (WebCore::StyleRule::create):
861         (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
862         (WebCore::StyleRuleRegion::StyleRuleRegion):
863         * css/StyleRule.h:
864         (WebCore::StyleRule::create):
865         (WebCore::StyleRule::parserAdoptSelectorVector):
866         (WebCore::StyleRuleFontFace::create):
867         (WebCore::StyleRulePage::create):
868         (WebCore::StyleRulePage::parserAdoptSelectorVector):
869         (WebCore::StyleRuleMedia::create):
870         (WebCore::StyleRuleSupports::create):
871         (WebCore::StyleRuleRegion::create):
872         (WebCore::StyleRuleViewport::create):
873         * css/StyleSheetContents.cpp:
874         (WebCore::StyleSheetContents::StyleSheetContents):
875         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
876         (WebCore::StyleSheetContents::parseStringAtPosition):
877         * css/StyleSheetContents.h:
878         * dom/SelectorQuery.cpp:
879         (WebCore::SelectorQueryCache::SelectorQueryCache):
880         (WebCore::SelectorQueryCache::add):
881         * dom/SelectorQuery.h:
882         * svg/SVGFontFaceElement.cpp:
883         (WebCore::SVGFontFaceElement::SVGFontFaceElement):
884
885 2016-01-15  Dave Hyatt  <hyatt@apple.com>
886
887         Avoid downloading the wrong image for <picture> elements.
888         https://bugs.webkit.org/show_bug.cgi?id=153027
889
890         Reviewed by Dean Jackson.
891
892         No tests, since they are always flaky.
893
894         * html/HTMLImageElement.cpp:
895         (WebCore::HTMLImageElement::HTMLImageElement):
896         (WebCore::HTMLImageElement::~HTMLImageElement):
897         (WebCore::HTMLImageElement::createForJSConstructor):
898         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
899         (WebCore::HTMLImageElement::insertedInto):
900         (WebCore::HTMLImageElement::removedFrom):
901         (WebCore::HTMLImageElement::pictureElement):
902         (WebCore::HTMLImageElement::setPictureElement):
903         (WebCore::HTMLImageElement::width):
904         * html/HTMLImageElement.h:
905         (WebCore::HTMLImageElement::hasShadowControls):
906         * html/HTMLPictureElement.h:
907         * html/parser/HTMLConstructionSite.cpp:
908         (WebCore::HTMLConstructionSite::createHTMLElement):
909         * html/parser/HTMLPreloadScanner.cpp:
910         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
911
912         Images that are built underneath a <picture> element are now connected
913         to that picture element via a setPictureNode call from the parser. This
914         ensures that the correct <source> elements are examined before checking the image.
915
916         This connection between images and their picture owners is handled using a static
917         HashMap in HTMLImageElement. This connection is made both from the parser and from
918         DOM insertions, and the map is queried now instead of looking directly at the
919         image's parentNode().
920
921 2016-01-15  Youenn Fablet  <youenn.fablet@crf.canon.fr>
922
923         [Streams API] Expose ReadableStream and relatives to Worker
924         https://bugs.webkit.org/show_bug.cgi?id=152066
925
926         Reviewed by Darin Adler.
927
928         Covered by rebased tests.
929
930         * Modules/streams/ByteLengthQueuingStrategy.idl:
931         * Modules/streams/CountQueuingStrategy.idl:
932         * Modules/streams/ReadableStream.idl:
933         * Modules/streams/ReadableStreamController.idl:
934         * Modules/streams/ReadableStreamReader.idl:
935
936 2016-01-15  Youenn Fablet  <youenn.fablet@crf.canon.fr>
937
938         CORS: Fix the handling of redirected request containing Origin null.
939         https://bugs.webkit.org/show_bug.cgi?id=128816
940
941         Reviewed by Brent Fulgham.
942
943         Merging Blink patch from George Ancil (https://chromiumcodereview.appspot.com/20735002).
944
945         This patch removes the check for securityOrigin->isUnique() in passesAccessControlCheck().
946         This check prevented a redirected request with "Origin: null" from being
947         successful even when the response contains "Access-Control-Allow-Origin: null"
948
949         Tests: http/tests/xmlhttprequest/access-control-sandboxed-iframe-allow-origin-null.html
950                http/tests/xmlhttprequest/redirect-cors-origin-null.html
951
952         * loader/CrossOriginAccessControl.cpp:
953         (WebCore::passesAccessControlCheck):
954
955 2016-01-14  Commit Queue  <commit-queue@webkit.org>
956
957         Unreviewed, rolling out r195064.
958         https://bugs.webkit.org/show_bug.cgi?id=153118
959
960         test fails most of the time (Requested by alexchristensen on
961         #webkit).
962
963         Reverted changeset:
964
965         "Avoid downloading the wrong image for <picture> elements."
966         https://bugs.webkit.org/show_bug.cgi?id=153027
967         http://trac.webkit.org/changeset/195064
968
969 2016-01-14  Ryosuke Niwa  <rniwa@webkit.org>
970
971         createElement should not lowercase non-ASCII characters
972         https://bugs.webkit.org/show_bug.cgi?id=153114
973
974         Reviewed by Alex Christensen.
975
976         According to step 2 in https://dom.spec.whatwg.org/#dom-document-createelement, document.createElement should not
977         lowercase non-ASCII letters, and this is also what Firefox does. Match that behavior by lowercasing the tag name
978         by convertToASCIILowercase() instead of lower() in createElement.
979
980         Also merged HTMLDocument::createElement into Document::createElement for simplicity and avoid duplicating
981         the call to isValidName and setting a DOM exception.
982
983         No new tests since the behavior change is covered by the existing W3C tests.
984
985         * dom/Document.cpp:
986         (WebCore::Document::createElement): Create a HTML element with ASCII-lowercased tag name inside a HTML document.
987         * dom/Document.h:
988         * html/HTMLDocument.cpp:
989         (WebCore::addLocalNameToSet):
990         (WebCore::HTMLDocument::createElement): Merged into Document::createElement.
991         * html/HTMLDocument.h:
992
993 2016-01-14  Brady Eidson  <beidson@apple.com>
994
995         Modern IDB: Support opening and deleting SQLite databases on disk.
996         https://bugs.webkit.org/show_bug.cgi?id=153084
997
998         Reviewed by Alex Christensen, Sam Weinig and Andy Estes (oh my!).
999
1000         No new tests (Infrastructure, no testable change in behavior).
1001
1002         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
1003         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
1004         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1005
1006         * Modules/indexeddb/server/IDBServer.cpp:
1007         (WebCore::IDBServer::IDBServer::create):
1008         (WebCore::IDBServer::IDBServer::IDBServer):
1009         (WebCore::IDBServer::IDBServer::createBackingStore):
1010         * Modules/indexeddb/server/IDBServer.h:
1011
1012         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1013         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
1014         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
1015         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
1016         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1017
1018         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1019         (WebCore::InProcessIDBServer::create):
1020         (WebCore::InProcessIDBServer::InProcessIDBServer):
1021         * Modules/indexeddb/shared/InProcessIDBServer.h:
1022
1023 2016-01-14  Myles C. Maxfield  <mmaxfield@apple.com>
1024
1025         Mixing Content Blocking of fonts and display:none rules causes battery drain
1026         https://bugs.webkit.org/show_bug.cgi?id=153051
1027         <rdar://problem/23187709>
1028
1029         Reviewed by Alex Christensen.
1030
1031         If we have applied a rule before and we are not applying it again, don't
1032         resolve the style again.
1033
1034         Test: http/tests/contentextensions/font-display-none-repeated-layout.html
1035
1036         * contentextensions/ContentExtensionStyleSheet.cpp:
1037         (WebCore::ContentExtensions::ContentExtensionStyleSheet::addDisplayNoneSelector):
1038         * contentextensions/ContentExtensionStyleSheet.h:
1039         * dom/ExtensionStyleSheets.cpp:
1040         (WebCore::ExtensionStyleSheets::addDisplayNoneSelector):
1041
1042 2016-01-14  Ryosuke Niwa  <rniwa@webkit.org>
1043
1044         Add document.defineCustomElement
1045         https://bugs.webkit.org/show_bug.cgi?id=153092
1046
1047         Reviewed by Chris Dumez.
1048
1049         Added document.defineCustomElement and added a constructor to HTMLElement which can be called
1050         as "super" in a subclass of HTMLElement. This is a prototype of new custom elements API and
1051         willfully violates the current specification at http://w3c.github.io/webcomponents/spec/custom/
1052
1053         Each author defined class can define multiple elements using distinct tag names. In such cases,
1054         the super call must specify the tag name. e.g.
1055
1056         class SomeCustomElement extends HTMLElement { constructor(name) { super(name); } }
1057         document.defineCustomElement('some-custom-element', SomeCustomElement);
1058         document.defineCustomElement('other-custom-element', SomeCustomElement);
1059         new SomeCustomElement('some-custom-element');
1060
1061         When a class is associated with exactly one tag name, the argument can be omitted. e.g.
1062
1063         class AnotherCustomElement extends HTMLElement {}
1064         document.defineCustomElement('another-custom-element', AnotherCustomElement);
1065         new AnotherCustomElement();
1066
1067         We allow only subclassing of HTMLElement and only in (X)HTML namespace.
1068
1069         Tests: fast/custom-elements/Document-defineCustomElement.html
1070                fast/custom-elements/HTMLElement-constructor.html
1071
1072         * CMakeLists.txt:
1073         * WebCore.xcodeproj/project.pbxproj:
1074
1075         * bindings/js/JSCustomElementInterface.cpp: Added. Abstracts an author-defined class associated
1076         with a custom element. It's a Active DOM object and lives until the associated document dies.
1077         (WebCore::JSCustomElementInterface::JSCustomElementInterface):
1078         (WebCore::JSCustomElementInterface::~JSCustomElementInterface):
1079         * bindings/js/JSCustomElementInterface.h: Added.
1080         (WebCore::JSCustomElementInterface::create):
1081         (WebCore::JSCustomElementInterface::scriptExecutionContext):
1082         (WebCore::JSCustomElementInterface::constructor):
1083
1084         * bindings/js/JSDocumentCustom.cpp:
1085         (WebCore::JSDocument::defineCustomElement): Added. Define a custom element by associating a tag
1086         name with an author defined JS class after validating arguments.
1087
1088         * bindings/js/JSHTMLElementCustom.cpp:
1089         (WebCore::constructJSHTMLElement): Added. Look up the tag name based on new.target if one is not
1090         specified. If a tag name is specified, check that new.target is associated with the tag name.
1091
1092         * dom/CustomElementDefinitions.cpp: Added.
1093         (WebCore::CustomElementDefinitions::checkName): Added. Restricts tag names similarly to
1094         http://w3c.github.io/webcomponents/spec/custom/#dfn-custom-element-type
1095         (WebCore::CustomElementDefinitions::defineElement): Added. Associates a JS class with a tag name.
1096         (WebCore::CustomElementDefinitions::findInterface): Added. Finds a JS class by a tag name.
1097         (WebCore::CustomElementDefinitions::findName): Added. Finds a tag name by a JS class.
1098         * dom/CustomElementDefinitions.h: Added.
1099         (WebCore::CustomElementDefinitions::CustomElementInfo): Added.
1100
1101         * dom/Document.cpp:
1102         (WebCore::Document::ensureCustomElementDefinitions): Added.
1103         * dom/Document.h:
1104         (WebCore::Document::customElementDefinitions): Added.
1105
1106         * dom/Document.idl:
1107         * html/HTMLElement.idl:
1108
1109 2016-01-14  Simon Fraser  <simon.fraser@apple.com>
1110
1111         Remove workaround for rdar://problem/23623670
1112         https://bugs.webkit.org/show_bug.cgi?id=153107
1113         rdar://problem/23633319
1114
1115         Reviewed by Tim Horton.
1116
1117         Remove the code that uses IOSurfaceAcceleratorTransformSurface() when copying from
1118         back-to-front buffer, now that CGIOSurfaceContextCreate()-code path works correctly.
1119
1120         * platform/graphics/cocoa/IOSurface.h:
1121         * platform/graphics/cocoa/IOSurface.mm:
1122         (IOSurface::ensurePlatformContext):
1123         (IOSurface::copyToSurface): Deleted.
1124
1125 2016-01-14  Beth Dakin  <bdakin@apple.com>
1126
1127         WK1 and WK2 should share more candidate request code
1128         https://bugs.webkit.org/show_bug.cgi?id=153108
1129
1130         Reviewed by Simon Fraser.
1131
1132         requestCandidatesForSelection() does not need to be exposed as an 
1133         EditorClient function. WK1 can just call invoke this code from the existing 
1134         respondToChangedSelection EditorClient function, which is what WK2 does.
1135         * editing/Editor.cpp:
1136         (WebCore::Editor::respondToChangedSelection):
1137         * loader/EmptyClients.h:
1138         * page/EditorClient.h:
1139         (WebCore::EditorClient::supportsGlobalSelection):
1140
1141 2016-01-14  Beth Dakin  <bdakin@apple.com>
1142
1143         WK2: Request completion candidates when needed
1144         https://bugs.webkit.org/show_bug.cgi?id=153040
1145         -and corresponding-
1146         rdar://problem/24155631
1147
1148         Reviewed by Enrica Casucci and Tim Horton.
1149
1150         Helper functions for stringForCandidateRequest() and 
1151         handleAcceptedCandidate()
1152         * editing/Editor.cpp:
1153         (WebCore::candidateRangeForSelection):
1154         (WebCore::candidateWouldReplaceText):
1155
1156         Request candidates for the word that is currently being typed so long as the 
1157         candidate would replace that word. Otherwise, use String().
1158         (WebCore::Editor::stringForCandidateRequest):
1159
1160         When a candidate has been accepted, insert the text.
1161         (WebCore::Editor::handleAcceptedCandidate):
1162         * editing/Editor.h:
1163
1164 2016-01-14  Daniel Bates  <dabates@apple.com>
1165
1166         Disallow use of Geolocation service from unique origins
1167         https://bugs.webkit.org/show_bug.cgi?id=153102
1168         <rdar://problem/23055645>
1169
1170         Reviewed by Alexey Proskuryakov.
1171
1172         Tests: fast/dom/Geolocation/dataURL-getCurrentPosition.html
1173                fast/dom/Geolocation/dataURL-watchPosition.html
1174                fast/dom/Geolocation/srcdoc-getCurrentPosition.html
1175                fast/dom/Geolocation/srcdoc-watchPosition.html
1176                http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html
1177                http/tests/security/sandboxed-iframe-geolocation-watchPosition.html
1178
1179         * Modules/geolocation/Geolocation.cpp:
1180         (WebCore::Geolocation::securityOrigin): Convenience function to get the SecurityOrigin object
1181         associated with this script execution context.
1182         (WebCore::Geolocation::startRequest): Notify requester POSITION_UNAVAILABLE when requested
1183         from a document with a unique origin.
1184         * Modules/geolocation/Geolocation.h:
1185         * page/SecurityOrigin.h:
1186         (WebCore::SecurityOrigin::canRequestGeolocation): Added.
1187
1188 2016-01-14  Daniel Bates  <dabates@apple.com>
1189
1190         [XSS Auditor] Extract attribute truncation logic and formalize string canonicalization
1191         https://bugs.webkit.org/show_bug.cgi?id=152874
1192
1193         Reviewed by Brent Fulgham.
1194
1195         Derived from Blink patch (by Tom Sepez <tsepez@chromium.org>):
1196         <https://src.chromium.org/viewvc/blink?revision=176339&view=revision>
1197
1198         Extract the src-like and script-like attribute truncation logic into independent functions
1199         towards making it more straightforward to re-purpose this logic. Additionally, formalize the
1200         concept of string canonicalization as a member function that consolidates the process of
1201         decoding URL escape sequences, truncating the decoded string (if applicable), and removing
1202         characters that are considered noise.
1203
1204         * html/parser/XSSAuditor.cpp:
1205         (WebCore::truncateForSrcLikeAttribute): Extracted from XSSAuditor::decodedSnippetForAttribute().
1206         (WebCore::truncateForScriptLikeAttribute): Ditto.
1207         (WebCore::XSSAuditor::init): Write in terms of XSSAuditor::canonicalize().
1208         (WebCore::XSSAuditor::filterCharacterToken): Updated to make use of formalized canonicalization methods.
1209         (WebCore::XSSAuditor::filterScriptToken): Ditto.
1210         (WebCore::XSSAuditor::filterObjectToken): Ditto.
1211         (WebCore::XSSAuditor::filterParamToken): Ditto.
1212         (WebCore::XSSAuditor::filterEmbedToken): Ditto.
1213         (WebCore::XSSAuditor::filterAppletToken): Ditto.
1214         (WebCore::XSSAuditor::filterFrameToken): Ditto.
1215         (WebCore::XSSAuditor::filterInputToken): Ditto.
1216         (WebCore::XSSAuditor::filterButtonToken): Ditto.
1217         (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected): Ditto.
1218         (WebCore::XSSAuditor::eraseAttributeIfInjected): Updated code to use early return style and avoid an unnecessary string
1219         comparison when we know that a src attribute was injected.
1220         (WebCore::XSSAuditor::canonicalizedSnippetForTagName): Renamed; formerly known as XSSAuditor::decodedSnippetForName(). Updated
1221         to make use of XSSAuditor::canonicalize().
1222         (WebCore::XSSAuditor::snippetFromAttribute): Renamed; formerly known as XSSAuditor::decodedSnippetForAttribute(). Moved
1223         truncation logic from here to WebCore::truncateFor{Script, Src}LikeAttribute.
1224         (WebCore::XSSAuditor::canonicalize): Added.
1225         (WebCore::XSSAuditor::canonicalizedSnippetForJavaScript): Added.
1226         (WebCore::canonicalize): Deleted.
1227         (WebCore::XSSAuditor::decodedSnippetForName): Deleted.
1228         (WebCore::XSSAuditor::decodedSnippetForAttribute): Deleted.
1229         (WebCore::XSSAuditor::decodedSnippetForJavaScript): Deleted.
1230         * html/parser/XSSAuditor.h: Define enum class for the various attribute truncation styles.
1231
1232 2016-01-14  Daniel Bates  <dabates@apple.com>
1233
1234         [XSS Auditor] Partial bypass when web server collapses path components
1235         https://bugs.webkit.org/show_bug.cgi?id=152872
1236
1237         Reviewed by Brent Fulgham.
1238
1239         Merged from Blink (patch by Tom Sepez <tsepez@chromium.org>):
1240         <https://src.chromium.org/viewvc/blink?revision=167610&view=revision>
1241
1242         Test: http/tests/security/xssAuditor/embed-tag-in-path-unterminated.html
1243
1244         * html/parser/XSSAuditor.cpp:
1245         (WebCore::isNonCanonicalCharacter):
1246         (WebCore::XSSAuditor::init):
1247         (WebCore::XSSAuditor::decodedSnippetForName):
1248         (WebCore::XSSAuditor::decodedSnippetForAttribute):
1249         (WebCore::XSSAuditor::decodedSnippetForJavaScript):
1250         (WebCore::fullyDecodeString): Deleted.
1251
1252 2016-01-14  Beth Dakin  <bdakin@apple.com>
1253
1254         imported/blink/editing/text-iterator/read-past-cloned-first-letter.html 
1255         crashes
1256         https://bugs.webkit.org/show_bug.cgi?id=153104
1257         -and corresponding-
1258         rdar://problem/24155631
1259
1260         Reviewed by Simon Fraser.
1261
1262         Though we merged the Blink test, we never merged Blink patch that fixed this 
1263         bug. So this is a merge of https://github.com/ChromiumWebApps/blink/commit/5a0d23d4368c661f621364339fde66b41ef019e5
1264         * editing/TextIterator.cpp:
1265         (WebCore::SimplifiedBackwardsTextIterator::handleFirstLetter):
1266
1267 2016-01-14  Zalan Bujtas  <zalan@apple.com>
1268
1269         ASSERTION FAILED: !newRelayoutRoot.container() || !newRelayoutRoot.container()->needsLayout() in WebCore::FrameView::scheduleRelayoutOfSubtree
1270         https://bugs.webkit.org/show_bug.cgi?id=151605#c1
1271
1272         Reviewed by David Hyatt.
1273
1274         Do not let RenderMultiColumnSet/RenderFlowThread mark ancestors dirty while updating scrollbars
1275         for overflow content. While updating scrollbars, we only layout descendants so marking parents dirty
1276         is unnecessary and could lead to an invalid dirty state.
1277
1278         Test: fast/multicol/body-stuck-with-dirty-bit-with-columns.html
1279
1280         * rendering/RenderBlockFlow.cpp:
1281         (WebCore::RenderBlockFlow::layoutSpecialExcludedChild):
1282         * rendering/RenderFlowThread.cpp:
1283         (WebCore::RenderFlowThread::invalidateRegions):
1284         * rendering/RenderFlowThread.h:
1285         * rendering/RenderMultiColumnSet.cpp:
1286         (WebCore::RenderMultiColumnSet::prepareForLayout):
1287
1288 2016-01-14  Dave Hyatt  <hyatt@apple.com>
1289
1290         Avoid downloading the wrong image for <picture> elements.
1291         https://bugs.webkit.org/show_bug.cgi?id=153027
1292
1293         Reviewed by Dean Jackson.
1294
1295         Added test in fast/picture.
1296
1297         * html/HTMLImageElement.cpp:
1298         (WebCore::HTMLImageElement::HTMLImageElement):
1299         (WebCore::HTMLImageElement::~HTMLImageElement):
1300         (WebCore::HTMLImageElement::createForJSConstructor):
1301         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
1302         (WebCore::HTMLImageElement::insertedInto):
1303         (WebCore::HTMLImageElement::removedFrom):
1304         (WebCore::HTMLImageElement::pictureElement):
1305         (WebCore::HTMLImageElement::setPictureElement):
1306         (WebCore::HTMLImageElement::width):
1307         * html/HTMLImageElement.h:
1308         (WebCore::HTMLImageElement::hasShadowControls):
1309         * html/HTMLPictureElement.h:
1310         * html/parser/HTMLConstructionSite.cpp:
1311         (WebCore::HTMLConstructionSite::createHTMLElement):
1312         * html/parser/HTMLPreloadScanner.cpp:
1313         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
1314
1315         Images that are built underneath a <picture> element are now connected
1316         to that picture element via a setPictureNode call from the parser. This
1317         ensures that the correct <source> elements are examined before checking the image.
1318
1319         This connection between images and their picture owners is handled using a static
1320         HashMap in HTMLImageElement. This connection is made both from the parser and from
1321         DOM insertions, and the map is queried now instead of looking directly at the
1322         image's parentNode().
1323
1324 2016-01-14  Commit Queue  <commit-queue@webkit.org>
1325
1326         Unreviewed, rolling out r195002.
1327         https://bugs.webkit.org/show_bug.cgi?id=153098
1328
1329         Crashes many/most editing tests (Requested by ap on #webkit).
1330
1331         Reverted changeset:
1332
1333         "WK2: Request completion candidates when needed"
1334         https://bugs.webkit.org/show_bug.cgi?id=153040
1335         http://trac.webkit.org/changeset/195002
1336
1337 2016-01-14  Martin Robinson  <mrobinson@igalia.com>
1338
1339         [GTK] [EFL] Hyphenation can never work in practice due to requirements on lang tags
1340         https://bugs.webkit.org/show_bug.cgi?id=147310
1341
1342         Reviewed by Michael Catanzaro.
1343
1344         Test: platform/gtk/fast/text/hyphenate-flexible-locales.html
1345
1346         * platform/text/hyphen/HyphenationLibHyphen.cpp: Make locale matching for dictionary
1347         selection a lot looser by matching case insensitively, matching multiple dictionaries
1348         when only the language is specified, and ignoring the difference between '_' and '-' in
1349         the locale name.
1350         (WebCore::scanDirectoryForDicionaries): Now produce HashMap of Vectors instead of a single
1351         path for each locale. Also add alternate entries to handle different ways of specifying
1352         the locale.
1353         (WebCore::scanTestDictionariesDirectoryIfNecessary): Update to handle the difference
1354         in HashMap type.
1355         (WebCore::availableLocales): Ditto.
1356         (WebCore::canHyphenate): Also look for the lowercased version of the locale.
1357         (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForKey):
1358         Key on the dictionary path now so that we can load more than one dictionary per locale.
1359         (WebCore::lastHyphenLocation): Iterate through each matched dictionary in turn.
1360
1361 2016-01-14  Per Arne Vollan  <peavo@outlook.com>
1362
1363         [Win] Remove workarounds for fixed bugs in fmod and pow.
1364         https://bugs.webkit.org/show_bug.cgi?id=153071
1365
1366         Reviewed by Brent Fulgham.
1367
1368         Compile fix, help MSVC pick correct pow overload.
1369
1370         * rendering/shapes/BoxShape.cpp:
1371         (WebCore::adjustRadiusForMarginBoxShape):
1372
1373 2016-01-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1374
1375         Fix problems with cross-origin redirects
1376         https://bugs.webkit.org/show_bug.cgi?id=116075
1377
1378         Reviewed by Daniel Bates.
1379
1380         Merging https://chromium.googlesource.com/chromium/blink/+/7ea774e478f84f355748108d2aaabca15355d512 by Ken Russell
1381         Same origin redirect responses leading to cross-origin requests were checked as cross-origin redirect responses.
1382         Introduced ClientRequestedCredentials to manage whether credentials are needed or not in the cross-origin request.
1383
1384         In addition to Blink patch, it was needed to update some loaders with the newly introduced ClientRequestedCredentials parameter.
1385         Added the clearing of "Accept-Encoding" header from cross-origin requests as Mac HTTP network layer is adding it for same-origin requests.
1386
1387         Test: http/tests/xmlhttprequest/access-control-and-redirects-async-same-origin.html
1388
1389         * loader/DocumentLoader.cpp:
1390         (WebCore::DocumentLoader::startLoadingMainResource): Added new security parameter (from Blink patch).
1391         * loader/DocumentThreadableLoader.cpp:
1392         (WebCore::DocumentThreadableLoader::redirectReceived): Updated checks so that same origin redirections are not treated as cross origin redirections (from Blink patch).
1393         * loader/MediaResourceLoader.cpp:
1394         (WebCore::MediaResourceLoader::start):
1395         * loader/NetscapePlugInStreamLoader.cpp:
1396         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader): Added new security parameter.
1397         * loader/ResourceLoaderOptions.h:
1398         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions): Added new security parameter (from Blink patch).
1399         (WebCore::ResourceLoaderOptions::credentialRequest):
1400         (WebCore::ResourceLoaderOptions::setCredentialRequest):
1401         * loader/cache/CachedResourceLoader.cpp:
1402         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Ditto.
1403         (WebCore::CachedResourceLoader::defaultCachedResourceOptions): Ditto.
1404         * loader/icon/IconLoader.cpp:
1405         (WebCore::IconLoader::startLoading): Added new security parameter.
1406         * page/EventSource.cpp:
1407         (WebCore::EventSource::connect): Added new security parameter (from Blink patch).
1408         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
1409         (WebCore::WebCoreAVCFResourceLoader::startLoading): Added new security parameter.
1410         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1411         (WebCore::WebCoreAVFResourceLoader::startLoading): Ditto.
1412         * platform/network/ResourceHandleTypes.h: Added new security parameter constants (from Blink patch).
1413         * platform/network/ResourceRequestBase.cpp:
1414         (WebCore::ResourceRequestBase::clearHTTPAcceptEncoding): Function to remove "Accept-Encoding" header.
1415         * platform/network/ResourceRequestBase.h: Ditto.
1416         * xml/XMLHttpRequest.cpp:
1417         (WebCore::XMLHttpRequest::createRequest): Added new security parameter.
1418
1419 2016-01-13  Myles C. Maxfield  <mmaxfield@apple.com>
1420
1421         Addressing more post-review comments after r194566
1422
1423         Unreviewed.
1424
1425         No new tests because there is no behavior change.
1426
1427         * platform/text/mac/TextBreakIteratorInternalICUMac.mm:
1428         (WebCore::topLanguagePreference):
1429
1430 2016-01-13  Alex Christensen  <achristensen@webkit.org>
1431
1432         Implement custom protocols when using NetworkSession
1433         https://bugs.webkit.org/show_bug.cgi?id=153078
1434
1435         Reviewed by Andy Estes.
1436
1437         No new tests, but this makes the WebKit2CustomProtocolsTest api tests pass when using NetworkSession.
1438
1439         * WebCore.xcodeproj/project.pbxproj:
1440         Make NSURLConnectionSPI.h private so we can include it from within WebKit2.
1441
1442 2016-01-13  Brent Fulgham  <bfulgham@apple.com>
1443
1444         Cross-protocol, cross-site scripting (XPSS) using HTML forms
1445         https://bugs.webkit.org/show_bug.cgi?id=153017
1446         <rdar://problem/5873254>
1447
1448         Reviewed by David Kilzer.
1449
1450         * loader/DocumentLoader.cpp:
1451         (WebCore::DocumentLoader::responseReceived): If response HTTP version is 0.9,
1452         sandbox against script execution and plugins.
1453         * loader/ResourceLoader.cpp:
1454         (WebCore::ResourceLoader::didReceiveResponse): Ditto.
1455         * loader/SubresourceLoader.cpp:
1456         (WebCore::SubresourceLoader::didReceiveResponse): Ditto.
1457         * platform/network/ResourceResponseBase.cpp:
1458         (WebCore::ResourceResponseBase::adopt): Update for HTTP version.
1459         (WebCore::ResourceResponseBase::copyData): Ditto.
1460         (WebCore::ResourceResponseBase::httpVersion): Added.
1461         (WebCore::ResourceResponseBase::setHTTPVersion): Ditto.
1462         * platform/network/ResourceResponseBase.h:
1463         (WebCore::ResourceResponseBase::encode): Update for HTTP version.
1464         (WebCore::ResourceResponseBase::decode): Ditto.
1465         * platform/network/cf/ResourceResponseCFNet.cpp:
1466         (WebCore::ResourceResponse::platformLazyInit): Capture HTTP version.
1467         * platform/network/cocoa/ResourceResponseCocoa.mm:
1468         (WebCore::ResourceResponse::platformLazyInit): Ditto.
1469
1470 2016-01-13  Beth Dakin  <bdakin@apple.com>
1471
1472         WK2: Request completion candidates when needed
1473         https://bugs.webkit.org/show_bug.cgi?id=153040
1474         -and corresponding-
1475         rdar://problem/24155631
1476
1477         Reviewed by Enrica Casucci.
1478
1479         Helper functions for stringForCandidateRequest() and 
1480         handleAcceptedCandidate()
1481         * editing/Editor.cpp:
1482         (WebCore::candidateRangeForSelection):
1483         (WebCore::candidateWouldReplaceText):
1484
1485         Request candidates for the word that is currently being typed so long as the 
1486         candidate would replace that word. Otherwise, use String().
1487         (WebCore::Editor::stringForCandidateRequest):
1488
1489         When a candidate has been accepted, insert the text.
1490         (WebCore::Editor::handleAcceptedCandidate):
1491         * editing/Editor.h:
1492
1493 2016-01-13  Myles C. Maxfield  <mmaxfield@apple.com>
1494
1495         Addressing post-review comments after r194566
1496
1497         Unreviewed.
1498
1499         No new tests because there is no behavior difference.
1500
1501         * platform/text/mac/TextBreakIteratorInternalICUMac.mm:
1502         (WebCore::textBreakLocalePreference):
1503         (WebCore::topLanguagePreference):
1504         (WebCore::getSearchLocale):
1505         (WebCore::getTextBreakLocale):
1506         (WebCore::canonicalLanguageIdentifier): Deleted.
1507
1508 2016-01-12  Ryosuke Niwa  <rniwa@webkit.org>
1509
1510         formaction must return document's address when formaction is missing
1511         https://bugs.webkit.org/show_bug.cgi?id=148874
1512
1513         Reviewed by Chris Dumez.
1514
1515         Fixed the bug by falling back to document.url() when the attribute is not set or is empty in formAction getter.
1516
1517         Test: fast/forms/formaction-attribute-with-empty-value.html
1518
1519         * html/HTMLButtonElement.idl:
1520         * html/HTMLFormControlElement.cpp:
1521         (WebCore::HTMLFormControlElement::formAction): Added.
1522         (WebCore::HTMLFormControlElement::setFormAction): Added.
1523         * html/HTMLFormControlElement.h:
1524         * html/HTMLInputElement.idl:
1525
1526 2016-01-13  Chris Dumez  <cdumez@apple.com>
1527
1528         Unreviewed, rolling out r194900.
1529
1530         Roll back in as this did not actually regress PLT
1531
1532         Reverted changeset:
1533
1534         "Unreviewed, rolling out r194826."
1535         https://bugs.webkit.org/show_bug.cgi?id=153020
1536         http://trac.webkit.org/changeset/194900
1537
1538 2016-01-13  Konstantin Tokarev  <annulen@yandex.ru>
1539
1540         Removed empty #if block from Font.h
1541         https://bugs.webkit.org/show_bug.cgi?id=153067
1542
1543         Reviewed by Alex Christensen.
1544
1545         No new tests needed.
1546
1547         * platform/graphics/Font.h:
1548         (WebCore::Font::scriptCache): Deleted.
1549
1550 2016-01-13  Michael Catanzaro  <mcatanzaro@igalia.com>
1551
1552         [GTK] Consistently use virtual and override specifiers in ScrollbarThemeGtk
1553         https://bugs.webkit.org/show_bug.cgi?id=153076
1554
1555         Reviewed by Alex Christensen.
1556
1557         No behavior change.
1558
1559         * platform/gtk/ScrollbarThemeGtk.h:
1560
1561 2016-01-13  Daniel Bates  <dabates@apple.com>
1562
1563         Cleanup: XSS Auditor should avoid re-evaluating the parsed script tag
1564         https://bugs.webkit.org/show_bug.cgi?id=152870
1565
1566         Reviewed by Brent Fulgham.
1567
1568         Merged from Blink (patch by Tom Sepez <tsepez@chromium.org>):
1569         <https://src.chromium.org/viewvc/blink?revision=154354&view=revision>
1570
1571         Although the XSS Auditor caches the decoded start tag of a script as an optimization to
1572         avoid decoding it again when filtering the character data of the script, it is sufficient
1573         to cache whether the HTTP response contains the decoded start tag of a script. This
1574         avoids both decoding the start tag of a script and determining whether the HTTP response
1575         contains it again when filtering the character data of the script. Moreover, this removes
1576         the need to cache a string object.
1577
1578         * html/parser/XSSAuditor.cpp:
1579         (WebCore::XSSAuditor::filterCharacterToken):
1580         (WebCore::XSSAuditor::filterScriptToken):
1581         * html/parser/XSSAuditor.h:
1582
1583 2016-01-13  Commit Queue  <commit-queue@webkit.org>
1584
1585         Unreviewed, rolling out r194963.
1586         https://bugs.webkit.org/show_bug.cgi?id=153079
1587
1588         This change causes ASan tests to crash and exit early
1589         (Requested by ryanhaddad on #webkit).
1590
1591         Reverted changeset:
1592
1593         "Fragmentation-free allocator for timeless and/or coupled
1594         allocations."
1595         https://bugs.webkit.org/show_bug.cgi?id=152696
1596         http://trac.webkit.org/changeset/194963
1597
1598 2016-01-13  Daniel Bates  <dabates@apple.com>
1599
1600         [XSS Auditor] Do not include trailing comment characters in JavaScript snippets
1601         https://bugs.webkit.org/show_bug.cgi?id=152873
1602
1603         Reviewed by Brent Fulgham.
1604
1605         Merged from Blink (patch by Tom Sepez <tsepez@chromium.org>):
1606         <https://src.chromium.org/viewvc/blink?view=rev&revision=169967>
1607
1608         Test: http/tests/security/xssAuditor/script-tag-with-injected-comment.html
1609
1610         * html/parser/XSSAuditor.cpp:
1611         (WebCore::XSSAuditor::decodedSnippetForJavaScript):
1612
1613 2016-01-13  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1614
1615         WebRTC: Add support for RTCRtpSender.replaceTrack()
1616         https://bugs.webkit.org/show_bug.cgi?id=153063
1617
1618         Reviewed by Eric Carlson.
1619
1620         Add the API and infrastructure to support RTCRtpSender.replaceTrack(). The platform is
1621         reached through the RTCPeerConnection object that created the RTCRtpSender via a client
1622         interface.
1623
1624         Test: fast/mediastream/RTCRtpSender-replaceTrack.html
1625
1626         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1627         (WebCore::MediaEndpointPeerConnection::replaceTrack):
1628         * Modules/mediastream/MediaEndpointPeerConnection.h:
1629         * Modules/mediastream/PeerConnectionBackend.h:
1630         * Modules/mediastream/RTCPeerConnection.cpp:
1631         (WebCore::RTCPeerConnection::addTrack):
1632         (WebCore::RTCPeerConnection::removeTrack):
1633         (WebCore::RTCPeerConnection::replaceTrack):
1634         * Modules/mediastream/RTCPeerConnection.h:
1635         * Modules/mediastream/RTCRtpSender.cpp:
1636         (WebCore::RTCRtpSender::RTCRtpSender):
1637         (WebCore::RTCRtpSender::replaceTrack):
1638         * Modules/mediastream/RTCRtpSender.h:
1639         (WebCore::RTCRtpSenderClient::~RTCRtpSenderClient):
1640         (WebCore::RTCRtpSender::create):
1641         (WebCore::RTCRtpSender::trackId):
1642         (WebCore::RTCRtpSender::stop):
1643         * Modules/mediastream/RTCRtpSender.idl:
1644
1645 2016-01-13  Brady Eidson  <beidson@apple.com>
1646
1647         Modern IDB: A few cursor tests are flaky because JS wrappers are GC'ed.
1648         https://bugs.webkit.org/show_bug.cgi?id=153038
1649
1650         Reviewed by Alex Christensen.
1651
1652         No new tests (Couldn't write a test that was any more reliable than "flaky", so fixing the existing flaky tests will do).
1653
1654         And IDBCursor has an associated IDBRequest that is re-used each time the IDBCursor iterates.
1655         
1656         The normal ActiveDOMObject approach to prevent the IDBRequest's wrapper from being garbage collected was not good enough
1657         because, while the IDBRequest may not currently be waiting on any activity, as long as its associated IDBCursor is still
1658         reachable then the request might be reused in the future.
1659         
1660         Fortunately there's an IDL allowance for "one object keeping another alive during GC" and that's JSCustomMarkFunction
1661         combined with GenerateIsReachable.
1662         
1663         Applying those to IDBCursor and IDBRequest fix this handily.
1664         
1665         * CMakeLists.txt:
1666         * WebCore.xcodeproj/project.pbxproj:
1667
1668         * Modules/indexeddb/IDBCursor.h:
1669         (WebCore::IDBCursor::isModernCursor):
1670         * Modules/indexeddb/IDBCursor.idl:
1671         
1672         * Modules/indexeddb/IDBRequest.idl:
1673         
1674         * Modules/indexeddb/client/IDBCursorImpl.cpp:
1675         (WebCore::IDBClient::IDBCursor::advance):
1676         (WebCore::IDBClient::IDBCursor::continueFunction):
1677         (WebCore::IDBClient::IDBCursor::uncheckedIterateCursor):
1678         (WebCore::IDBClient::IDBCursor::uncheckedIteratorCursor): Deleted. Fixed the typo of this name.
1679         * Modules/indexeddb/client/IDBCursorImpl.h:
1680         
1681         * bindings/js/JSIDBCursorCustom.cpp: Added.
1682         (WebCore::JSIDBCursor::visitAdditionalChildren):
1683
1684 2016-01-13  Zalan Bujtas  <zalan@apple.com>
1685
1686         Get text drawing working with display lists.
1687         https://bugs.webkit.org/show_bug.cgi?id=152957
1688
1689         Reviewed by Simon Fraser.
1690
1691         This patch enables text drawing for display lists.
1692
1693         * platform/graphics/FontCascade.cpp:
1694         (WebCore::FontCascade::drawGlyphBuffer):
1695         * platform/graphics/FontCascade.h:
1696         * platform/graphics/GraphicsContext.cpp:
1697         (WebCore::GraphicsContext::drawGlyphs):
1698         (WebCore::GraphicsContext::drawText): Deleted.
1699         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1700         (WebCore::FontCascade::drawGlyphs):
1701         * platform/graphics/displaylists/DisplayListItems.cpp:
1702         (WebCore::DisplayList::DrawGlyphs::apply):
1703
1704 2016-01-13  Zalan Bujtas  <zalan@apple.com>
1705
1706         Simple line layout: Add support for word-break property.
1707         https://bugs.webkit.org/show_bug.cgi?id=153054
1708
1709         Reviewed by Antti Koivisto.
1710
1711         This patch enables word-break property for simple line layout.
1712         (https://drafts.csswg.org/css-text-3/#propdef-word-break)
1713
1714         word-break: normal and keep-all -> existing, non-(force)breaking behaviour.
1715                     break-all -> breaks words when needed.
1716
1717         Covered by existing tests like fast/text/word-break.html
1718
1719         * rendering/SimpleLineLayout.cpp:
1720         (WebCore::SimpleLineLayout::createLineRuns):
1721         (WebCore::SimpleLineLayout::canUseForStyle): Deleted.
1722         (WebCore::SimpleLineLayout::printReason): Deleted.
1723         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1724         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
1725         (WebCore::SimpleLineLayout::TextFragmentIterator::findNextTextFragment):
1726         * rendering/SimpleLineLayoutTextFragmentIterator.h:
1727         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
1728         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
1729         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isBreakable): Deleted.
1730         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.
1731
1732 2016-01-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
1733
1734         Reference cycle between SVGPathElement and SVGPathSegWithContext leaks Document
1735         https://bugs.webkit.org/show_bug.cgi?id=151810
1736
1737         Reviewed by Darin Adler.
1738
1739         Break the reference cycle between SVGPathElement and SVGPathSegWithContext
1740         by changing the back-pointer to be a WeakPtr pointer instead of having it
1741         RefPtr. Make sure the SVGPathSegWithContext derived classes handle correctly
1742         the case when the SVGPathElement back-pointer is deleted.
1743
1744         Also change the SVGPathElement argument to the SVGPathSeg creation functions
1745         and constructors to be a const reference instead of having it as a pointer
1746         since SVGPathElement is the class factory for all these classes.
1747
1748         * svg/SVGPathElement.cpp:
1749         (WebCore::SVGPathElement::SVGPathElement):
1750         (WebCore::SVGPathElement::createSVGPathSegClosePath):
1751         (WebCore::SVGPathElement::createSVGPathSegMovetoAbs):
1752         (WebCore::SVGPathElement::createSVGPathSegMovetoRel):
1753         (WebCore::SVGPathElement::createSVGPathSegLinetoAbs):
1754         (WebCore::SVGPathElement::createSVGPathSegLinetoRel):
1755         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs):
1756         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel):
1757         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs):
1758         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel):
1759         (WebCore::SVGPathElement::createSVGPathSegArcAbs):
1760         (WebCore::SVGPathElement::createSVGPathSegArcRel):
1761         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs):
1762         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel):
1763         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs):
1764         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel):
1765         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs):
1766         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel):
1767         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs):
1768         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel):
1769         (WebCore::SVGPathElement::isSupportedAttribute):
1770         * svg/SVGPathElement.h:
1771         * svg/SVGPathSegArc.h:
1772         (WebCore::SVGPathSegArc::SVGPathSegArc):
1773         * svg/SVGPathSegArcAbs.h:
1774         (WebCore::SVGPathSegArcAbs::create):
1775         (WebCore::SVGPathSegArcAbs::SVGPathSegArcAbs):
1776         * svg/SVGPathSegArcRel.h:
1777         (WebCore::SVGPathSegArcRel::create):
1778         (WebCore::SVGPathSegArcRel::SVGPathSegArcRel):
1779         * svg/SVGPathSegClosePath.h:
1780         (WebCore::SVGPathSegClosePath::create):
1781         (WebCore::SVGPathSegClosePath::SVGPathSegClosePath):
1782         * svg/SVGPathSegCurvetoCubic.h:
1783         (WebCore::SVGPathSegCurvetoCubic::SVGPathSegCurvetoCubic):
1784         * svg/SVGPathSegCurvetoCubicAbs.h:
1785         (WebCore::SVGPathSegCurvetoCubicAbs::create):
1786         (WebCore::SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs):
1787         * svg/SVGPathSegCurvetoCubicRel.h:
1788         (WebCore::SVGPathSegCurvetoCubicRel::create):
1789         (WebCore::SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel):
1790         * svg/SVGPathSegCurvetoCubicSmooth.h:
1791         (WebCore::SVGPathSegCurvetoCubicSmooth::SVGPathSegCurvetoCubicSmooth):
1792         * svg/SVGPathSegCurvetoCubicSmoothAbs.h:
1793         (WebCore::SVGPathSegCurvetoCubicSmoothAbs::create):
1794         (WebCore::SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs):
1795         * svg/SVGPathSegCurvetoCubicSmoothRel.h:
1796         (WebCore::SVGPathSegCurvetoCubicSmoothRel::create):
1797         (WebCore::SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel):
1798         * svg/SVGPathSegCurvetoQuadratic.h:
1799         (WebCore::SVGPathSegCurvetoQuadratic::SVGPathSegCurvetoQuadratic):
1800         * svg/SVGPathSegCurvetoQuadraticAbs.h:
1801         (WebCore::SVGPathSegCurvetoQuadraticAbs::create):
1802         (WebCore::SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs):
1803         * svg/SVGPathSegCurvetoQuadraticRel.h:
1804         (WebCore::SVGPathSegCurvetoQuadraticRel::create):
1805         (WebCore::SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel):
1806         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
1807         (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::create):
1808         (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs):
1809         * svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
1810         (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::create):
1811         (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel):
1812         * svg/SVGPathSegLinetoAbs.h:
1813         (WebCore::SVGPathSegLinetoAbs::create):
1814         (WebCore::SVGPathSegLinetoAbs::SVGPathSegLinetoAbs):
1815         * svg/SVGPathSegLinetoHorizontal.h:
1816         (WebCore::SVGPathSegLinetoHorizontal::SVGPathSegLinetoHorizontal):
1817         * svg/SVGPathSegLinetoHorizontalAbs.h:
1818         (WebCore::SVGPathSegLinetoHorizontalAbs::create):
1819         (WebCore::SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs):
1820         * svg/SVGPathSegLinetoHorizontalRel.h:
1821         (WebCore::SVGPathSegLinetoHorizontalRel::create):
1822         (WebCore::SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel):
1823         * svg/SVGPathSegLinetoRel.h:
1824         (WebCore::SVGPathSegLinetoRel::create):
1825         (WebCore::SVGPathSegLinetoRel::SVGPathSegLinetoRel):
1826         * svg/SVGPathSegLinetoVertical.h:
1827         (WebCore::SVGPathSegLinetoVertical::SVGPathSegLinetoVertical):
1828         * svg/SVGPathSegLinetoVerticalAbs.h:
1829         (WebCore::SVGPathSegLinetoVerticalAbs::create):
1830         (WebCore::SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs):
1831         * svg/SVGPathSegLinetoVerticalRel.h:
1832         (WebCore::SVGPathSegLinetoVerticalRel::create):
1833         (WebCore::SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel):
1834         * svg/SVGPathSegMovetoAbs.h:
1835         (WebCore::SVGPathSegMovetoAbs::create):
1836         (WebCore::SVGPathSegMovetoAbs::SVGPathSegMovetoAbs):
1837         * svg/SVGPathSegMovetoRel.h:
1838         (WebCore::SVGPathSegMovetoRel::create):
1839         (WebCore::SVGPathSegMovetoRel::SVGPathSegMovetoRel):
1840         * svg/SVGPathSegWithContext.h:
1841         (WebCore::SVGPathSegWithContext::SVGPathSegWithContext):
1842         (WebCore::SVGPathSegWithContext::animatedProperty):
1843         (WebCore::SVGPathSegWithContext::contextElement):
1844         (WebCore::SVGPathSegWithContext::setContextAndRole):
1845         (WebCore::SVGPathSegWithContext::commitChange):
1846         (WebCore::SVGPathSegSingleCoordinate::setY):
1847         (WebCore::SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate):
1848         * svg/properties/SVGPathSegListPropertyTearOff.cpp:
1849         (WebCore::SVGPathSegListPropertyTearOff::clearContextAndRoles):
1850         (WebCore::SVGPathSegListPropertyTearOff::replaceItem):
1851         (WebCore::SVGPathSegListPropertyTearOff::removeItem):
1852
1853 2016-01-13  Andreas Kling  <akling@apple.com>
1854
1855         Use BumpArena for style sheet object tree.
1856         <https://webkit.org/b/152696>
1857
1858         Reviewed by Antti Koivisto.
1859
1860         Give each StyleSheetContents its own BumpArena, and plumb it down through CSSParser
1861         to allocate StyleRule, StyleProperties and CSSSelectorList's selector arrays there.
1862
1863         This basically means that most objects that make up a given style sheet will end up
1864         in one (or a few) contiguous region(s) of memory, instead of being scattered all
1865         over the malloc heap.
1866
1867         In the common case (no CSSOM manipulation), the lifetimes of these objects are very
1868         predictable: everything tends to die when the StyleSheetContents dies.
1869         This dramatically improves space-efficiency in those cases, and allows us to return
1870         contiguous chunks of memory to the system once a style sheet is no longer needed.
1871
1872         One-off CSS parses that don't work within a StyleSheetContents context will have
1873         their StyleRules & co allocated out of the global BumpArena.
1874
1875         Bonus: give SelectorQueryCache a dedicated BumpArena as well, since it has very
1876         predictable lifetime.
1877
1878         * css/CSSGrammar.y.in:
1879         * css/CSSKeyframesRule.h:
1880         (WebCore::StyleRuleKeyframes::create):
1881         * css/CSSParser.cpp:
1882         (WebCore::CSSParser::createStyleProperties):
1883         (WebCore::CSSParser::createMediaRule):
1884         (WebCore::CSSParser::createSupportsRule):
1885         (WebCore::CSSParser::createKeyframesRule):
1886         (WebCore::CSSParser::setArena):
1887         (WebCore::CSSParser::arena):
1888         (WebCore::CSSParser::createStyleRule):
1889         (WebCore::CSSParser::createFontFaceRule):
1890         (WebCore::CSSParser::createPageRule):
1891         (WebCore::CSSParser::createRegionRule):
1892         (WebCore::CSSParser::createViewportRule):
1893         * css/CSSParser.h:
1894         * css/CSSParserValues.cpp:
1895         (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
1896         (WebCore::CSSParserSelector::adoptSelectorVector):
1897         * css/CSSParserValues.h:
1898         * css/CSSSelectorList.cpp:
1899         (WebCore::CSSSelectorList::CSSSelectorList):
1900         (WebCore::CSSSelectorList::adoptSelectorVector):
1901         (WebCore::CSSSelectorList::deleteSelectors):
1902         * css/CSSSelectorList.h:
1903         * css/StyleProperties.cpp:
1904         (WebCore::ImmutableStyleProperties::create):
1905         (WebCore::StyleProperties::immutableCopyIfNeeded):
1906         * css/StyleProperties.h:
1907         * css/StyleRule.cpp:
1908         (WebCore::StyleRule::create):
1909         (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
1910         (WebCore::StyleRuleRegion::StyleRuleRegion):
1911         * css/StyleRule.h:
1912         (WebCore::StyleRule::create):
1913         (WebCore::StyleRule::parserAdoptSelectorVector):
1914         (WebCore::StyleRuleFontFace::create):
1915         (WebCore::StyleRulePage::create):
1916         (WebCore::StyleRulePage::parserAdoptSelectorVector):
1917         (WebCore::StyleRuleMedia::create):
1918         (WebCore::StyleRuleSupports::create):
1919         (WebCore::StyleRuleRegion::create):
1920         (WebCore::StyleRuleViewport::create):
1921         * css/StyleSheetContents.cpp:
1922         (WebCore::StyleSheetContents::StyleSheetContents):
1923         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
1924         (WebCore::StyleSheetContents::parseStringAtPosition):
1925         * css/StyleSheetContents.h:
1926         * dom/SelectorQuery.cpp:
1927         (WebCore::SelectorQueryCache::SelectorQueryCache):
1928         (WebCore::SelectorQueryCache::add):
1929         * dom/SelectorQuery.h:
1930         * svg/SVGFontFaceElement.cpp:
1931         (WebCore::SVGFontFaceElement::SVGFontFaceElement):
1932
1933 2016-01-13  YongGeol Jung  <yg48.jung@samsung.com>
1934
1935         [TexMap] BitmapTextureGL is not released while scene is updated continuously.
1936         https://bugs.webkit.org/show_bug.cgi?id=152524
1937
1938         Reviewed by Žan Doberšek.
1939
1940         This patch fixes two issues.
1941         First, m_releaseUnusedTexturesTimer is not fired if scene is updated within 0.5s continuously.
1942         In this case, BitmapTexturePool will not remove texture even if texture is not used for long time.
1943         Second, m_releaseUnusedTexturesTimer is triggered by acquireTexture function only.
1944         So, if next scene does not need to use BitmapTexture, remained textures in pool will not removed.
1945
1946         No new tests needed.
1947
1948         * platform/graphics/texmap/BitmapTexturePool.cpp:
1949         (WebCore::BitmapTexturePool::scheduleReleaseUnusedTextures):
1950         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
1951
1952 2016-01-13  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1953
1954         [Streams API] Refactor builtin internals to prepare support for streams API in worker
1955         https://bugs.webkit.org/show_bug.cgi?id=152535
1956
1957         Reviewed by Darin Adler.
1958
1959         Moving the code that links internal functions to the GlobalObject in WebCoreJSBuiltinInternals.cpp.
1960         This file should be generated by the builtin generator once refactoring is done.
1961         This code is located in JSBuiltinInternalFunctions::initialize.
1962
1963         Adding private controller and reader constructors to the JS DOM constructor map so that they do not get garbage collected.
1964
1965         No change in behavior, except that private builtins are usable in workers (but not actually used).
1966
1967         * CMakeLists.txt:
1968         * WebCore.vcxproj/WebCore.vcxproj:
1969         * WebCore.xcodeproj/project.pbxproj:
1970         * bindings/js/JSDOMGlobalObject.cpp:
1971         (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
1972         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1973         (WebCore::JSDOMGlobalObject::finishCreation):
1974         (WebCore::JSDOMGlobalObject::visitChildren):
1975         * bindings/js/JSDOMGlobalObject.h:
1976         * bindings/js/JSDOMWindowBase.cpp:
1977         (WebCore::JSDOMWindowBase::finishCreation):
1978         (WebCore::JSDOMWindowBase::visitChildren):
1979         * bindings/js/JSDOMWindowBase.h:
1980         * bindings/js/WebCoreJSBuiltinInternals.cpp: Added.
1981         (WebCore::JSBuiltinInternalFunctions::JSBuiltinInternalFunctions):
1982         (WebCore::JSBuiltinInternalFunctions::visit):
1983         (WebCore::JSBuiltinInternalFunctions::initialize):
1984         * bindings/js/WebCoreJSBuiltinInternals.h:
1985
1986 2016-01-13  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1987
1988         [EFL] Fix wrong return value of paintThemePart in RenderThemeEfl
1989         https://bugs.webkit.org/show_bug.cgi?id=153058
1990
1991         Reviewed by Carlos Garcia Campos.
1992
1993         To return false in paint functions in RenderThemeEfl means that it is supported though,
1994         paintThemePart has returned false even when failing to get image cache of theme.
1995
1996         * rendering/RenderThemeEfl.cpp:
1997         (WebCore::RenderThemeEfl::paintThemePart):
1998
1999 2016-01-12  Andy Estes  <aestes@apple.com>
2000
2001         [Content Filtering] forEachContentFilterUntilBlocked should accept a lambda by rvalue reference
2002         https://bugs.webkit.org/show_bug.cgi?id=153057
2003
2004         Reviewed by Dan Bernstein.
2005
2006         No new tests. No change in behavior.
2007
2008         Instead of having ContentFilter::forEachContentFilterUntilBlocked() take a std::function, just have it take an
2009         rvalue reference to the lambda its passed.
2010
2011         * loader/ContentFilter.cpp:
2012         (WebCore::ContentFilter::forEachContentFilterUntilBlocked):
2013         * loader/ContentFilter.h:
2014
2015 2016-01-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2016
2017         [GTK] Fix return value of some paint methods in RenderThemeGtk
2018         https://bugs.webkit.org/show_bug.cgi?id=153015
2019
2020         Reviewed by Michael Catanzaro.
2021
2022         The bool value returned by paint methods in RenderTheme means
2023         whether the appearance is supported or not, so we should return
2024         true when not supported (so we didn't paint anything) and false
2025         when supported (so we actually painted the theme part).
2026
2027         * rendering/RenderThemeGtk.cpp:
2028         (WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
2029         (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
2030         (WebCore::RenderThemeGtk::paintMediaButton):
2031         (WebCore::RenderThemeGtk::paintMediaMuteButton):
2032         (WebCore::RenderThemeGtk::paintMediaPlayButton):
2033         (WebCore::RenderThemeGtk::paintMediaSliderTrack):
2034         (WebCore::RenderThemeGtk::paintMediaVolumeSliderContainer): Deleted.
2035         * rendering/RenderThemeGtk.h:
2036
2037 2016-01-12  Andy Estes  <aestes@apple.com>
2038
2039         [Content Filtering] De-virtualize PlatformContentFilter::{needsMoreData, didBlockData}()
2040         https://bugs.webkit.org/show_bug.cgi?id=153052
2041
2042         Reviewed by Andreas Kling.
2043
2044         No new tests. No change in behavior.
2045
2046         Instead of having virtual functions that each platform content filter implement in terms of their own state,
2047         store the state in the base class so that these functions can be non-virtual. Teach each subclass to update the
2048         base class state appropriately.
2049
2050         * loader/ContentFilter.h:
2051         * platform/PlatformContentFilter.h:
2052         (WebCore::PlatformContentFilter::needsMoreData):
2053         (WebCore::PlatformContentFilter::didBlockData):
2054         * platform/cocoa/NetworkExtensionContentFilter.h:
2055         * platform/cocoa/NetworkExtensionContentFilter.mm:
2056         (WebCore::NetworkExtensionContentFilter::willSendRequest):
2057         (WebCore::NetworkExtensionContentFilter::responseReceived):
2058         (WebCore::NetworkExtensionContentFilter::handleDecision):
2059         (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Deleted.
2060         (WebCore::NetworkExtensionContentFilter::needsMoreData): Deleted.
2061         (WebCore::NetworkExtensionContentFilter::didBlockData): Deleted.
2062         * platform/cocoa/ParentalControlsContentFilter.h:
2063         * platform/cocoa/ParentalControlsContentFilter.mm:
2064         (WebCore::ParentalControlsContentFilter::responseReceived):
2065         (WebCore::ParentalControlsContentFilter::updateFilterState):
2066         (WebCore::ParentalControlsContentFilter::ParentalControlsContentFilter): Deleted.
2067         (WebCore::ParentalControlsContentFilter::needsMoreData): Deleted.
2068         (WebCore::ParentalControlsContentFilter::didBlockData): Deleted.
2069         * platform/spi/cocoa/NEFilterSourceSPI.h:
2070         * testing/MockContentFilter.cpp:
2071         (WebCore::MockContentFilter::willSendRequest):
2072         (WebCore::MockContentFilter::maybeDetermineStatus):
2073         (WebCore::MockContentFilter::needsMoreData): Deleted.
2074         (WebCore::MockContentFilter::didBlockData): Deleted.
2075         * testing/MockContentFilter.h:
2076
2077 2016-01-12  Andy Estes  <aestes@apple.com>
2078
2079         Address missed review feedback after r194950.
2080
2081         * platform/cocoa/NetworkExtensionContentFilter.mm:
2082         (WebCore::NetworkExtensionContentFilter::initialize): Renamed the NetworkExtension dispatch queue.
2083
2084 2016-01-08  Andy Estes  <aestes@apple.com>
2085
2086         [Content Filtering] Lazily load platform frameworks
2087         https://bugs.webkit.org/show_bug.cgi?id=152881
2088         rdar://problem/23270886
2089
2090         Reviewed by Brady Eidson.
2091
2092         On Cocoa platforms, ContentFilter soft-links two frameworks that perform the underlying filtering operations.
2093         There is a one-time cost associated with the soft-linking, and the current design requires all clients to pay
2094         this cost whether or not they ever load a resource that is subject to filtering.
2095
2096         Addressed this by deferring the loading of frameworks until it is known that a resource will require filtering.
2097         It is rather simple to defer the soft-linking at the PlatformContentFilter level, but doing this alone would
2098         mean that every CachedRawResourceClient callback would be routed through ContentFilter, even in the very common
2099         case where both platform content filters are disabled. This is because checking if a platform content filter is
2100         enabled involves loading its framework, so creating a ContentFilter (which DocumentLoader will add as the
2101         CachedRawResource client in place of itself) cannot be avoided by checking that all its platform content filters
2102         are disabled.
2103
2104         Resolved this by inverting the relationship between ContentFilter and DocumentLoader. Instead of ContentFilter
2105         being the CachedRawResource's client and forwarding callbacks to DocumentLoader when one or more platform
2106         filters are enabled, DocumentLoader is now always the client and it forwards callbacks to ContentFilter.
2107         ContentFilter then returns a boolean value indicating whether or not DocumentLoader should proceed with each
2108         callback.
2109
2110         New API test: ContentFiltering.LazilyLoadPlatformFrameworks
2111
2112         * loader/ContentFilter.cpp:
2113         (WebCore::ContentFilter::create): Renamed from createIfEnabled(). Since the enabled check causes frameworks to
2114         be loaded, the check is skipped here and all types are always created.
2115         (WebCore::ContentFilter::continueAfterWillSendRequest): Renamed from willSendRequest(). Renamed requestCopy to
2116         originalRequest, and only created it for logging purposes. Since the copy was only used for logging purposes,
2117         request is now modified directly. Returned false if request is null.
2118         (WebCore::ContentFilter::continueAfterResponseReceived): Renamed from responseReceived(). Stopped asserting that
2119         resource is non-null, since it will be null in the case of substitute data loads. Stopped asserting that m_state
2120         is not Initialized, since that state was removed and the function can now be called in all states. Only logged
2121         if m_state is Filtering. Returned false if m_state is Blocked.
2122         (WebCore::ContentFilter::continueAfterDataReceived): Renamed from dataReceived(). Stopped asserting that
2123         resource is non-null and that m_state is Initialized, and moved the logging, for the same reasons as above.
2124         Returned false if m_state is Filtering or Blocked.
2125         (WebCore::ContentFilter::continueAfterNotifyFinished): Renamed from notifyFinished(). Stopped asserting that
2126         resource is non-null and that m_state is not Initialized, and moved the logging, for the same reasons as above.
2127         If m_state is not Blocked at this point, set m_state to Allowed in order for deliverResourceData() to not get
2128         caught in continueAfterDataReceived(). Returned false if m_state is Blocked or Stopped after delivering data.
2129         (WebCore::ContentFilter::createIfEnabled): Renamed to create().
2130         (WebCore::ContentFilter::~ContentFilter): Stopped removing ourself as m_mainResource's client.
2131         (WebCore::ContentFilter::willSendRequest): Renamed to continueAfterWillSendRequest().
2132         (WebCore::ContentFilter::startFilteringMainResource): Stopped adding ourself as m_mainResource's client. Stopped
2133         asserting that m_state is not Initialized and instead returned early if m_state is not Stopped.
2134         (WebCore::ContentFilter::stopFilteringMainResource): Stopped removing ourself as m_mainResource's client.
2135         (WebCore::ContentFilter::responseReceived): Renamed to continueAfterResponseReceived().
2136         (WebCore::ContentFilter::dataReceived): Renamed to continueAfterDataReceived().
2137         (WebCore::ContentFilter::redirectReceived): Removed. DocumentLoader now calls continueAfterWillSendRequest()
2138         directly on redirects.
2139         (WebCore::ContentFilter::notifyFinished): Renamed to continueAfterNotifyFinished().
2140         (WebCore::ContentFilter::didDecide): Instead of calling DocumentLoader::contentFilterDidDecide(), called
2141         DocumentLoader::contentFilterDidBlock() when m_state is Blocked.
2142         (WebCore::ContentFilter::deliverResourceData): Asserted that m_state is Allowed.
2143         * loader/ContentFilter.h: Stopped inheriting from CachedRawResourceClient. Redeclared the
2144         CachedRawResourceClient virtual functions as the continue* functions mentioned above. Made State enum private
2145         and removed Initialized. Initialized m_state to Stopped and removed its getter.
2146         (WebCore::ContentFilter::type): Returned a ContentFilter::Type that does not include an enabled function.
2147         * loader/DocumentLoader.cpp:
2148         (WebCore::DocumentLoader::notifyFinished): Returned early if ContentFilter::continueAfterNotifyFinished()
2149         returned false.
2150         (WebCore::DocumentLoader::willSendRequest): Called ContentFilter::continueAfterWillSendRequest() even for
2151         redirects, since ContentFilter is no longer a CachedRawResourceClient and so will no longer receive
2152         redirectReceived(). Returned early if continueAfterWillSendRequest() returns false.
2153         (WebCore::DocumentLoader::responseReceived): Returned early if ContentFilter::continueAfterResponseReceived()
2154         returned false.
2155         (WebCore::DocumentLoader::dataReceived): Ditto for ContentFilter::continueAfterDataReceived().
2156         (WebCore::DocumentLoader::startLoadingMainResource): Called ContentFilter::create(), not createIfEnabled().
2157         (WebCore::DocumentLoader::becomeMainResourceClient): Called ContentFilter::startFilteringMainResource() even if
2158         m_state is not Initialized. Added ourself as a client of m_mainResource unconditionally.
2159         (WebCore::DocumentLoader::contentFilterDidBlock): Renamed from contentFilterDidDecide. Removed assertions and
2160         the early return when m_state is Allowed, since the state is guaranteed to be Blocked.
2161         (WebCore::DocumentLoader::contentFilterDidDecide): Renamed to contentFilterDidBlock.
2162         * platform/cocoa/NetworkExtensionContentFilter.h: Moved definition of HAVE_NETWORK_EXTENSION to Platform.h so
2163         that this file doesn't need to become a Private header. Made enabled() private, and declared initialize().
2164         * platform/cocoa/NetworkExtensionContentFilter.mm:
2165         (WebCore::NetworkExtensionContentFilter::initialize): Added a function to lazily initialize the object.
2166         (WebCore::NetworkExtensionContentFilter::willSendRequest): For the modern NEFilterSource, checked if it is
2167         enabled only after checking if the request is HTTP(S). If both checks pass, then called initialize().
2168         (WebCore::NetworkExtensionContentFilter::responseReceived): Ditto for the legacy NEFilterSource.
2169         * platform/cocoa/ParentalControlsContentFilter.h: Made enabled() private.
2170         * platform/cocoa/ParentalControlsContentFilter.mm:
2171         (WebCore::ParentalControlsContentFilter::responseReceived): Checked if WebFilterEvaluator is enabled only after
2172         checking if the response is from a protocol that can be handled.
2173         * testing/MockContentFilter.cpp:
2174         (WebCore::MockContentFilter::willSendRequest): Immediately set m_status to Status::Allowed if !enabled().
2175         * testing/MockContentFilter.h: Made enabled() private.
2176
2177 2016-01-12  Commit Queue  <commit-queue@webkit.org>
2178
2179         Unreviewed, rolling out r194926 and r194928.
2180         https://bugs.webkit.org/show_bug.cgi?id=153048
2181
2182         This change is causing LayoutTest crashes (Requested by
2183         ryanhaddad on #webkit).
2184
2185         Reverted changesets:
2186
2187         "Avoid downloading the wrong image for <picture> elements."
2188         https://bugs.webkit.org/show_bug.cgi?id=153027
2189         http://trac.webkit.org/changeset/194926
2190
2191         "Avoid downloading the wrong image for <picture> elements."
2192         https://bugs.webkit.org/show_bug.cgi?id=153027
2193         http://trac.webkit.org/changeset/194928
2194
2195 2016-01-11  Dean Jackson  <dino@apple.com>
2196
2197         [iOS] Antialiasing doesn't work in WebGL
2198         https://bugs.webkit.org/show_bug.cgi?id=153000
2199         <rdar://problem/9165531>
2200
2201         Reviewed by Alex Christensen.
2202
2203         WebGL has supported platform antialiasing since
2204         the beginning, but we never hooked it up for iOS
2205         because it used a slightly different extension.
2206
2207         Test: fast/canvas/webgl/antialiasing-enabled.html
2208
2209         * platform/graphics/mac/GraphicsContext3DMac.mm:
2210         (WebCore::GraphicsContext3D::endPaint): Resolve the multisampling
2211         buffer once we're done painting.
2212         (WebCore::GraphicsContext3D::~GraphicsContext3D): We never created
2213         the m_compositorTexture RenderBuffer on iOS, so no point deleting
2214         it.
2215
2216         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
2217         (WebCore::Extensions3DOpenGL::supportsExtension): The iOS extension
2218         has a slightly different name.
2219         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2220         (WebCore::GraphicsContext3D::reshapeFBOs): Make sure to create the
2221         multisample buffer with the correct format.
2222         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary): We
2223         need to remember what our bound frame buffer is when we
2224         enter this call, and restore it afterwards. In the middle we can
2225         discard our multisample read buffer once we have resolved it
2226         into the normal framebuffer.
2227
2228 2016-01-12  Daniel Bates  <dabates@apple.com>
2229
2230         XSS Auditor should navigate to empty substitute data on full page block
2231         https://bugs.webkit.org/show_bug.cgi?id=152868
2232         <rdar://problem/18658448>
2233
2234         Reviewed by David Kilzer and Andy Estes.
2235
2236         Derived from Blink patch (by Tom Sepez <tsepez@chromium.org>):
2237         <https://src.chromium.org/viewvc/blink?view=rev&revision=179240>
2238
2239         Test: http/tests/security/xssAuditor/block-does-not-leak-that-page-was-blocked-using-empty-data-url.html
2240
2241         * html/parser/XSSAuditorDelegate.cpp:
2242         (WebCore::XSSAuditorDelegate::didBlockScript): Modified to call NavigationScheduler::schedulePageBlock().
2243         * loader/NavigationScheduler.cpp:
2244         (WebCore::ScheduledPageBlock::ScheduledPageBlock): Added.
2245         (WebCore::NavigationScheduler::schedulePageBlock): Navigate to empty substitute data with
2246         the same URL as the originating document.
2247         * loader/NavigationScheduler.h:
2248
2249 2016-01-12  Dave Hyatt  <hyatt@apple.com>
2250
2251         Avoid downloading the wrong image for <picture> elements.
2252         https://bugs.webkit.org/show_bug.cgi?id=153027
2253
2254         Reviewed by Dean Jackson.
2255
2256         I was unable to write a reliable test for this feature (I welcome suggestions regarding
2257         how this could be tested).
2258
2259         * html/HTMLImageElement.cpp:
2260         (WebCore::HTMLImageElement::HTMLImageElement):
2261         (WebCore::HTMLImageElement::~HTMLImageElement):
2262         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
2263         (WebCore::HTMLImageElement::insertedInto):
2264         (WebCore::HTMLImageElement::removedFrom):
2265         (WebCore::HTMLImageElement::pictureNode):
2266         (WebCore::HTMLImageElement::setPictureNode):
2267         * html/HTMLImageElement.h:
2268         * html/parser/HTMLConstructionSite.cpp:
2269         (WebCore::HTMLConstructionSite::createHTMLElement):
2270
2271         Images that are built underneath a <picture> element are now connected
2272         to that picture element via a setPictureNode call from the parser. This
2273         ensures that the correct <source> elements are examined before checking the image.
2274
2275         This connection between images and their picture owners is handled using a static
2276         HashMap in HTMLImageElement. This connection is made both from the parser and from
2277         DOM insertions, and the map is queried now instead of looking directly at the
2278         image's parentNode().
2279
2280         Also note the change to pass the document element's computed style in for media
2281         query evaluation. Just as with the preload scanner, the image's style can't be
2282         used as it has not been determined yet.
2283
2284 2016-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
2285
2286         Cleanup in font loading code
2287         https://bugs.webkit.org/show_bug.cgi?id=153023
2288
2289         Reviewed by Zalan Bujtas.
2290
2291         See detailed notes below.
2292
2293         No new tests because there is no behavior change.
2294
2295         * css/CSSFontFace.cpp:
2296         (WebCore::CSSFontFace::isLoaded): Deleted. Never called.
2297         * css/CSSFontFace.h: Ditto.
2298         * css/CSSFontFaceSource.cpp:
2299         (WebCore::CSSFontFaceSource::font): No need to use a helper
2300         isLoaded() function.
2301         (WebCore::CSSFontFaceSource::isLoaded): Deleted. Unnecessary.
2302         * css/CSSFontFaceSource.h:
2303         * css/CSSFontFaceSrcValue.cpp:
2304         (WebCore::CSSFontFaceSrcValue::cachedFont): Un-indent code.
2305         * css/CSSFontSelector.cpp:
2306         (WebCore::registerLocalFontFacesForFamily): constructFamilyFontFaces()
2307         always returns an empty Vector. Therefore, the function of this function
2308         is to perform the ancillary processing related to the case where the Faces
2309         don't already exist. Renames the function and removes the empty vector
2310         return.
2311         (WebCore::CSSFontSelector::addFontFaceRule): Update for
2312         registerLocalFontFacesForFamily().
2313         (WebCore::FontFaceComparator::FontFaceComparator): Instead of using a static,
2314         construct a wrapper class around the comparator.
2315         (WebCore::FontFaceComparator::operator()): Ditto.
2316         (WebCore::CSSFontSelector::getFontFace): Un-indent code and update to use
2317         FontFaceComparator.
2318         (WebCore::CSSFontSelector::fallbackFontAt): Migrate off PassRefPtr.
2319         (WebCore::constructFamilyFontFaces): Deleted.
2320         (WebCore::compareFontFaces): Deleted.
2321         (WebCore::CSSFontSelector::resolvesFamilyFor): Deleted. Never called.
2322         * css/CSSFontSelector.h:
2323         * css/CSSSegmentedFontFace.cpp:
2324         (WebCore::CSSSegmentedFontFace::isValid): Deleted.
2325         (WebCore::CSSSegmentedFontFace::fontRanges): Cache negative validity results.
2326         * css/CSSSegmentedFontFace.h:
2327         * platform/graphics/FontCascade.h:
2328         (WebCore::FontCascade::fontSelector): Use nullptr.
2329         * platform/graphics/FontSelector.h:
2330
2331 2016-01-12  Ryosuke Niwa  <rniwa@webkit.org>
2332
2333         Add a build flag for custom element
2334         https://bugs.webkit.org/show_bug.cgi?id=153005
2335
2336         Reviewed by Alex Christensen.
2337
2338         Added a build flag for enabling custom elements.
2339
2340         * Configurations/FeatureDefines.xcconfig:
2341
2342 2016-01-12  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2343
2344         WebRTC: Update RTCPeerConnection.add/removeTrack() and add test
2345         https://bugs.webkit.org/show_bug.cgi?id=153010
2346
2347         Reviewed by Eric Carlson.
2348
2349         RTCPeerConnection.add/removeTrack() are not fully spec compliant yet, since that would
2350         require support for RTCRtpTransceiver which is a new work-in-progress feature. Use
2351         Vector, instead of map, for senders and receivers since nothing is removed from these
2352         sets anymore.
2353
2354         Test: fast/mediastream/RTCPeerConnection-add-removeTrack.html
2355
2356         * Modules/mediastream/RTCPeerConnection.cpp:
2357         (WebCore::RTCPeerConnection::addTrack):
2358         (WebCore::RTCPeerConnection::removeTrack):
2359         (WebCore::RTCPeerConnection::queuedCreateOffer): Deleted.
2360         * Modules/mediastream/RTCPeerConnection.h:
2361         * Modules/mediastream/RTCRtpSender.cpp:
2362         (WebCore::RTCRtpSender::RTCRtpSender):
2363         * Modules/mediastream/RTCRtpSender.h:
2364         (WebCore::RTCRtpSender::create):
2365         (WebCore::RTCRtpSender::mediaStreamIds):
2366
2367 2016-01-12  Brady Eidson  <beidson@apple.com>
2368
2369         Modern IDB: Check in empty SQLite backing store implementation.
2370         https://bugs.webkit.org/show_bug.cgi?id=153022
2371
2372         Reviewed by Alex Christensen.
2373
2374         No new tests (No change in behavior).
2375
2376         Just to get the implementation files in the tree, this backing store currently does nothing
2377         other than return errors for every operation.
2378
2379         * CMakeLists.txt:
2380         * WebCore.xcodeproj/project.pbxproj:
2381
2382         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Added.
2383         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
2384         (WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore):
2385         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
2386         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
2387         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
2388         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
2389         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
2390         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
2391         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
2392         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
2393         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
2394         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
2395         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
2396         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
2397         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
2398         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
2399         (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
2400         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
2401         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
2402         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
2403         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
2404         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
2405         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
2406         * Modules/indexeddb/server/SQLiteIDBBackingStore.h: Added.
2407
2408 2016-01-12  Brady Eidson  <beidson@apple.com>
2409
2410         Modern IDB: storage/indexeddb/dont-wedge.html is flaky.
2411         https://bugs.webkit.org/show_bug.cgi?id=152892
2412
2413         Reviewed by Alex Christensen.
2414
2415         No new tests (Reenabled existing test).
2416
2417         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2418         (WebCore::IDBClient::IDBConnectionToServer::abortOpenAndUpgradeNeeded):
2419         * Modules/indexeddb/client/IDBConnectionToServer.h:
2420         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2421
2422         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
2423         (WebCore::IDBClient::IDBOpenDBRequest::requestCompleted): If the database was opened
2424           or an upgrade transaction was started, but the script execution context is already
2425           stopped, immediately message back to the server so it doesn't wedge.
2426
2427         * Modules/indexeddb/server/IDBServer.cpp:
2428         (WebCore::IDBServer::IDBServer::abortOpenAndUpgradeNeeded):
2429         * Modules/indexeddb/server/IDBServer.h:
2430
2431         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
2432         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abortWithoutCallback):
2433         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2434
2435         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2436         (WebCore::InProcessIDBServer::abortOpenAndUpgradeNeeded):
2437         * Modules/indexeddb/shared/InProcessIDBServer.h:
2438
2439 2016-01-12  Commit Queue  <commit-queue@webkit.org>
2440
2441         Unreviewed, rolling out r194826.
2442         https://bugs.webkit.org/show_bug.cgi?id=153020
2443
2444         Appears to have regressed PLT (Requested by kling on #webkit).
2445
2446         Reverted changeset:
2447
2448         "Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL
2449         cont'd"
2450         https://bugs.webkit.org/show_bug.cgi?id=152902
2451         http://trac.webkit.org/changeset/194826
2452
2453 2016-01-12  Antti Koivisto  <antti@apple.com>
2454
2455         Don't reuse memory cache entries with different charset
2456         https://bugs.webkit.org/show_bug.cgi?id=110031
2457         rdar://problem/13666418
2458
2459         Reviewed by Andreas Kling.
2460
2461         Test: fast/loader/cache-encoding.html
2462
2463         * loader/cache/CachedResourceLoader.cpp:
2464         (WebCore::CachedResourceLoader::requestResource):
2465         (WebCore::logResourceRevalidationDecision):
2466         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
2467
2468             Pass full CachedResourceRequest to the function.
2469             If charset differs don't reuse the cache entry.
2470
2471         * loader/cache/CachedResourceLoader.h:
2472
2473 2016-01-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2474
2475         Use a pointer instead of PassRefPtr in AbstractView argument of UIEvent class
2476         https://bugs.webkit.org/show_bug.cgi?id=152829
2477
2478         Reviewed by Darin Adler.
2479
2480         As a step to reduce uses of PassRefPtr, UIEvent class doesn't need to use PassRefPtr for AbstractView argument.
2481         Nobody hands us ownership when making one of these objects.
2482
2483         * dom/FocusEvent.cpp:
2484         (WebCore::FocusEvent::FocusEvent):
2485         * dom/FocusEvent.h:
2486         * dom/KeyboardEvent.cpp:
2487         (WebCore::KeyboardEvent::KeyboardEvent):
2488         * dom/MouseEvent.cpp:
2489         (WebCore::MouseEvent::create):
2490         (WebCore::MouseEvent::MouseEvent):
2491         (WebCore::MouseEvent::initMouseEvent):
2492         (WebCore::SimulatedMouseEvent::create):
2493         (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
2494         * dom/MouseEvent.h:
2495         * dom/MouseRelatedEvent.cpp:
2496         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
2497         * dom/MouseRelatedEvent.h:
2498         * dom/TextEvent.cpp:
2499         (WebCore::TextEvent::create):
2500         (WebCore::TextEvent::createForPlainTextPaste):
2501         (WebCore::TextEvent::createForFragmentPaste):
2502         (WebCore::TextEvent::createForDrop):
2503         (WebCore::TextEvent::createForDictation):
2504         (WebCore::TextEvent::TextEvent):
2505         (WebCore::TextEvent::initTextEvent):
2506         * dom/TextEvent.h:
2507         * dom/TouchEvent.cpp:
2508         (WebCore::TouchEvent::TouchEvent):
2509         (WebCore::TouchEvent::initTouchEvent):
2510         * dom/TouchEvent.h:
2511         * dom/UIEvent.cpp:
2512         (WebCore::UIEvent::UIEvent):
2513         (WebCore::UIEvent::initUIEvent):
2514         * dom/UIEvent.h:
2515         (WebCore::UIEvent::create):
2516         (WebCore::UIEvent::view):
2517         * dom/UIEventWithKeyState.h:
2518         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
2519
2520 2016-01-12  Csaba Osztrogonác  <ossy@webkit.org>
2521
2522         Fix unused-private-field warnings in DisplayListItems.h
2523         https://bugs.webkit.org/show_bug.cgi?id=153012
2524
2525         Reviewed by Michael Catanzaro.
2526
2527         * platform/graphics/displaylists/DisplayListItems.cpp:
2528         (WebCore::DisplayList::DrawNativeImage::DrawNativeImage):
2529         * platform/graphics/displaylists/DisplayListItems.h:
2530
2531 2016-01-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2532
2533         Unreviewed. Fix isRecording condition logic in GraphicsContext::roundToDevicePixels after r194816.
2534
2535         This looks like a typo introduced in r194816, we want to return early logging
2536         a message when isRecording() returns true.
2537
2538         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2539         (WebCore::GraphicsContext::roundToDevicePixels):
2540         * platform/graphics/cg/GraphicsContextCG.cpp:
2541         (WebCore::GraphicsContext::roundToDevicePixels):
2542
2543 2016-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2544
2545         Inconsistencies in main resource load delegates when loading from history
2546         https://bugs.webkit.org/show_bug.cgi?id=150927
2547
2548         Reviewed by Michael Catanzaro.
2549
2550         When restoring a page from the page cache, even though there
2551         isn't an actual load of resources, we are still emitting the load
2552         delegates to let the API layer know there are contents being
2553         loaded in the web view. This makes the page cache restoring
2554         transparent for the API layer. However, when restoring a page from
2555         the cache, all the delegates are emitted after the load is
2556         committed. This is not consistent with real loads, where we first
2557         load the main resource and once we get a response we commit the
2558         load. This inconsistency is problematic if the API layer expects
2559         to always have a main resource with a response when the load is
2560         committed. This is the case of the GTK+ port, for example. So,
2561         this patch ensures that when a page is restored from the page
2562         cache, the main resource load delegates that are emitted until a
2563         response is received in normal loads, are emitted before the load
2564         is committed.
2565
2566         Test: http/tests/loading/main-resource-delegates-on-back-navigation.html
2567
2568         * loader/FrameLoader.cpp:
2569         (WebCore::FrameLoader::commitProvisionalLoad): When loading from
2570         the page cache, send delegate messages up to didReceiveResponse
2571         for the main resource before the load is committed, and the
2572         remaining messages afterwards.
2573
2574 2016-01-09  Andy Estes  <aestes@apple.com>
2575
2576         [Cocoa] Add SPI to opt out a URL scheme from the memory cache
2577         https://bugs.webkit.org/show_bug.cgi?id=152950
2578         rdar://problem/24066652
2579
2580         Reviewed by Tim Horton.
2581
2582         Added a list of schemes to SchemeRegistry whose resources should always be revalidated. Taught CachedResource to
2583         return a freshness lifetime of 0 for these resources, unless the scheme is one that should be cached indefinitely.
2584
2585         New API test: WebKit2.AlwaysRevalidatedURLSchemes
2586
2587         * loader/cache/CachedResource.cpp:
2588         (WebCore::shouldCacheSchemeIndefinitely): Moved from SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely().
2589         (WebCore::CachedResource::freshnessLifetime): For a scheme that should not be cached indefinitely, return 0 if
2590         that scheme should always be revalidated according to SchemeRegistry.
2591         * platform/SchemeRegistry.cpp:
2592         (WebCore::alwaysRevalidatedSchemes):
2593         (WebCore::SchemeRegistry::registerURLSchemeAsAlwaysRevalidated):
2594         (WebCore::SchemeRegistry::shouldAlwaysRevalidateURLScheme):
2595         (WebCore::SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely): Moved to WebCore::shouldCacheSchemeIndefinitely().
2596         There was no reason for this to be in SchemeRegistry.
2597         * platform/SchemeRegistry.h:
2598
2599 2016-01-11  Brady Eidson  <beidson@apple.com>
2600
2601         Modern IDB: storage/indexeddb/index-multientry.html fails under GuardMalloc/ASAN.
2602         https://bugs.webkit.org/show_bug.cgi?id=152990
2603
2604         Reviewed by Alex Christensen.
2605
2606         No new tests (Covered by re-enabling existing test).
2607
2608         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2609         (WebCore::IDBClient::IDBRequest::dispatchEvent): Use String::utf8() instead of AtomicString::characters8() for
2610           the format string, as the latter fails under ASAN.
2611           
2612         * Modules/indexeddb/server/IndexValueStore.cpp:
2613         (WebCore::IDBServer::IndexValueStore::removeEntriesWithValueKey): We can't save off pointers to IDBKeyDatas
2614           used as keys in the map, because the moment we start mutating the map the keys can be rehashed, invalidating
2615           our pointers. Save off the IDBKeyDatas by value instead.
2616
2617 2016-01-11  Joseph Pecoraro  <pecoraro@apple.com>
2618
2619         Web Inspector: Migrate Page Timeline recording to ScriptProfiler
2620         https://bugs.webkit.org/show_bug.cgi?id=152727
2621
2622         Reviewed by Brian Burg.
2623
2624         Test: inspector/script-profiler/event-type-Other.html
2625
2626         This now shares the JavaScript profiling code between JSContext and Page
2627         inspection. It also moves forward splitting the Page's Timeline domain
2628         into smaller components that can be turned on/off individually.
2629
2630         * bindings/js/JSCallbackData.cpp:
2631         (WebCore::JSCallbackData::invokeCallback):
2632         * bindings/js/JSErrorHandler.cpp:
2633         (WebCore::JSErrorHandler::handleEvent):
2634         * bindings/js/JSEventListener.cpp:
2635         (WebCore::JSEventListener::handleEvent):
2636         * bindings/js/JSMainThreadExecState.h:
2637         (WebCore::JSMainThreadExecState::profiledCall):
2638         (WebCore::JSMainThreadExecState::profiledEvaluate):
2639         * bindings/js/JSMutationCallback.cpp:
2640         (WebCore::JSMutationCallback::call):
2641         * bindings/js/ScheduledAction.cpp:
2642         (WebCore::ScheduledAction::executeFunctionInContext):
2643         * bindings/js/ScriptController.cpp:
2644         (WebCore::ScriptController::evaluateInWorld):
2645         * bindings/objc/WebScriptObject.mm:
2646         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2647         (-[WebScriptObject evaluateWebScript:]):
2648         Identify entry points into JSC that we want to profile for the frontend.
2649         These were nearly all already classified for the Timeline. We added missing
2650         support for ErrorHandlers (window.onerror handler functions).
2651
2652         * inspector/InspectorTimelineAgent.cpp:
2653         (WebCore::InspectorTimelineAgent::didCallFunction):
2654         (WebCore::InspectorTimelineAgent::didEvaluateScript):
2655         (WebCore::startProfiling): Deleted.
2656         (WebCore::stopProfiling): Deleted.
2657         (WebCore::InspectorTimelineAgent::willCallFunction): Deleted.
2658         (WebCore::InspectorTimelineAgent::willEvaluateScript): Deleted.
2659         * inspector/InspectorTimelineAgent.h:
2660         TimelineAgent no longer needs to start/stop the Legacy Profiler
2661         since ScriptProfiler will automatically do that for us. Delete
2662         all code associated with that. There is still an open question
2663         regarding `console.profile` and `console.profileEnd` that
2664         starts/stops the profiler.
2665
2666 2016-01-11  Anders Carlsson  <andersca@apple.com>
2667
2668         Get rid of CFMakeCollectable, it is a no-op
2669         https://bugs.webkit.org/show_bug.cgi?id=152988
2670
2671         Reviewed by Sam Weinig.
2672
2673         * platform/mac/WebCoreNSURLExtras.mm:
2674         (WebCore::URLByTruncatingOneCharacterBeforeComponent):
2675         (WebCore::URLByRemovingComponentAndSubsequentCharacter):
2676
2677 2016-01-11  Commit Queue  <commit-queue@webkit.org>
2678
2679         Unreviewed, rolling out r194866.
2680         https://bugs.webkit.org/show_bug.cgi?id=152986
2681
2682         This change broke the mac build (Requested by ryanhaddad on
2683         #webkit).
2684
2685         Reverted changeset:
2686
2687         "[Cocoa] Add SPI to opt out a URL scheme from the memory
2688         cache"
2689         https://bugs.webkit.org/show_bug.cgi?id=152950
2690         http://trac.webkit.org/changeset/194866
2691
2692 2016-01-11  Zalan Bujtas  <zalan@apple.com>
2693
2694         Padding added to table-cell element after font-size change.
2695         https://bugs.webkit.org/show_bug.cgi?id=152796
2696
2697         Reviewed by David Hyatt.
2698
2699         Do not include intrinsicPaddingBefore value while figuring out the height of a row.
2700         In RenderTableSection::calcRowLogicalHeight() we are interested in the height of the content
2701         without the additional padding (normal padding is included).
2702
2703         Test: fast/table/table-baseline-grows.html
2704
2705         * rendering/RenderTableSection.cpp:
2706         (WebCore::RenderTableSection::calcRowLogicalHeight):
2707
2708 2016-01-11  Andy Estes  <aestes@apple.com>
2709
2710         [Cocoa] Add SPI to opt out a URL scheme from the memory cache
2711         https://bugs.webkit.org/show_bug.cgi?id=152950
2712         rdar://problem/24066652
2713
2714         Reviewed by Tim Horton.
2715
2716         Added a list of schemes to SchemeRegistry whose resources should always be revalidated. Taught CachedResource to
2717         return a freshness lifetime of 0 for these resources, unless the scheme is one that should be cached indefinitely.
2718
2719         New API test: WebKit2.AlwaysRevalidatedURLSchemes
2720
2721         * loader/cache/CachedResource.cpp:
2722         (WebCore::shouldCacheSchemeIndefinitely): Moved from SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely().
2723         (WebCore::CachedResource::freshnessLifetime): For a scheme that should not be cached indefinitely, return 0 if
2724         that scheme should always be revalidated according to SchemeRegistry.
2725         * platform/SchemeRegistry.cpp:
2726         (WebCore::alwaysRevalidatedSchemes):
2727         (WebCore::SchemeRegistry::registerURLSchemeAsAlwaysRevalidated):
2728         (WebCore::SchemeRegistry::shouldAlwaysRevalidateURLScheme):
2729         (WebCore::SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely): Moved to WebCore::shouldCacheSchemeIndefinitely().
2730         There was no reason for this to be in SchemeRegistry.
2731         * platform/SchemeRegistry.h:
2732
2733 2016-01-11  Dave Hyatt  <hyatt@apple.com>
2734
2735         Picture element needs to work with the preload scanner and select the correct
2736         source element instead of loading the image.
2737         https://bugs.webkit.org/show_bug.cgi?id=152983
2738
2739         Reviewed by Dean Jackson.
2740
2741         Added new tests in http/tests/loading.
2742
2743         * html/parser/HTMLPreloadScanner.cpp:
2744         (WebCore::TokenPreloadScanner::tagIdFor):
2745         (WebCore::TokenPreloadScanner::initiatorFor):
2746         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner):
2747         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
2748         (WebCore::TokenPreloadScanner::StartTagScanner::processImageAndScriptAttribute):
2749         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2750         (WebCore::TokenPreloadScanner::StartTagScanner::resourceType):
2751         (WebCore::TokenPreloadScanner::scan):
2752         * html/parser/HTMLPreloadScanner.h:
2753         (WebCore::TokenPreloadScanner::setPredictedBaseElementURL):
2754         (WebCore::TokenPreloadScanner::inPicture):
2755
2756 2016-01-11  Brady Eidson  <beidson@apple.com>
2757
2758         Modern IDB: storage/indexeddb/key-generator.html fails.
2759         https://bugs.webkit.org/show_bug.cgi?id=152981
2760
2761         Reviewed by Alex Christensen.
2762
2763         No new tests (One failing test now passes, and one test's results get a progression).
2764
2765         * Modules/indexeddb/server/IDBBackingStore.h:
2766         
2767         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2768         (WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber): Throw an error if the current
2769           value is already over 2^53.
2770         (WebCore::IDBServer::MemoryIDBBackingStore::revertGeneratedKeyNumber):
2771         (WebCore::IDBServer::MemoryIDBBackingStore::maybeUpdateKeyGeneratorNumber): Handle double -> uint64_t
2772           conversions properly when calculating the next key.
2773         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2774         
2775         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2776         (WebCore::IDBServer::ScopeGuard::ScopeGuard): Add this utility class to call a function 
2777           any time it goes out of scope.
2778         (WebCore::IDBServer::ScopeGuard::~ScopeGuard):
2779         (WebCore::IDBServer::ScopeGuard::enable):
2780         (WebCore::IDBServer::ScopeGuard::disable):
2781         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Revert the key generator value if
2782           the put/add operation ends in error.
2783
2784 2016-01-11  Brady Eidson  <beidson@apple.com>
2785
2786         Modern IDB: storage/indexeddb/lazy-index-population.html fails.
2787         https://bugs.webkit.org/show_bug.cgi?id=152976
2788
2789         Reviewed by Alex Christensen.
2790
2791         No new tests (At least one failing test now passes).
2792
2793         We were restoring objectstores/indexes incorrectly on transaction abort.
2794
2795         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
2796         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
2797         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2798         (WebCore::IDBServer::MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort):
2799
2800 2016-01-11  Brady Eidson  <beidson@apple.com>
2801
2802         Modern IDB: Make MemoryIndex and MemoryObjectStore RefCounted.
2803         https://bugs.webkit.org/show_bug.cgi?id=152966
2804
2805         Reviewed by Alex Christensen.
2806
2807         No new tests (Refactor, no change in behavior)
2808
2809         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
2810         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexDeleted):
2811         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreDeleted):
2812         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
2813         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
2814         
2815         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2816         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
2817         (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
2818         (WebCore::IDBServer::MemoryIDBBackingStore::restoreObjectStoreForVersionChangeAbort):
2819         (WebCore::IDBServer::MemoryIDBBackingStore::registerObjectStore):
2820         (WebCore::IDBServer::MemoryIDBBackingStore::takeObjectStoreByName):
2821         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2822         
2823         * Modules/indexeddb/server/MemoryIndex.cpp:
2824         (WebCore::IDBServer::MemoryIndex::create):
2825         * Modules/indexeddb/server/MemoryIndex.h:
2826         
2827         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2828         (WebCore::IDBServer::MemoryObjectStore::create):
2829         (WebCore::IDBServer::MemoryObjectStore::createIndex):
2830         (WebCore::IDBServer::MemoryObjectStore::maybeRestoreDeletedIndex):
2831         (WebCore::IDBServer::MemoryObjectStore::takeIndexByName):
2832         (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
2833         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForDeleteRecord):
2834         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
2835         (WebCore::IDBServer::MemoryObjectStore::registerIndex):
2836         * Modules/indexeddb/server/MemoryObjectStore.h:
2837
2838 2016-01-11  Andreas Kling  <akling@apple.com>
2839
2840         Fix other builds after my MSVC build fix. :-|
2841
2842         * css/StyleResolver.cpp:
2843
2844 2016-01-11  Andreas Kling  <akling@apple.com>
2845
2846         Fix MSVC build after r194848.
2847
2848         Since MSVC refuses to recognize the friendship between LazyNeverDestroyed
2849         and some CSS*Value classes, make their constructors public in MSVC builds.
2850
2851         Added FIXME's to make it look extra gross.
2852
2853         * css/CSSInheritedValue.h:
2854         (WebCore::CSSInheritedValue::create): Deleted.
2855         * css/CSSInitialValue.h:
2856         * css/CSSPrimitiveValue.h:
2857         * css/CSSRevertValue.h:
2858         (WebCore::CSSRevertValue::create): Deleted.
2859         * css/CSSUnsetValue.h:
2860         (WebCore::CSSUnsetValue::create): Deleted.
2861         * css/StyleResolver.cpp:
2862         (WebCore::StyleResolver::applyProperty):
2863
2864 2016-01-11  Andreas Kling  <akling@apple.com>
2865
2866         CSSValuePool should use nonfragmented storage for eternal caches.
2867         <https://webkit.org/b/152960>
2868
2869         Reviewed by Antti Koivisto.
2870
2871         Store all of the common cached CSS value objects in contiguous arrays
2872         instead of lazily allocating them on the heap.
2873
2874         This reduces heap fragmentation (win) and removes indirection (win)
2875
2876         * css/CSSInheritedValue.h:
2877         * css/CSSInitialValue.h:
2878         * css/CSSPrimitiveValue.h:
2879         * css/CSSRevertValue.h:
2880         * css/CSSUnsetValue.h:
2881         * css/CSSValuePool.cpp:
2882         (WebCore::CSSValuePool::CSSValuePool):
2883         (WebCore::CSSValuePool::createIdentifierValue):
2884         (WebCore::CSSValuePool::createColorValue):
2885         (WebCore::CSSValuePool::createValue):
2886         (WebCore::CSSValuePool::drain): Deleted.
2887         * css/CSSValuePool.h:
2888         (WebCore::CSSValuePool::createInheritedValue):
2889         (WebCore::CSSValuePool::createImplicitInitialValue):
2890         (WebCore::CSSValuePool::createExplicitInitialValue):
2891         (WebCore::CSSValuePool::createUnsetValue):
2892         (WebCore::CSSValuePool::createRevertValue):
2893
2894 2016-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2895
2896         [GTK] Cleanup RenderThemeGtk
2897         https://bugs.webkit.org/show_bug.cgi?id=152888
2898
2899         Reviewed by Michael Catanzaro.
2900
2901         Use a common path for GTK+ 3.19 and previous versions, simplifying
2902         the code and removing a lot of ifdefs.
2903
2904          - createStyleContext() now receives a theme part enum value, and
2905            an optional parent GtkStyleContext. It encapsulates all the
2906            differences between GTK+ 3.19 and previous version leaving the
2907            rendering code common and free of ifdefs.
2908          - Stock icons support have been removed, simplifying the code
2909            that now always renders symbolic icons, updating the colors
2910            depending on the current state.
2911          - Media button and colors have been removed, because they are
2912            unused now that we render the media controls with CSS.
2913          - ComboBox separators support has also been removed. In GTK+ 3.19
2914            combo boxes no longer have separators and most of the GTK+
2915            themes don't use the either, so it's better to simple not render
2916            them anymore in WebKit either.
2917          - Code to paint caps lock indicator has been removed too, since
2918            caps lock indicator is now shadow dom and automatically
2919            rendered by WebCore.
2920
2921         * rendering/RenderThemeGtk.cpp:
2922         (WebCore::createStyleContext):
2923         (WebCore::loadThemedIcon):
2924         (WebCore::gtkIconStateFlags):
2925         (WebCore::RenderThemeGtk::adjustRepaintRect):
2926         (WebCore::setToggleSize):
2927         (WebCore::paintToggle):
2928         (WebCore::RenderThemeGtk::setCheckboxSize):
2929         (WebCore::RenderThemeGtk::paintCheckbox):
2930         (WebCore::RenderThemeGtk::setRadioSize):
2931         (WebCore::RenderThemeGtk::paintRadio):
2932         (WebCore::RenderThemeGtk::paintButton):
2933         (WebCore::getComboBoxMetrics):
2934         (WebCore::RenderThemeGtk::popupInternalPaddingLeft):
2935         (WebCore::RenderThemeGtk::popupInternalPaddingRight):
2936         (WebCore::RenderThemeGtk::popupInternalPaddingTop):
2937         (WebCore::RenderThemeGtk::popupInternalPaddingBottom):
2938         (WebCore::RenderThemeGtk::paintMenuList):
2939         (WebCore::RenderThemeGtk::paintTextField):
2940         (WebCore::adjustSearchFieldIconStyle):
2941         (WebCore::RenderThemeGtk::adjustSearchFieldResultsDecorationPartStyle):
2942         (WebCore::paintIcon):
2943         (WebCore::paintEntryIcon):
2944         (WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
2945         (WebCore::RenderThemeGtk::adjustSearchFieldCancelButtonStyle):
2946         (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
2947         (WebCore::RenderThemeGtk::shouldHaveCapsLockIndicator):
2948         (WebCore::RenderThemeGtk::paintSliderTrack):
2949         (WebCore::RenderThemeGtk::paintSliderThumb):
2950         (WebCore::RenderThemeGtk::adjustSliderThumbSize):
2951         (WebCore::RenderThemeGtk::paintProgressBar):
2952         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
2953         (WebCore::paintSpinArrowButton):
2954         (WebCore::RenderThemeGtk::paintInnerSpinButton):
2955         (WebCore::styleColor):
2956         (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor):
2957         (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor):
2958         (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor):
2959         (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor):
2960         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor):
2961         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor):
2962         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor):
2963         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor):
2964         (WebCore::RenderThemeGtk::systemColor):
2965         (WebCore::RenderThemeGtk::paintMediaButton):
2966         (WebCore::RenderThemeGtk::paintMediaFullscreenButton):
2967         (WebCore::RenderThemeGtk::paintMediaMuteButton):
2968         (WebCore::RenderThemeGtk::paintMediaPlayButton):
2969         (WebCore::RenderThemeGtk::paintMediaSeekBackButton):
2970         (WebCore::RenderThemeGtk::paintMediaSeekForwardButton):
2971         (WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton):
2972         * rendering/RenderThemeGtk.h:
2973
2974 2016-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2975
2976         [GTK] Cleanup ScrollbarThemeGtk
2977         https://bugs.webkit.org/show_bug.cgi?id=152830
2978
2979         Reviewed by Michael Catanzaro.
2980
2981         Use a common path for GTK+ 3.19 and previous versions, simplifying
2982         the code and removing a lot of ifdefs. Use always a new
2983         GtkStyleContext, but when painting cache the newly created one so
2984         all paint methods use that one. We were also caching some theme
2985         properties assuming they don't change unless the theme changes,
2986         but some of them can have different values depending on the state,
2987         for example, when hovered or pressed. Those properties are now
2988         only cached when we create a new GtkStyleContext.
2989         The method updateScrollbarsFrameThickness() has also been removed,
2990         since the Scrollbar constructor already initializes the frame rect
2991         using the scrollbarThickness(). This method was not doing anything
2992         anyway, since that was called on the constructor of the theme,
2993         when there were no scrollbars registered. This also means we no
2994         longer need to track registered/unregistered scrollbars.
2995
2996         * platform/gtk/ScrollbarThemeGtk.cpp:
2997         (WebCore::ScrollbarThemeGtk::backButtonRect): Use the cached
2998         GtkStyleContext and properties or create a new.
2999         (WebCore::ScrollbarThemeGtk::forwardButtonRect): Ditto.
3000         (WebCore::ScrollbarThemeGtk::trackRect): Ditto.
3001         (WebCore::orientationStyleClass):
3002         (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext): Create a
3003         new GtkStyleContext for the scrollbar if there isn't a cached
3004         one. Also initialize the properties that depend on the state.
3005         (WebCore::createChildStyleContext): Create a new GtkStyleContext
3006         from a parent one.
3007         (WebCore::ScrollbarThemeGtk::updateThemeProperties): Get the
3008         properties that can only change when the theme changes.
3009         (WebCore::ScrollbarThemeGtk::thumbRect): Use the cached
3010         GtkStyleContext and properties or create a new.
3011         (WebCore::adjustRectAccordingToMargin): Use always the
3012         GtkStyleContext state instead of receiving it and setting it again.
3013         (WebCore::ScrollbarThemeGtk::paintTrackBackground): Get or create
3014         a GtkStyleContext for the scrollbar and create a child one for the trough.
3015         (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): Use the
3016         cached GtkStyleContext or create a new one.
3017         (WebCore::ScrollbarThemeGtk::paintThumb): Get or create a
3018         GtkStyleContext for the scrollbar and create a child ones for
3019         trough and slider.
3020         (WebCore::ScrollbarThemeGtk::paintButton): Get or create a
3021         GtkStyleContext for the scrollbar and create a child one for the button.
3022         (WebCore::ScrollbarThemeGtk::paint): Create a GtkStyleContext and
3023         cache it temporarily using TemporaryChange until the method finishes.
3024         (WebCore::ScrollbarThemeGtk::scrollbarThickness): Use the cached
3025         GtkStyleContext and properties or create a new.
3026         (WebCore::ScrollbarThemeGtk::buttonSize): Ditto.
3027         * platform/gtk/ScrollbarThemeGtk.h:
3028
3029 2016-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
3030
3031         [SVG -> OTF Converter] Parsing failures cause use of incomplete fonts
3032         https://bugs.webkit.org/show_bug.cgi?id=152772
3033         <rdar://problem/24043104>
3034
3035         Reviewed by Simon Fraser.
3036
3037         Originally, if we fail to parse a glyph, we would simply skip the glyph. However, this means that
3038         we will create an incomplete font without all the necessary glyphs. This causes very distressing
3039         text where all the occurances of a particular letter are missing. Instead, we should treat the
3040         entire font as invalid.
3041
3042         Test: fast/text/svg-font-invalid-glyph-path-failure.html
3043
3044         * css/CSSFontFaceSource.cpp:
3045         (WebCore::CSSFontFaceSource::font):
3046         * loader/cache/CachedSVGFont.cpp:
3047         (WebCore::CachedSVGFont::ensureCustomFontData):
3048         * svg/SVGToOTFFontConversion.cpp:
3049         (WebCore::SVGToOTFFontConverter::error):
3050         (WebCore::SVGToOTFFontConverter::transcodeGlyphPaths):
3051         (WebCore::SVGToOTFFontConverter::processGlyphElement):
3052         (WebCore::convertSVGToOTFFont):
3053         * svg/SVGToOTFFontConversion.h:
3054
3055 2016-01-10  Andreas Kling  <akling@apple.com>
3056
3057         Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL cont'd
3058         <https://webkit.org/b/152902>
3059
3060         Reviewed by Andy Estes.
3061
3062         Convert some more of the remaining clients to use NeverDestroyed.
3063
3064         * html/track/VTTRegion.cpp:
3065         (WebCore::VTTRegion::textTrackCueContainerShadowPseudoId):
3066         (WebCore::VTTRegion::textTrackRegionShadowPseudoId):
3067         * svg/properties/SVGAnimatedPropertyMacros.h:
3068
3069 2016-01-09  Simon Fraser  <simon.fraser@apple.com>
3070
3071         Hook up display-list drawing in GraphicsLayerCA
3072         https://bugs.webkit.org/show_bug.cgi?id=152946
3073
3074         Reviewed by Zalan Bujtas.
3075
3076         Have GraphicsLayerCA hold a DisplayList. If enabled, do a display-list record
3077         in GraphicsLayerCA::recursiveCommitChanges(), and a playback in GraphicsLayerCA::platformCALayerPaintContents().
3078         
3079         GraphicsLayerCA needs to maintain a m_hasEverPainted flag to know to do a full record
3080         at first paint (when there are no dirty rects).
3081         
3082         Plumb 'isUsingDisplayListDrawing' through to TileGrid via PlatformCALayer{Client}
3083         so that we can decorate the tile paint counters with an outline.
3084         
3085         Have RenderLayerCompositor push the displayListDrawingEnabled state down through
3086         RenderLayerBackings to GraphicsLayers.
3087         
3088         Convert RenderLayerCompositor to use initializers.
3089
3090         * platform/graphics/GraphicsLayer.cpp:
3091         (WebCore::GraphicsLayer::GraphicsLayer):
3092         * platform/graphics/GraphicsLayer.h:
3093         (WebCore::GraphicsLayer::usesDisplayListDrawing):
3094         (WebCore::GraphicsLayer::setUsesDisplayListDrawing):
3095         * platform/graphics/ca/GraphicsLayerCA.cpp:
3096         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
3097         (WebCore::GraphicsLayerCA::setUsesDisplayListDrawing):
3098         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
3099         (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
3100         (WebCore::GraphicsLayerCA::updateDrawsContent):
3101         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
3102         * platform/graphics/ca/GraphicsLayerCA.h:
3103         * platform/graphics/ca/PlatformCALayer.cpp:
3104         (WebCore::PlatformCALayer::drawRepaintIndicator):
3105         * platform/graphics/ca/PlatformCALayerClient.h:
3106         (WebCore::PlatformCALayerClient::isUsingDisplayListDrawing):
3107         * platform/graphics/ca/TileGrid.cpp:
3108         (WebCore::TileGrid::platformCALayerShowRepaintCounter):
3109         (WebCore::TileGrid::isUsingDisplayListDrawing):
3110         * platform/graphics/ca/TileGrid.h:
3111         * platform/graphics/displaylists/DisplayList.h: Sadly need to include DisplayListItems.h
3112         to get things to compile. I wasn't able to avoid this even when making functions non-inline.
3113         * rendering/RenderLayerBacking.cpp:
3114         (WebCore::RenderLayerBacking::createGraphicsLayer):
3115         * rendering/RenderLayerCompositor.cpp:
3116         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
3117         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
3118         * rendering/RenderLayerCompositor.h:
3119
3120 2016-01-09  Zalan Bujtas  <zalan@apple.com>
3121
3122         REGRESSION (r194426): First email field is not autofilled on amazon.com
3123         https://bugs.webkit.org/show_bug.cgi?id=152945
3124         <rdar://problem/24082914>
3125
3126         Reviewed by Simon Fraser.
3127
3128         r194426 missed marking the m_layoutRoot for layout while converting to full layout (it only marked the new layout root).
3129
3130         Test: fast/forms/multiple-subtree-layout-failure.html
3131
3132         * page/FrameView.cpp:
3133         (WebCore::FrameView::scheduleRelayoutOfSubtree):
3134
3135 2016-01-09  Dan Bernstein  <mitz@apple.com>
3136
3137         [Cocoa] Allow overriding the frameworks directory independently of using a staging install path
3138         https://bugs.webkit.org/show_bug.cgi?id=152926
3139
3140         Reviewed by Tim Horton.
3141
3142         Introduce a new build setting, WK_OVERRIDE_FRAMEWORKS_DIR. When not empty, it determines
3143         where the frameworks are installed. Setting USE_STAGING_INSTALL_PATH to YES sets
3144         WK_OVERRIDE_FRAMEWORKS_DIR to $(SYSTEM_LIBRARY_DIR)/StagedFrameworks/Safari.
3145
3146         Account for the possibility of WK_OVERRIDE_FRAMEWORKS_DIR containing spaces.
3147
3148         * Configurations/WebCore.xcconfig:
3149         - Replace STAGED_FRAMEWORKS_SEARCH_PATH in FRAMEWORK_SEARCH_PATHS with
3150           WK_OVERRIDE_FRAMEWORKS_DIR and add quotes to account for spaces.
3151         - Define WEBCORE_FRAMEWORKS_DIR and PRODUCTION_FRAMEWORKS_DIR based on
3152           WK_OVERRIDE_FRAMEWORKS_DIR.
3153
3154         * WebCore.xcodeproj/project.pbxproj: Work around make’s inability to handle spaces in paths
3155           by creating a symlink to JAVASCRIPTCORE_PRIVATE_HEADERS_DIR under BUILT_PRODUCTS_DIR and
3156           using the symlink as the value of JavaScriptCore_SCRIPTS_DIR.
3157
3158 2016-01-09  Andreas Kling  <akling@apple.com>
3159
3160         Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL
3161         <https://webkit.org/b/152902>
3162
3163         Reviewed by Anders Carlsson.
3164
3165         Mostly mechanical conversion to NeverDestroyed throughout WebCore.
3166
3167         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
3168         (WebCore::stringForPlaybackTargetAvailability):
3169         * Modules/indexeddb/IDBCursor.cpp:
3170         (WebCore::IDBCursor::directionNext):
3171         (WebCore::IDBCursor::directionNextUnique):
3172         (WebCore::IDBCursor::directionPrev):
3173         (WebCore::IDBCursor::directionPrevUnique):
3174         * Modules/indexeddb/IDBTransaction.cpp:
3175         (WebCore::IDBTransaction::modeReadOnly):
3176         (WebCore::IDBTransaction::modeReadWrite):
3177         (WebCore::IDBTransaction::modeVersionChange):
3178         (WebCore::IDBTransaction::modeReadOnlyLegacy):
3179         (WebCore::IDBTransaction::modeReadWriteLegacy):
3180         * Modules/indexeddb/legacy/LegacyRequest.cpp:
3181         (WebCore::LegacyRequest::readyState):
3182         * Modules/mediacontrols/MediaControlsHost.cpp:
3183         (WebCore::MediaControlsHost::automaticKeyword):
3184         (WebCore::MediaControlsHost::forcedOnlyKeyword):
3185         (WebCore::MediaControlsHost::alwaysOnKeyword):
3186         (WebCore::MediaControlsHost::externalDeviceType):
3187         * Modules/mediasource/MediaSource.cpp:
3188         (WebCore::MediaSource::openKeyword):
3189         (WebCore::MediaSource::closedKeyword):
3190         (WebCore::MediaSource::endedKeyword):
3191         (WebCore::MediaSource::streamEndedWithError):
3192         * Modules/plugins/QuickTimePluginReplacement.mm:
3193         (WebCore::quickTimePluginReplacementScript):
3194         (WebCore::QuickTimePluginReplacement::supportsMimeType):
3195         (WebCore::QuickTimePluginReplacement::supportsFileExtension):
3196         * Modules/speech/SpeechSynthesis.cpp:
3197         (WebCore::SpeechSynthesis::boundaryEventOccurred):
3198         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3199         (WebCore::cssPropertyIDForJSCSSPropertyName):
3200         * bridge/c/c_instance.cpp:
3201         (JSC::Bindings::globalExceptionString):
3202         * css/MediaList.cpp:
3203         (WebCore::addResolutionWarningMessageToConsole):
3204         * css/StyleSheetContents.cpp:
3205         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
3206         * dom/ChildListMutationScope.cpp:
3207         (WebCore::accumulatorMap):
3208         * dom/DOMImplementation.cpp:
3209         (WebCore::isSupportedSVG10Feature):
3210         (WebCore::isSupportedSVG11Feature):
3211         * dom/Document.cpp:
3212         (WebCore::Document::readyState):
3213         * dom/Element.cpp:
3214         (WebCore::Element::webkitRegionOverset):
3215         * dom/EventDispatcher.cpp:
3216         (WebCore::EventDispatcher::dispatchSimulatedClick):
3217         * dom/InlineStyleSheetOwner.cpp:
3218         (WebCore::isValidCSSContentType):
3219         * dom/MutationObserver.cpp:
3220         (WebCore::activeMutationObservers):
3221         (WebCore::suspendedMutationObservers):
3222         * dom/MutationRecord.cpp:
3223         * dom/PseudoElement.cpp:
3224         (WebCore::pseudoElementTagName):
3225         (WebCore::PseudoElement::pseudoElementNameForEvents):
3226         * dom/QualifiedName.cpp:
3227         (WebCore::qualifiedNameCache):
3228         (WebCore::nullQName):
3229         * dom/ScriptElement.cpp:
3230         (WebCore::isLegacySupportedJavaScriptLanguage):
3231         (WebCore::ScriptElement::notifyFinished):
3232         * editing/ApplyStyleCommand.cpp:
3233         (WebCore::styleSpanClassString):
3234         * editing/MarkupAccumulator.cpp:
3235         (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
3236         * editing/ReplaceSelectionCommand.cpp:
3237         (WebCore::isInterchangeNewlineNode):
3238         (WebCore::isInterchangeConvertedSpaceSpan):
3239         * editing/htmlediting.cpp:
3240         (WebCore::nonBreakingSpaceString):
3241         * editing/markup.cpp:
3242         (WebCore::StyledMarkupAccumulator::styleNodeCloseTag):
3243         (WebCore::createMarkupInternal):
3244         * fileapi/Blob.cpp:
3245         (WebCore::BlobURLRegistry::registry):
3246         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
3247         (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree):
3248         * html/DateInputType.cpp:
3249         (WebCore::DateInputType::createStepRange):
3250         * html/DateTimeInputType.cpp:
3251         (WebCore::DateTimeInputType::createStepRange):
3252         * html/DateTimeLocalInputType.cpp:
3253         (WebCore::DateTimeLocalInputType::createStepRange):
3254         * html/EmailInputType.cpp:
3255         (WebCore::isValidEmailAddress):
3256         * html/FormController.cpp:
3257         (WebCore::FormKeyGenerator::formKey):
3258         (WebCore::formStateSignature):
3259         * html/HTMLAnchorElement.cpp:
3260         (WebCore::rootEditableElementMap):
3261         * html/HTMLButtonElement.cpp:
3262         (WebCore::HTMLButtonElement::formControlType):
3263         * html/HTMLFieldSetElement.cpp:
3264         (WebCore::HTMLFieldSetElement::formControlType):
3265         * html/HTMLFrameOwnerElement.h:
3266         (WebCore::SubframeLoadingDisabler::disabledSubtreeRoots):
3267         * html/HTMLKeygenElement.cpp:
3268         (WebCore::HTMLKeygenElement::formControlType):
3269         * html/HTMLLinkElement.cpp:
3270         (WebCore::linkLoadEventSender):
3271         * html/HTMLMediaElement.cpp:
3272         (WebCore::documentToElementSetMap):
3273         * html/HTMLObjectElement.cpp:
3274         (WebCore::isRecognizedTagName):
3275         * html/HTMLOptGroupElement.cpp:
3276         (WebCore::HTMLOptGroupElement::formControlType):
3277         * html/HTMLOutputElement.cpp:
3278         (WebCore::HTMLOutputElement::formControlType):
3279         * html/HTMLPlugInElement.cpp:
3280         (WebCore::registeredPluginReplacements):
3281         * html/HTMLPlugInImageElement.cpp:
3282         (WebCore::titleText):
3283         (WebCore::subtitleText):
3284         (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay):
3285         * html/HTMLSelectElement.cpp:
3286         (WebCore::HTMLSelectElement::formControlType):
3287         * html/HTMLStyleElement.cpp:
3288         (WebCore::styleLoadEventSender):
3289         * html/HTMLTextAreaElement.cpp:
3290         (WebCore::HTMLTextAreaElement::formControlType):
3291         * html/HTMLTextFormControlElement.cpp:
3292         (WebCore::directionString):
3293         * html/ImageInputType.cpp:
3294         (WebCore::ImageInputType::appendFormData):
3295         * html/InputTypeNames.cpp:
3296         (WebCore::InputTypeNames::button):
3297         (WebCore::InputTypeNames::checkbox):
3298         (WebCore::InputTypeNames::color):
3299         (WebCore::InputTypeNames::date):
3300         (WebCore::InputTypeNames::datetime):
3301         (WebCore::InputTypeNames::datetimelocal):
3302         (WebCore::InputTypeNames::email):
3303         (WebCore::InputTypeNames::file):
3304         (WebCore::InputTypeNames::hidden):
3305         (WebCore::InputTypeNames::image):
3306         (WebCore::InputTypeNames::month):
3307         (WebCore::InputTypeNames::number):
3308         (WebCore::InputTypeNames::password):
3309         (WebCore::InputTypeNames::radio):
3310         (WebCore::InputTypeNames::range):
3311         (WebCore::InputTypeNames::reset):
3312         (WebCore::InputTypeNames::search):
3313         (WebCore::InputTypeNames::submit):
3314         (WebCore::InputTypeNames::telephone):
3315         (WebCore::InputTypeNames::text):
3316         (WebCore::InputTypeNames::time):
3317         (WebCore::InputTypeNames::url):
3318         (WebCore::InputTypeNames::week):
3319         * html/MediaController.cpp:
3320         (playbackStateWaiting):
3321         (playbackStatePlaying):
3322         (playbackStateEnded):
3323         * html/MonthInputType.cpp:
3324         (WebCore::MonthInputType::createStepRange):
3325         * html/NumberInputType.cpp:
3326         (WebCore::NumberInputType::createStepRange):
3327         * html/RangeInputType.cpp:
3328         (WebCore::RangeInputType::createStepRange):
3329         * html/StepRange.cpp:
3330         (WebCore::StepRange::acceptableError):
3331         (WebCore::StepRange::alignValueForStep):
3332         (WebCore::StepRange::stepMismatch):
3333         * html/TimeInputType.cpp:
3334         (WebCore::TimeInputType::createStepRange):
3335         * html/WeekInputType.cpp:
3336         (WebCore::WeekInputType::createStepRange):
3337         * html/canvas/CanvasRenderingContext2D.cpp:
3338         (WebCore::CanvasRenderingContext2D::getImageData):
3339         * html/parser/XSSAuditor.cpp:
3340         (WebCore::XSSAuditor::init):
3341         (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected):
3342         * html/shadow/MediaControlElements.cpp:
3343         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
3344         (WebCore::getMediaControlTimeRemainingDisplayElementShadowPseudoId):
3345         (WebCore::getMediaControlCurrentTimeDisplayElementShadowPseudoId):
3346         * html/shadow/MeterShadowElement.cpp:
3347         (WebCore::MeterInnerElement::MeterInnerElement):
3348         (WebCore::MeterValueElement::valuePseudoId):
3349         * html/shadow/MeterShadowElement.h:
3350         * html/shadow/SliderThumbElement.cpp:
3351         (WebCore::sliderThumbShadowPseudoId):
3352         (WebCore::mediaSliderThumbShadowPseudoId):
3353         (WebCore::SliderContainerElement::shadowPseudoId):
3354         * html/track/AudioTrack.cpp:
3355         (WebCore::AudioTrack::alternativeKeyword):
3356         (WebCore::AudioTrack::descriptionKeyword):
3357         (WebCore::AudioTrack::mainKeyword):
3358         (WebCore::AudioTrack::mainDescKeyword):
3359         (WebCore::AudioTrack::translationKeyword):
3360         (WebCore::AudioTrack::commentaryKeyword):
3361         * html/track/TextTrack.cpp:
3362         (WebCore::TextTrack::subtitlesKeyword):
3363         (WebCore::TextTrack::captionsKeyword):
3364         (WebCore::TextTrack::descriptionsKeyword):
3365         (WebCore::TextTrack::chaptersKeyword):
3366         (WebCore::TextTrack::metadataKeyword):
3367         (WebCore::TextTrack::forcedKeyword):
3368         (WebCore::TextTrack::disabledKeyword):
3369         (WebCore::TextTrack::hiddenKeyword):
3370         (WebCore::TextTrack::showingKeyword):
3371         * html/track/TextTrackCue.h:
3372         (WebCore::TextTrackCue::cueShadowPseudoId):
3373         * html/track/VTTCue.cpp:
3374         (WebCore::startKeyword):
3375         (WebCore::middleKeyword):
3376         (WebCore::endKeyword):
3377         (WebCore::leftKeyword):
3378         (WebCore::rightKeyword):
3379         (WebCore::verticalGrowingLeftKeyword):
3380         (WebCore::verticalGrowingRightKeyword):
3381         (WebCore::VTTCueBox::vttCueBoxShadowPseudoId):
3382         (WebCore::VTTCue::cueBackdropShadowPseudoId):
3383         (WebCore::VTTCue::determineTextDirection):
3384         (WebCore::VTTCue::markFutureAndPastNodes):
3385         * html/track/VTTRegion.cpp:
3386         (WebCore::VTTRegion::scroll):
3387         (WebCore::VTTRegion::setScroll):
3388         (WebCore::VTTRegion::parseSettingValue):
3389         (WebCore::VTTRegion::textTrackCueContainerScrollingClass):
3390         * html/track/VideoTrack.cpp:
3391         (WebCore::VideoTrack::alternativeKeyword):
3392         (WebCore::VideoTrack::captionsKeyword):
3393         (WebCore::VideoTrack::mainKeyword):
3394         (WebCore::VideoTrack::signKeyword):
3395         (WebCore::VideoTrack::subtitlesKeyword):
3396         (WebCore::VideoTrack::commentaryKeyword):
3397         * html/track/WebVTTElement.cpp:
3398         (WebCore::nodeTypeToTagName):
3399         * html/track/WebVTTElement.h:
3400         * html/track/WebVTTParser.cpp:
3401         (WebCore::WebVTTParser::collectMetadataHeader):
3402         * inspector/InspectorCSSAgent.cpp:
3403         (WebCore::computePseudoClassMask):
3404         * inspector/InspectorPageAgent.cpp:
3405         (WebCore::InspectorPageAgent::sourceMapURLForResource):
3406         * inspector/InspectorStyleSheet.cpp:
3407         (WebCore::selectorsFromSource):
3408         * inspector/PageDebuggerAgent.cpp:
3409         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
3410         * loader/ImageLoader.cpp:
3411         (WebCore::ImageLoader::notifyFinished):
3412         * loader/TextTrackLoader.cpp:
3413         (WebCore::TextTrackLoader::corsPolicyPreventedLoad):
3414         * loader/cache/CachedResourceRequest.cpp:
3415         (WebCore::CachedResourceRequest::initiatorName):
3416         * loader/icon/IconDatabase.cpp:
3417         (WebCore::IconDatabase::defaultDatabaseFilename):
3418         * page/CaptionUserPreferences.cpp:
3419         (WebCore::CaptionUserPreferences::updateCaptionStyleSheetOveride):
3420         * page/CaptionUserPreferencesMediaAF.cpp:
3421         (WebCore::CaptionUserPreferencesMediaAF::captionsBackgroundCSS):
3422         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS):
3423         * page/ContentSecurityPolicy.cpp:
3424         (WebCore::CSPDirectiveList::allowJavaScriptURLs):
3425         (WebCore::CSPDirectiveList::allowInlineEventHandlers):
3426         (WebCore::CSPDirectiveList::allowInlineScript):
3427         (WebCore::CSPDirectiveList::allowInlineStyle):
3428         (WebCore::CSPDirectiveList::allowEval):
3429         (WebCore::ContentSecurityPolicy::reportUnsupportedDirective):
3430         * page/DOMWindow.cpp:
3431         (WebCore::windowsWithUnloadEventListeners):
3432         (WebCore::windowsWithBeforeUnloadEventListeners):
3433         * page/EventHandler.cpp:
3434         (WebCore::EventHandler::dragState):
3435         (WebCore::focusDirectionForKey):
3436         * page/Frame.cpp:
3437         (WebCore::createRegExpForLabels):
3438         * page/NavigatorBase.cpp:
3439         (WebCore::NavigatorBase::platform):
3440         * page/PageVisibilityState.cpp:
3441         (WebCore::pageVisibilityStateString):
3442         * page/SecurityPolicy.cpp:
3443         (WebCore::originAccessMap):
3444         * page/UserContentURLPattern.cpp:
3445         (WebCore::UserContentURLPattern::parse):
3446         * page/animation/CSSPropertyAnimation.cpp:
3447         (WebCore::shadowForBlending):
3448         * page/animation/CompositeAnimation.cpp:
3449         (WebCore::CompositeAnimation::updateKeyframeAnimations):
3450         * platform/Cursor.cpp:
3451         (WebCore::pointerCursor):
3452         (WebCore::crossCursor):
3453         (WebCore::handCursor):
3454         (WebCore::moveCursor):
3455         (WebCore::verticalTextCursor):
3456         (WebCore::cellCursor):
3457         (WebCore::contextMenuCursor):
3458         (WebCore::aliasCursor):
3459         (WebCore::zoomInCursor):
3460         (WebCore::zoomOutCursor):
3461         (WebCore::copyCursor):
3462         (WebCore::noneCursor):
3463         (WebCore::progressCursor):
3464         (WebCore::noDropCursor):
3465         (WebCore::notAllowedCursor):
3466         (WebCore::iBeamCursor):
3467         (WebCore::waitCursor):
3468         (WebCore::helpCursor):
3469         (WebCore::eastResizeCursor):
3470         (WebCore::northResizeCursor):
3471         (WebCore::northEastResizeCursor):
3472         (WebCore::northWestResizeCursor):
3473         (WebCore::southResizeCursor):
3474         (WebCore::southEastResizeCursor):
3475         (WebCore::southWestResizeCursor):
3476         (WebCore::westResizeCursor):
3477         (WebCore::northSouthResizeCursor):
3478         (WebCore::eastWestResizeCursor):
3479         (WebCore::northEastSouthWestResizeCursor):
3480         (WebCore::northWestSouthEastResizeCursor):
3481         (WebCore::columnResizeCursor):
3482         (WebCore::rowResizeCursor):
3483         (WebCore::middlePanningCursor):
3484         (WebCore::eastPanningCursor):
3485         (WebCore::northPanningCursor):
3486         (WebCore::northEastPanningCursor):
3487         (WebCore::northWestPanningCursor):
3488         (WebCore::southPanningCursor):
3489         (WebCore::southEastPanningCursor):
3490         (WebCore::southWestPanningCursor):
3491         (WebCore::westPanningCursor):
3492         (WebCore::grabCursor):
3493         (WebCore::grabbingCursor):
3494         * platform/Language.cpp:
3495         (WebCore::preferredLanguagesOverride):
3496         * platform/LocalizedStrings.cpp:
3497         (WebCore::truncatedStringForLookupMenuItem):
3498         * platform/MIMETypeRegistry.cpp:
3499         (WebCore::mediaMIMETypeMap):
3500         (WebCore::defaultMIMEType):
3501         * platform/SchemeRegistry.cpp:
3502         (WebCore::localURLSchemes):
3503         (WebCore::displayIsolatedURLSchemes):
3504         (WebCore::secureSchemes):
3505         (WebCore::schemesWithUniqueOrigins):
3506         (WebCore::emptyDocumentSchemes):
3507         (WebCore::schemesForbiddenFromDomainRelaxation):
3508         (WebCore::canDisplayOnlyIfCanRequestSchemes):
3509         (WebCore::notAllowingJavascriptURLsSchemes):
3510         (WebCore::schemesAllowingLocalStorageAccessInPrivateBrowsing):
3511         (WebCore::schemesAllowingDatabaseAccessInPrivateBrowsing):
3512         (WebCore::CORSEnabledSchemes):
3513         (WebCore::ContentSecurityPolicyBypassingSchemes):
3514         * platform/ScrollbarTheme.cpp:
3515         (WebCore::ScrollbarTheme::theme):
3516         * platform/URL.cpp:
3517         (WebCore::blankURL):
3518         * platform/animation/Animation.cpp:
3519         (WebCore::Animation::initialName):
3520         * platform/audio/AudioSession.cpp:
3521         (WebCore::AudioSession::sharedSession):
3522         * platform/audio/AudioSession.h:
3523         * platform/audio/HRTFElevation.cpp:
3524         (WebCore::getConcatenatedImpulseResponsesForSubject):
3525         * platform/audio/ios/AudioDestinationIOS.cpp:
3526         (WebCore::audioDestinations):
3527         * platform/graphics/GraphicsLayer.cpp:
3528         (WebCore::repaintRectMap):
3529         * platform/graphics/ImageBuffer.cpp:
3530         (WebCore::ImageBuffer::transformColorSpace):
3531         * platform/graphics/MediaPlayer.cpp:
3532         (WebCore::applicationOctetStream):
3533         (WebCore::textPlain):
3534         (WebCore::codecs):
3535         * platform/graphics/ShadowBlur.cpp:
3536         (WebCore::ScratchBuffer::singleton):
3537         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3538         (WebCore::playerToPrivateMap):
3539         * platform/graphics/filters/SourceAlpha.cpp:
3540         (WebCore::SourceAlpha::effectName):
3541         * platform/graphics/filters/SourceGraphic.cpp:
3542         (WebCore::SourceGraphic::effectName):
3543         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3544         (WebCore::mimeCommonTypesCache):
3545         (WebCore::mimeModernTypesCache):
3546         * platform/ios/CursorIOS.cpp:
3547         (WebCore::cursor):
3548         * platform/ios/TileControllerMemoryHandlerIOS.cpp:
3549         (WebCore::tileControllerMemoryHandler):
3550         * platform/ios/WebCoreMotionManager.mm:
3551         (+[WebCoreMotionManager sharedManager]):
3552         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
3553         (WebVideoFullscreenModelVideoElement::updateForEventName):
3554         * platform/ios/wak/WKContentObservation.cpp:
3555         (WebThreadGetObservedContentModifiers):
3556         * platform/mac/DragImageMac.mm:
3557         (WebCore::fontFromNSFont):
3558         * platform/mac/ThemeMac.mm:
3559         (WebCore::platformTheme):
3560         * platform/mac/ThreadCheck.mm:
3561         (WebCoreReportThreadViolation):
3562         * platform/mediastream/mac/AVCaptureDeviceManager.h:
3563         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
3564         (WebCore::AVCaptureDeviceManager::singleton):
3565         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3566         (WebCore::RealtimeMediaSourceCenter::platformCenter):
3567         * platform/mock/mediasource/MockBox.cpp:
3568         (WebCore::MockTrackBox::type):
3569         (WebCore::MockInitializationBox::type):
3570         (WebCore::MockSampleBox::type):
3571         * platform/network/HTTPParsers.cpp:
3572         (WebCore::parseXSSProtectionHeader):
3573         * platform/network/ResourceHandle.cpp:
3574         (WebCore::builtinResourceHandleConstructorMap):
3575         (WebCore::builtinResourceHandleSynchronousLoaderMap):
3576         * platform/network/cf/ResourceHandleCFNet.cpp:
3577         (WebCore::allowsAnyHTTPSCertificateHosts):
3578         (WebCore::clientCerts):
3579         * platform/text/AtomicStringKeyedMRUCache.h:
3580         (WebCore::AtomicStringKeyedMRUCache::get):
3581         * platform/text/cf/HyphenationCF.cpp:
3582         (WebCore::cfLocaleCache):
3583         * rendering/RenderBlock.cpp:
3584         (WebCore::continuationOutlineTable):
3585         * rendering/RenderCounter.cpp:
3586         (WebCore::counterMaps):
3587         * rendering/RenderDeprecatedFlexibleBox.cpp:
3588         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
3589         * rendering/RenderLayer.cpp:
3590         (WebCore::RenderLayer::drawPlatformResizerImage):
3591         * rendering/RenderScrollbarTheme.cpp:
3592         (WebCore::RenderScrollbarTheme::renderScrollbarTheme):
3593         * rendering/RenderTheme.cpp:
3594         (WebCore::customFocusRingColor):
3595         * rendering/RenderWidget.cpp:
3596         (WebCore::WidgetHierarchyUpdatesSuspensionScope::widgetNewParentMap):
3597         * rendering/shapes/ShapeOutsideInfo.h:
3598         * rendering/style/RenderStyle.cpp:
3599         (WebCore::RenderStyle::hyphenString):
3600         (WebCore::RenderStyle::textEmphasisMarkString):
3601         (WebCore::RenderStyle::initialDashboardRegions):
3602         (WebCore::RenderStyle::noneDashboardRegions):
3603         * rendering/style/RenderStyle.h:
3604         * rendering/svg/RenderSVGPath.cpp:
3605         (WebCore::RenderSVGPath::zeroLengthLinecapPath):
3606         * rendering/svg/RenderSVGShape.cpp:
3607         (WebCore::RenderSVGShape::nonScalingStrokePath):
3608         * rendering/svg/SVGRenderingContext.cpp:
3609         (WebCore::currentContentTransformation):
3610         * rendering/svg/SVGResources.cpp:
3611         (WebCore::clipperFilterMaskerTags):
3612         (WebCore::markerTags):
3613         (WebCore::fillAndStrokeTags):
3614         (WebCore::chainableResourceTags):
3615         * svg/SVGAngle.cpp:
3616         (WebCore::SVGAngle::valueAsString):
3617         * svg/SVGAnimateColorElement.cpp:
3618         (WebCore::attributeValueIsCurrentColor):
3619         * svg/SVGAnimateMotionElement.cpp:
3620         (WebCore::SVGAnimateMotionElement::rotateMode):
3621         * svg/SVGAnimationElement.cpp:
3622         (WebCore::SVGAnimationElement::setCalcMode):
3623         (WebCore::SVGAnimationElement::setAttributeType):
3624         (WebCore::SVGAnimationElement::isAdditive):
3625         (WebCore::SVGAnimationElement::isAccumulated):
3626         (WebCore::inheritsFromProperty):
3627         * svg/SVGFEConvolveMatrixElement.cpp:
3628         (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier):
3629         (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier):
3630         (WebCore::SVGFEConvolveMatrixElement::orderXIdentifier):
3631         (WebCore::SVGFEConvolveMatrixElement::orderYIdentifier):
3632         * svg/SVGFEDiffuseLightingElement.cpp:
3633         (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier):
3634         (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier):
3635         * svg/SVGFEDropShadowElement.cpp:
3636         (WebCore::SVGFEDropShadowElement::stdDeviationXIdentifier):
3637         (WebCore::SVGFEDropShadowElement::stdDeviationYIdentifier):
3638         * svg/SVGFEGaussianBlurElement.cpp:
3639         (WebCore::SVGFEGaussianBlurElement::stdDeviationXIdentifier):
3640         (WebCore::SVGFEGaussianBlurElement::stdDeviationYIdentifier):
3641         * svg/SVGFEMorphologyElement.cpp:
3642         (WebCore::SVGFEMorphologyElement::radiusXIdentifier):
3643         (WebCore::SVGFEMorphologyElement::radiusYIdentifier):
3644         * svg/SVGFESpecularLightingElement.cpp:
3645         (WebCore::SVGFESpecularLightingElement::kernelUnitLengthXIdentifier):
3646         (WebCore::SVGFESpecularLightingElement::kernelUnitLengthYIdentifier):
3647         * svg/SVGFETurbulenceElement.cpp:
3648         (WebCore::SVGFETurbulenceElement::baseFrequencyXIdentifier):
3649         (WebCore::SVGFETurbulenceElement::baseFrequencyYIdentifier):
3650         * svg/SVGFilterElement.cpp:
3651         (WebCore::SVGFilterElement::filterResXIdentifier):
3652         (WebCore::SVGFilterElement::filterResYIdentifier):
3653         * svg/SVGGlyphMap.h:
3654         (WebCore::SVGGlyphMap::svgGlyphForGlyph):
3655         * svg/SVGLangSpace.cpp:
3656         (WebCore::SVGLangSpace::xmlspace):
3657         (WebCore::SVGLangSpace::addSupportedAttributes):
3658         * svg/SVGMarkerElement.cpp:
3659         (WebCore::SVGMarkerElement::orientTypeIdentifier):
3660         (WebCore::SVGMarkerElement::orientAngleIdentifier):
3661         (WebCore::SVGMarkerElement::synchronizeOrientType):
3662         * svg/SVGStyleElement.cpp:
3663         (WebCore::SVGStyleElement::type):
3664         (WebCore::SVGStyleElement::media):
3665         * svg/SVGTransform.cpp:
3666         (WebCore::SVGTransform::transformTypePrefixForParsing):
3667         * svg/SVGViewSpec.cpp:
3668         (WebCore::SVGViewSpec::viewBoxIdentifier):
3669         (WebCore::SVGViewSpec::preserveAspectRatioIdentifier):
3670         (WebCore::SVGViewSpec::transformIdentifier):
3671         * svg/animation/SVGSMILElement.cpp:
3672         (WebCore::SVGSMILElement::parseClockValue):
3673         (WebCore::SVGSMILElement::isSupportedAttribute):
3674         (WebCore::SVGSMILElement::restart):
3675         (WebCore::SVGSMILElement::fill):
3676         (WebCore::SVGSMILElement::repeatCount):
3677         (WebCore::SVGSMILElement::notifyDependentsIntervalChanged):
3678
3679 2016-01-08  Zalan Bujtas  <zalan@apple.com>
3680
3681         Absolute positioning -webkit-search-cancel-button crashes Safari.
3682         https://bugs.webkit.org/show_bug.cgi?id=152847
3683         <rdar://problem/24112087>
3684
3685         Reviewed by Simon Fraser.
3686
3687         Do not call offsetFromContainer while resolving the painting position for the search/cancel button renderer.
3688         It skips the static positioned parent input renderer, when the search/cancel renderer is absolute positioned.
3689         This patch also fixes a rendering glitch when the margin-right is > 0.
3690
3691         Test: fast/forms/absolute-positioned-custom-search-cancel-crash.html
3692
3693         * rendering/RenderTheme.h:
3694         (WebCore::RenderTheme::paintSearchFieldCancelButton):
3695         (WebCore::RenderTheme::paintSearchFieldResultsDecorationPart):
3696         (WebCore::RenderTheme::paintSearchFieldResultsButton):
3697         * rendering/RenderThemeMac.h:
3698         * rendering/RenderThemeMac.mm:
3699         (WebCore::convertToPaintingPosition):
3700         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
3701         (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
3702         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
3703         (WebCore::RenderThemeMac::convertToPaintingRect): Deleted.
3704
3705 2016-01-08  Simon Fraser  <simon.fraser@apple.com>
3706
3707         Add display-list drawing hooks to platform-specific GraphicsContext files
3708         https://bugs.webkit.org/show_bug.cgi?id=152940
3709
3710         Reviewed by Zalan Bujtas.
3711
3712         Call into the display list recorder for top-level entrypoints implemented in platform-specific
3713         files.
3714         
3715         The convention is that if a function begins with "platform", it's not a top-level
3716         entry point, and should only be called when there's a platform context (i.e. not
3717         recording, and not paintingDisabled).
3718         
3719         A few instances are stubbed out until we have a more complete display list implementation.
3720
3721         * platform/graphics/GraphicsContext.cpp:
3722         (WebCore::GraphicsContext::drawText):
3723         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3724         (WebCore::GraphicsContext::getCTM):
3725         (WebCore::GraphicsContext::savePlatformState):
3726         (WebCore::GraphicsContext::restorePlatformState):
3727         (WebCore::GraphicsContext::drawRect):
3728         (WebCore::GraphicsContext::drawNativeImage):
3729         (WebCore::GraphicsContext::drawLine):
3730         (WebCore::GraphicsContext::drawEllipse):
3731         (WebCore::GraphicsContext::drawConvexPolygon):
3732         (WebCore::GraphicsContext::clipConvexPolygon):
3733         (WebCore::GraphicsContext::fillPath):
3734         (WebCore::GraphicsContext::strokePath):
3735         (WebCore::GraphicsContext::fillRect):
3736         (WebCore::GraphicsContext::clip):
3737         (WebCore::GraphicsContext::clipPath):
3738         (WebCore::GraphicsContext::clipBounds):
3739         (WebCore::GraphicsContext::drawLinesForText):
3740         (WebCore::GraphicsContext::roundToDevicePixels):
3741         (WebCore::GraphicsContext::translate):
3742         (WebCore::GraphicsContext::setPlatformStrokeThickness):
3743         (WebCore::GraphicsContext::setPlatformStrokeStyle):
3744         (WebCore::GraphicsContext::concatCTM):
3745         (WebCore::GraphicsContext::setCTM):
3746         (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
3747         (WebCore::GraphicsContext::endPlatformTransparencyLayer):
3748         (WebCore::GraphicsContext::clearRect):
3749         (WebCore::GraphicsContext::strokeRect):
3750         (WebCore::GraphicsContext::setLineCap):
3751         (WebCore::GraphicsContext::setLineDash):
3752         (WebCore::GraphicsContext::setLineJoin):
3753         (WebCore::GraphicsContext::clipOut):
3754         (WebCore::GraphicsContext::rotate):
3755         (WebCore::GraphicsContext::scale):
3756         (WebCore::GraphicsContext::platformFillRoundedRect):
3757         (WebCore::GraphicsContext::fillRectWithRoundedHole):
3758         (WebCore::GraphicsContext::drawPattern):
3759         (WebCore::GraphicsContext::setPlatformShouldAntialias):
3760         (WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
3761         (WebCore::GraphicsContext::isAcceleratedContext):
3762         * platform/graphics/cg/GraphicsContextCG.cpp:
3763         (WebCore::GraphicsContext::savePlatformState):
3764         (WebCore::GraphicsContext::restorePlatformState):
3765         (WebCore::GraphicsContext::drawNativeImage):
3766         (WebCore::GraphicsContext::drawPattern):
3767         (WebCore::GraphicsContext::drawRect):
3768         (WebCore::GraphicsContext::drawLine):
3769         (WebCore::GraphicsContext::drawEllipse):
3770         (WebCore::GraphicsContext::drawConvexPolygon):
3771         (WebCore::GraphicsContext::clipConvexPolygon):
3772         (WebCore::GraphicsContext::applyStrokePattern):
3773         (WebCore::GraphicsContext::applyFillPattern):
3774         (WebCore::GraphicsContext::drawPath):
3775         (WebCore::GraphicsContext::fillPath):
3776         (WebCore::GraphicsContext::strokePath):
3777         (WebCore::GraphicsContext::fillRect):
3778         (WebCore::GraphicsContext::platformFillRoundedRect):
3779         (WebCore::GraphicsContext::fillRectWithRoundedHole):
3780         (WebCore::GraphicsContext::clip):
3781         (WebCore::GraphicsContext::clipOut):
3782         (WebCore::GraphicsContext::clipPath):
3783         (WebCore::GraphicsContext::clipBounds):
3784         (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
3785         (WebCore::GraphicsContext::endPlatformTransparencyLayer):
3786         (WebCore::GraphicsContext::setPlatformShadow):
3787         (WebCore::GraphicsContext::setMiterLimit):
3788         (WebCore::GraphicsContext::clearRect):
3789         (WebCore::GraphicsContext::strokeRect):
3790         (WebCore::GraphicsContext::setLineCap):
3791         (WebCore::GraphicsContext::setLineDash):
3792         (WebCore::GraphicsContext::setLineJoin):
3793         (WebCore::GraphicsContext::scale):
3794         (WebCore::GraphicsContext::rotate):
3795         (WebCore::GraphicsContext::translate):
3796         (WebCore::GraphicsContext::concatCTM):
3797         (WebCore::GraphicsContext::setCTM):
3798         (WebCore::GraphicsContext::getCTM):
3799         (WebCore::GraphicsContext::roundToDevicePixels):
3800         (WebCore::GraphicsContext::drawLinesForText):
3801         (WebCore::GraphicsContext::setURLForRect):
3802         (WebCore::GraphicsContext::setIsCALayerContext):
3803         (WebCore::GraphicsContext::isCALayerContext):
3804         (WebCore::GraphicsContext::setIsAcceleratedContext):
3805         (WebCore::GraphicsContext::isAcceleratedContext):
3806         (WebCore::GraphicsContext::setPlatformTextDrawingMode):
3807         (WebCore::GraphicsContext::setPlatformStrokeColor):
3808         (WebCore::GraphicsContext::setPlatformStrokeThickness):
3809         (WebCore::GraphicsContext::setPlatformFillColor):
3810         (WebCore::GraphicsContext::setPlatformShouldAntialias):
3811         (WebCore::GraphicsContext::setPlatformShouldSmoothFonts):
3812         (WebCore::GraphicsContext::setPlatformAlpha):
3813         (WebCore::GraphicsContext::setPlatformCompositeOperation):
3814         (WebCore::GraphicsContext::platformApplyDeviceScaleFactor):
3815         (WebCore::GraphicsContext::platformFillEllipse):
3816         (WebCore::GraphicsContext::platformStrokeEllipse):
3817
3818 2016-01-08  Simon Fraser  <simon.fraser@apple.com>
3819
3820         Add DisplayList hooks into GraphicsContext
3821         https://bugs.webkit.org/show_bug.cgi?id=152932
3822
3823         Reviewed by Zalan Bujtas.
3824
3825         Add the hooks into GraphicsContext that call into the DisplayListRecorder if there
3826         is one.
3827         
3828         Rename size() to something less ambiguous.
3829         
3830         Out-of-line some DisplayList functions so that the header doesn't need to see
3831         DisplayListItems.h.
3832
3833         * platform/graphics/GraphicsContext.cpp:
3834         (WebCore::GraphicsContext::save):
3835         (WebCore::GraphicsContext::restore):
3836         (WebCore::GraphicsContext::setStrokeThickness):
3837         (WebCore::GraphicsContext::setStrokeStyle):
3838         (WebCore::GraphicsContext::setStrokeColor):
3839         (WebCore::GraphicsContext::setShadow):
3840         (WebCore::GraphicsContext::setLegacyShadow):
3841         (WebCore::GraphicsContext::clearShadow):
3842         (WebCore::GraphicsContext::setFillColor):
3843         (WebCore::GraphicsContext::setShadowsIgnoreTransforms):
3844         (WebCore::GraphicsContext::setShouldAntialias):
3845         (WebCore::GraphicsContext::setShouldSmoothFonts):
3846         (WebCore::GraphicsContext::setShouldSubpixelQuantizeFonts):
3847         (WebCore::GraphicsContext::setImageInterpolationQuality):
3848         (WebCore::GraphicsContext::setAntialiasedFontDilationEnabled):
3849         (WebCore::GraphicsContext::setStrokePattern):
3850         (WebCore::GraphicsContext::setFillPattern):
3851         (WebCore::GraphicsContext::setStrokeGradient):
3852         (WebCore::GraphicsContext::setFillRule):
3853         (WebCore::GraphicsContext::setFillGradient):
3854         (WebCore::GraphicsContext::beginTransparencyLayer):
3855         (WebCore::GraphicsContext::endTransparencyLayer):
3856         (WebCore::GraphicsContext::drawGlyphs):
3857         (WebCore::GraphicsContext::drawImage):
3858         (WebCore::GraphicsContext::drawTiledImage):
3859         (WebCore::GraphicsContext::setTextDrawingMode):
3860         (WebCore::GraphicsContext::fillRect):
3861         (WebCore::GraphicsContext::fillRoundedRect):
3862         (WebCore::GraphicsContext::setAlpha):
3863         (WebCore::GraphicsContext::setCompositeOperation):
3864         (WebCore::GraphicsContext::setDrawLuminanceMask):
3865         (WebCore::GraphicsContext::applyDeviceScaleFactor):
3866         (WebCore::GraphicsContext::applyState):
3867         * platform/graphics/GraphicsContext.h:
3868         (WebCore::GraphicsContext::setDisplayListRecorder):
3869         (WebCore::GraphicsContext::isRecording):
3870         (WebCore::GraphicsContext::setFillRule): Deleted.
3871         (WebCore::GraphicsContext::setShadowsIgnoreTransforms): Deleted.
3872         (WebCore::GraphicsContext::setShouldSubpixelQuantizeFonts): Deleted.
3873         (WebCore::GraphicsContext::setDrawLuminanceMask): Deleted.
3874         * platform/graphics/displaylists/DisplayList.cpp:
3875         (WebCore::DisplayList::DisplayList::clear):
3876         (WebCore::DisplayList::DisplayList::removeItemsFromIndex):
3877         * platform/graphics/displaylists/DisplayList.h:
3878         (WebCore::DisplayList::DisplayList::itemCount):
3879         (WebCore::DisplayList::DisplayList::clear): Deleted.
3880         (WebCore::DisplayList::DisplayList::size): Deleted.
3881         (WebCore::DisplayList::DisplayList::removeItemsFromIndex): Deleted.
3882         * platform/graphics/displaylists/DisplayListRecorder.cpp:
3883         (WebCore::DisplayList::Recorder::save):
3884         (WebCore::DisplayList::Recorder::restore):
3885         * platform/graphics/displaylists/DisplayListRecorder.h:
3886         (WebCore::DisplayList::Recorder::itemCount):
3887         (WebCore::DisplayList::Recorder::size): Deleted.
3888         * platform/graphics/displaylists/DisplayListReplayer.cpp:
3889         (WebCore::DisplayList::Replayer::replay):
3890
3891 2016-01-08  Brady Eidson  <beidson@apple.com>
3892
3893         Modern IDB: imported/w3c/indexeddb/keyorder.htm times out.
3894         https://bugs.webkit.org/show_bug.cgi?id=152929
3895
3896         Reviewed by Alex Christensen.
3897
3898         No new tests (Existing test now runs in the test harness).
3899
3900         * Modules/indexeddb/client/IDBCursorImpl.cpp:
3901         (WebCore::IDBClient::IDBCursor::setGetResult):
3902
3903 2016-01-08  Simon Fraser  <simon.fraser@apple.com>
3904
3905         Consider painting to be disabled on a GraphicsContext with no platform data, and make updatingControlTints() immutable state
3906         https://bugs.webkit.org/show_bug.cgi?id=152927
3907
3908         Reviewed by Tim Horton.
3909
3910         GraphicsContext had setters for paintingDisabled and updatingControlTints, but neither
3911         were changed dynamically.
3912         
3913         We can eliminate paintingDisabled by simply considering a GraphicsContext that was
3914         created with no platform context to be paint-disabled.
3915         
3916         We make updatingControlTints immutable state by providing a constructor that takes
3917         a "NonPaintingReasons" enum, and doesn't create platform data.
3918         
3919         More functions in platform code were protected by if (paintingDisabled())...
3920
3921         * page/FrameView.cpp:
3922         (WebCore::FrameView::paintControlTints):
3923         * platform/graphics/GraphicsContext.cpp:
3924         (WebCore::GraphicsContext::GraphicsContext):
3925         (WebCore::GraphicsContext::fillRoundedRect):
3926         (WebCore::GraphicsContext::setUpdatingControlTints): Deleted.
3927         (WebCore::GraphicsContext::clip): Deleted.
3928         * platform/graphics/GraphicsContext.h:
3929         (WebCore::GraphicsContext::paintingDisabled):
3930         (WebCore::GraphicsContext::updatingControlTints):
3931         (WebCore::GraphicsContextState::GraphicsContextState): Deleted.
3932         (WebCore::GraphicsContext::setPaintingDisabled): Deleted.
3933         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3934         (WebCore::GraphicsContext::GraphicsContext):
3935         (WebCore::GraphicsContext::platformInit):
3936         * platform/graphics/cg/GraphicsContextCG.cpp:
3937         (WebCore::GraphicsContext::platformInit):
3938         (WebCore::GraphicsContext::savePlatformState):
3939         (WebCore::GraphicsContext::restorePlatformState):
3940         (WebCore::GraphicsContext::drawNativeImage):
3941         (WebCore::GraphicsContext::drawPattern):
3942         (WebCore::GraphicsContext::drawRect):
3943         (WebCore::GraphicsContext::applyStrokePattern):
3944         (WebCore::GraphicsContext::applyFillPattern):
3945         (WebCore::GraphicsContext::clip):
3946         (WebCore::GraphicsContext::clipBounds):
3947         (WebCore::GraphicsContext::setLineDash):
3948         (WebCore::GraphicsContext::roundToDevicePixels):
3949         (WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
3950         (WebCore::GraphicsContext::setIsCALayerContext):
3951         (WebCore::GraphicsContext::isCALayerContext):
3952         (WebCore::GraphicsContext::setIsAcceleratedContext):
3953         (WebCore::GraphicsContext::isAcceleratedContext):
3954         (WebCore::GraphicsContext::platformApplyDeviceScaleFactor):
3955         * platform/graphics/win/GraphicsContextCGWin.cpp:
3956         (WebCore::GraphicsContext::platformInit):
3957         (WebCore::GraphicsContext::GraphicsContext): Deleted.
3958         * platform/graphics/win/GraphicsContextCairoWin.cpp:
3959         (WebCore::GraphicsContext::platformInit):
3960         (WebCore::GraphicsContext::GraphicsContext): Deleted.
3961
3962 2016-01-08  Anders Carlsson  <andersca@apple.com>
3963
3964         InputType::findClosestTickMarkValue should return an Optional<Decimal>
3965         https://bugs.webkit.org/show_bug.cgi?id=152931
3966
3967         Reviewed by Andreas Kling.
3968
3969         This will make it possible to get rid of the notion of infinity from Decimal, allowing for more code simplification.
3970
3971         * html/HTMLInputElement.cpp:
3972         (WebCore::HTMLInputElement::findClosestTickMarkValue):
3973         * html/HTMLInputElement.h:
3974         * html/InputType.cpp:
3975         (WebCore::InputType::findClosestTickMarkValue):
3976         * html/InputType.h:
3977         * html/RangeInputType.cpp:
3978         (WebCore::RangeInputType::findClosestTickMarkValue):
3979         * html/RangeInputType.h:
3980         * html/shadow/SliderThumbElement.cpp:
3981         (WebCore::SliderThumbElement::setPositionFromPoint):
3982
3983 2016-01-08  Brady Eidson  <beidson@apple.com>
3984
3985         Modern IDB: IDBBindingUtilities chokes on unicode strings for get/set.
3986         https://bugs.webkit.org/show_bug.cgi?id=152921
3987
3988         Reviewed by Alex Christensen.
3989
3990         No new tests (Covered by existing tests).
3991
3992         * bindings/js/IDBBindingUtilities.cpp:
3993         (WebCore::get): Don't do a potentially lossy utf8() conversion on the string.
3994         (WebCore::set): Ditto.
3995
3996 2016-01-08  Per Arne Vollan  <peavo@outlook.com>
3997
3998         [WinCairo] Support more video formats.
3999         https://bugs.webkit.org/show_bug.cgi?id=152890
4000
4001         Reviewed by Alex Christensen.
4002
4003         Use MediaFoundation api to detect all supported video/audio formats.
4004
4005         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
4006         (WebCore::MediaPlayerPrivateMediaFoundation::getSupportedTypes):
4007         (WebCore::MediaPlayerPrivateMediaFoundation::supportsType):
4008
4009 2016-01-08  Brady Eidson  <beidson@apple.com>
4010
4011         Modern IDB: Blocked event can fire on a delete request even after the last open connection has closed.
4012         https://bugs.webkit.org/show_bug.cgi?id=152896
4013
4014         Reviewed by Alex Christensen.
4015
4016         No new tests (Progression in many tests).
4017
4018         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
4019         (WebCore::IDBClient::IDBFactory::deleteDatabase):
4020         
4021         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
4022         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation): Allow for handling 2+ delete operations in a row.
4023         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore): Ditto.
4024         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient): Call "notifyCurrentRequestConnectionClosedOrFiredVersionChangeEvent"
4025           after the connection is actually removed from the set of open connections.
4026         * Modules/indexeddb/server/UniqueIDBDatabase.h:
4027
4028 2016-01-08  Zalan Bujtas  <zalan@apple.com>
4029
4030         Hovering link on http://help.apple.com/appletv/#/ does not show text underline.
4031         https://bugs.webkit.org/show_bug.cgi?id=152906
4032         <rdar://problem/23339617>
4033
4034         Reviewed by Simon Fraser.
4035
4036         GraphicsContext::computeLineBoundsAndAntialiasingModeForText() always integral ceils the origin y position to offset underline text.
4037         This additional visual overflow offset is not taken into account by visualOverflowForDecorations().
4038         Unfortunately we can't compute the exact same offset value while collecting repaint rects, because
4039         computeLineBoundsAndAntialiasingModeForText() uses CTM scaling before adjusting the offset position.
4040         Use 1px (css) bottom offset to cover this underling overflow.
4041
4042         Test: fast/css3-text/css3-text-decoration/text-underline-position/underline-visual-overflow-with-subpixel-position.html
4043
4044         * platform/graphics/GraphicsContext.cpp:
4045         (WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
4046         * rendering/SimpleLineLayoutResolver.cpp: Add visual overflow to simple line layout.
4047         (WebCore::SimpleLineLayout::RunResolver::Run::rect):
4048         (WebCore::SimpleLineLayout::RunResolver::RunResolver):
4049         * rendering/SimpleLineLayoutResolver.h:
4050         * style/InlineTextBoxStyle.cpp:
4051         (WebCore::visualOverflowForDecorations):
4052
4053 2016-01-08  Brady Eidson  <beidson@apple.com>
4054
4055         Modern IDB: imported/w3c/indexeddb/idbobjectstore_createIndex6-event_order.htm fails.
4056         https://bugs.webkit.org/show_bug.cgi?id=152891
4057
4058         Reviewed by Alex Christensen.
4059
4060         No new tests (At least two failing tests now pass).
4061
4062         * Modules/indexeddb/client/IDBRequestImpl.cpp:
4063         (WebCore::IDBClient::IDBRequest::dispatchEvent): Whenever we add the IDBTransaction as an event target,
4064           also add the IDBDatabase.
4065
4066 2016-01-07  Antti Koivisto  <antti@apple.com>
4067
4068         Enable selector filtering for shadow trees
4069         https://bugs.webkit.org/show_bug.cgi?id=152831
4070
4071         Reviewed by Simon Fraser.
4072
4073         Selector filtering doesn't currently work in shadow trees making style resolve for them slow.
4074         This is because SelectorFilter is not in "consistent" state.
4075
4076         This patch moves SelectorFilter ownership from StyleResolver to TreeResolver and guarantees
4077         it is always upadated consistently. It eliminates a bunch of now unnecessary consistency checks
4078         and special cases.
4079
4080         * css/ElementRuleCollector.cpp:
4081         (WebCore::ElementRuleCollector::ElementRuleCollector):
4082
4083             Assert for consistency instead of testing for it.
4084
4085         (WebCore::ElementRuleCollector::matchedResult):
4086         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
4087
4088             Selector filter can now be used if it exists.
4089
4090         * css/ElementRuleCollector.h:
4091         (WebCore::ElementRuleCollector::ElementRuleCollector): Deleted.
4092         * css/RuleSet.cpp:
4093         (WebCore::RuleSet::addRule):
4094
4095             Disable selector filtering for custom shadow pseudo rules. They are resolved by shadow DOM resolver
4096             but may contain components matching the normal DOM.
4097
4098         * css/RuleSet.h:
4099         (WebCore::RuleData::descendantSelectorIdentifierHashes):
4100         (WebCore::RuleData::disableSelectorFiltering):
4101         (WebCore::RuleData::compilationStatus):
4102         (WebCore::RuleData::compiledSelectorCodeRef):
4103         * css/SelectorFilter.cpp:
4104         (WebCore::collectElementIdentifierHashes):
4105         (WebCore::SelectorFilter::parentStackIsConsistent):
4106
4107             New consistency conditions. This is now used for asserts only.
4108
4109         (WebCore::SelectorFilter::pushParentStackFrame):
4110         (WebCore::SelectorFilter::popParentStackFrame):
4111
4112             Selector filter only filters the current tree context, replace parentOrShadowHostElement with parentElement.
4113