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