3bc49d9cc4c2df776f03e5ef14ded4e1ca1fc1e2
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-01-19  Brian J. Burg  <burg@cs.washington.edu>
2
3         Web Replay: convert to is<T> and downcast<T> for decoding replay inputs
4         https://bugs.webkit.org/show_bug.cgi?id=140512
5
6         Reviewed by Chris Dumez.
7
8         No new tests, no behavior changed.
9
10         * replay/EventLoopInput.h: Make overridden methods public.
11         * replay/MemoizedDOMResult.h: Add type trait specialization here. It is
12         special-cased because the input type parameter doesn't work with macros.
13         * replay/SerializationMethods.cpp:
14         (JSC::EncodingTraits<NondeterministicInputBase>::encodeValue):
15         Use is() and downcast() when dispatching to encoders based on type.
16
17 2015-01-19  Zan Dobersek  <zdobersek@igalia.com>
18
19         Replace use of WTF::bind() in MemoryPressureHandlerLinux.cpp with a C++ lambda
20         https://bugs.webkit.org/show_bug.cgi?id=140614
21
22         Reviewed by Carlos Garcia Campos.
23
24         Use a C++ lambda instead of WTF::bind() in the MemoryPressureHandler
25         implementation for Linux.
26
27         * platform/linux/MemoryPressureHandlerLinux.cpp:
28         (WebCore::MemoryPressureHandler::waitForMemoryPressureEvent):
29
30 2015-01-19  Zan Dobersek  <zdobersek@igalia.com>
31
32         Replace uses of WTF::bind() in MockMediaPlayerMediaSource with C++ lambdas
33         https://bugs.webkit.org/show_bug.cgi?id=140612
34
35         Reviewed by Philippe Normand.
36
37         Use C++ lambdas in place of WTF::bind() in the MockMediaPlayerMediaSource class.
38
39         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
40         (WebCore::MockMediaPlayerMediaSource::play):
41         (WebCore::MockMediaPlayerMediaSource::seekWithTolerance):
42         (WebCore::MockMediaPlayerMediaSource::seekCompleted):
43
44 2015-01-19  Commit Queue  <commit-queue@webkit.org>
45
46         Unreviewed, rolling out r178653.
47         https://bugs.webkit.org/show_bug.cgi?id=140634
48
49         Broke multiple SVG tests on Mountain Lion (Requested by ap on
50         #webkit).
51
52         Reverted changeset:
53
54         "[SVG -> OTF Converter] Flip the switch on"
55         https://bugs.webkit.org/show_bug.cgi?id=140592
56         http://trac.webkit.org/changeset/178653
57
58 2015-01-19  Brent Fulgham  <bfulgham@apple.com>
59
60         Layers need to be already updated before we call adjustViewSize
61         https://bugs.webkit.org/show_bug.cgi?id=135514
62
63         Reviewed by Simon Fraser.
64
65         Tested by 'fast/dynamic/layer-no-longer-paginated.html'
66
67         Defer painting operations until we have finished layout. This
68         has a couple of benefits:
69         (1) We do not attempt to modify render layers during layout.
70         (2) In WK1 we do not attempt to paint during layout.
71
72         Add a new virtual predicate to ScrollView indicating when we are in
73         layout so that calls to setContentsSize do not attempt
74         to adjust scrollbars.
75
76         Modify FrameView to set its ScrollView state to block paint
77         operations during layout. Also add a post-layout handler to
78         complete the scrollbar updates after layout is finished.
79
80         * WebCore.exp.in: Move linker symbol to ScrollView (from FrameView).
81         * page/FrameView.cpp:
82         (WebCore::FrameView::layout):
83         (WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange): Added.
84         (WebCore::FrameView::scrollPositionChangedViaPlatformWidget): Removed (Renamed).
85         (WebCore::FrameView::scrollPositionChangedViaPlatformWidgetImpl): Added (Renamed)
86         (WebCore::FrameView::paintContents): Do not paint if we are inside view size adjustment.
87         * page/FrameView.h:
88         * platform/ScrollView.cpp:
89         (WebCore::ScrollView::scrollPositionChangedViaPlatformWidget): Added. Checks whether we need to defer
90         painting, and calls virtual scrollPositionChangedViaPlatformWidgetImpl if we do not.
91         (WebCore::FrameView::scrollPositionChangedViaPlatformWidgetImpl): Added.
92         (WebCore::ScrollView::handleDeferredScrollUpdateAfterContentSizeChange): Added.
93         (WebCore::ScrollView::scrollTo): If we should defer painting, cache the
94         the scroll delta and apply it after the layout is complete.
95         (WebCore::ScrollView::completeUpdatesAfterScrollTo): Split off part of 'scrollTo' into its own method
96         so we can reuse it in handleDeferredScrollUpdateAfterContentSizeChange.
97         * platform/ScrollView.h:
98         (WebCore::ScrollView::shouldDeferScrollUpdateAfterContentSizeChange): Added.
99
100 2015-01-16  Ada Chan  <adachan@apple.com>
101
102         HTMLMediaElement::isPlayingAudio() should return false if the element is explicitly muted by script.
103         https://bugs.webkit.org/show_bug.cgi?id=140524
104
105         Reviewed by Andreas Kling.
106
107         Test: media/muted-video-is-playing-audio.html
108
109         * html/HTMLMediaElement.cpp:
110         (WebCore::HTMLMediaElement::setMuted):
111         Call Document::updateIsPlayingAudio() to recalculate the overall audio playing state.
112         (WebCore::HTMLMediaElement::isPlayingAudio):
113         HTMLMediaElement::isPlayingAudio() should return false if the media element is explicitly muted.
114
115 2015-01-19  Myles C. Maxfield  <mmaxfield@apple.com>
116
117         [SVG -> OTF Converter] Flip the switch on
118         https://bugs.webkit.org/show_bug.cgi?id=140592
119
120         Reviewed by Antti Koivisto.
121
122         * Configurations/FeatureDefines.xcconfig:
123
124 2015-01-16  Alexey Proskuryakov  <ap@apple.com>
125
126         Console log sometimes prefixed with line number
127         https://bugs.webkit.org/show_bug.cgi?id=105280
128
129         Reviewed by Darin Adler.
130
131         Improve the logic for determining whether a console message should be associated
132         with a source code location.
133
134         * dom/ScriptableDocumentParser.h:
135         * html/parser/HTMLDocumentParser.cpp:
136         (WebCore::HTMLDocumentParser::shouldAssociateConsoleMessagesWithTextPosition):
137         * html/parser/HTMLDocumentParser.h:
138         * page/PageConsoleClient.cpp:
139         (WebCore::getParserLocationForConsoleMessage):
140         (WebCore::PageConsoleClient::addMessage):
141         * xml/parser/XMLDocumentParser.cpp:
142         (WebCore::XMLDocumentParser::pauseParsing):
143         * xml/parser/XMLDocumentParser.h:
144         * xml/parser/XMLDocumentParserLibxml2.cpp:
145         (WebCore::XMLDocumentParser::shouldAssociateConsoleMessagesWithTextPosition):
146
147 2015-01-19  Myles C. Maxfield  <mmaxfield@apple.com>
148
149         [SVG -> OTF Converter] Glyphs get clipped weirdly
150         https://bugs.webkit.org/show_bug.cgi?id=137095
151
152         Reviewed by Antti Koivisto.
153
154         The Adobe CFF spec doesn't actually tell you how to serialize a
155         "FontBBox." After trial and error, it seems to be (x, y, width,
156         height).
157
158         Test: svg/text/kerning.svg
159               svg/W3C-SVG-1.1/fonts-kern-01-t.svg
160
161         * svg/SVGToOTFFontConversion.cpp:
162         (WebCore::SVGToOTFFontConverter::appendHEADTable):
163         (WebCore::SVGToOTFFontConverter::appendCFFTable):
164         (WebCore::SVGToOTFFontConverter::appendVHEATable):
165         (WebCore::CFFBuilder::CFFBuilder):
166         (WebCore::SVGToOTFFontConverter::transcodeGlyphPaths):
167         (WebCore::SVGToOTFFontConverter::processGlyphElement):
168
169 2015-01-19  Csaba Osztrogonác  <ossy@webkit.org>
170
171         REGRESSION(r178486): It broke the !ENABLE(VIDEO) build
172         https://bugs.webkit.org/show_bug.cgi?id=140611
173
174         Reviewed by Eric Carlson.
175
176         * testing/Internals.cpp:
177         (WebCore::Internals::elementIsBlockingDisplaySleep):
178         * testing/Internals.h:
179
180 2015-01-19  Sergio Villar Senin  <svillar@igalia.com>
181
182         [CSS Grid Layout] Tracks shrink sometimes with indefinite remaining space
183         https://bugs.webkit.org/show_bug.cgi?id=139059
184
185         Reviewed by David Hyatt.
186
187         Test: fast/css-grid-layout/grid-grow-tracks-to-their-max.html
188
189         * rendering/RenderGrid.cpp:
190         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
191
192 2015-01-18  Alexey Proskuryakov  <ap@apple.com>
193
194         Update bindings generation test results after <https://trac.webkit.org/changeset/178633>.
195
196         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
197         (WebCore::JSTestEventConstructorConstructor::constructJSTestEventConstructor):
198         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
199         (WebCore::jsTestEventTargetPrototypeFunctionAddEventListener):
200         (WebCore::jsTestEventTargetPrototypeFunctionRemoveEventListener):
201         * bindings/scripts/test/JS/JSTestObj.cpp:
202         (WebCore::jsTestObjPrototypeFunctionAddEventListener):
203         (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
204
205 2015-01-18  Chris Dumez  <cdumez@apple.com>
206
207         Generate matchingShorthandsForLonghand() implementation from CSSPropertyNames.in
208         https://bugs.webkit.org/show_bug.cgi?id=140599
209
210         Reviewed by Antti Koivisto.
211
212         Generate matchingShorthandsForLonghand() implementation from
213         CSSPropertyNames.in. We already have all the information we need in
214         CSSPropertyNames.in to generate the big switch() in
215         matchingShorthandsForLonghand().
216
217         A few shorthands still aren't generated. I will look into getting rid
218         of the custom code in a follow-up patch.
219
220         * css/StylePropertyShorthand.cpp:
221         (WebCore::makeVector): Deleted.
222         (WebCore::matchingShorthandsForLonghand): Deleted.
223         * css/StylePropertyShorthand.h:
224         (WebCore::matchingCustomShorthandsForLonghand):
225         * css/makeprop.pl:
226         (constructShorthandsVector):
227
228 2015-01-18  Dean Jackson  <dino@apple.com>
229
230         Out of bounds write in canvas.toDataURL
231         https://bugs.webkit.org/show_bug.cgi?id=140594
232         <rdar://problem/19449135>
233
234         Reviewed by Alexey Proskuryakov.
235
236         In the case where we have a canvas object that does
237         not have premultiplied alpha (an option you can select
238         when using WebGL) we have to multiply out the alpha when
239         converting to JPEG via toDataURL.
240
241         For this we created a buffer, but were not accurately
242         resizing it before flattening the alpha.
243
244         Test: fast/canvas/webgl/toDataURL-unpremultipliedAlpha.html
245
246         * platform/graphics/cg/ImageBufferCG.cpp:
247         (WebCore::ImageDataToDataURL): Call resize once we've
248         determined we have enough space.
249
250 2015-01-17  Sam Weinig  <sam@webkit.org>
251
252         Add initial experimental user content filtering API
253         https://bugs.webkit.org/show_bug.cgi?id=140584
254
255         Reviewed by Benjamin Poulain.
256
257         Change content extensions to be managed through the UserContentController.
258
259         * WebCore.exp.in:
260         Update exports.
261
262         * WebCore.xcodeproj/project.pbxproj:
263         Update for removed files.
264
265         * contentextensions/ContentExtensionsBackend.cpp:
266         (WebCore::ContentExtensions::ContentExtensionsBackend::removeAllRuleLists):
267         (WebCore::ContentExtensions::ContentExtensionsBackend::sharedInstance): Deleted.
268         * contentextensions/ContentExtensionsBackend.h:
269         Remove concept of a shared instance and add a removeAllRuleLists() function.
270         
271         * contentextensions/ContentExtensionsInterface.cpp: Removed.
272         * contentextensions/ContentExtensionsInterface.h: Removed.
273         Since there is no shared instance anymore, checking if a URL should be blocked
274         now has to go directly to the backend.
275         
276         * contentextensions/ContentExtensionsManager.cpp:
277         (WebCore::ContentExtensions::ExtensionsManager::createRuleList):
278         (WebCore::ContentExtensions::ExtensionsManager::loadExtension): Deleted.
279         * contentextensions/ContentExtensionsManager.h:
280         Update interface to accommodate the lack of a shared instance. Now, all this
281         file does is take a serialized rule list and outputs the Vector of ContentExtensionRules
282
283         * loader/cache/CachedResourceLoader.cpp:
284         (WebCore::CachedResourceLoader::requestResource):
285         Check with the UserContentController to see if the URL should be blocked.
286
287         * page/UserContentController.cpp:
288         (WebCore::UserContentController::addUserContentFilter):
289         (WebCore::UserContentController::removeAllUserContentFilters):
290         (WebCore::UserContentController::contentFilterBlocksURL):
291         * page/UserContentController.h:
292         Add single point of interaction for both the WebKit level to add and remove
293         content filters and WebCore to check to see if URLs should be blocked.
294
295 2015-01-18  Darin Adler  <darin@apple.com>
296
297         REGRESSION (r125251): wrapper lifetimes of SVGElementInstance are incorrect
298         https://bugs.webkit.org/show_bug.cgi?id=132148
299
300         Reviewed by Anders Carlsson.
301
302         Test: svg/custom/use-instanceRoot-event-listeners.xhtml
303
304         * bindings/js/JSDOMWindowCustom.cpp:
305         (WebCore::JSDOMWindow::addEventListener): Updated for the new return type
306         of JSListener::create. For the event type, use JSString::toAtomicString instead of
307         calling JSString::value and then converting to an AtomicString.
308         (WebCore::JSDOMWindow::removeEventListener): Same changes as for addEventListener.
309
310         * bindings/js/JSEventListener.cpp:
311         (WebCore::forwardsEventListeners): Added. Helper to detect the special case needed
312         for SVGElementInstance. In the future, for better encapsulation, we could use virtual
313         functions, but for now hard coding this single class seems fine.
314         (WebCore::correspondingElementWrapper): Added. For use if forwardsEventListeners
315         returns true, to find out where event listeners will be forwarded.
316         (WebCore::createJSEventListenerForAttribute): Added. Replaces the old function
317         createJSAttributeEventListener, for SVGElementInstance attributes only.
318         (WebCore::createJSEventListenerForAdd): Added. Helper function to avoid repeated
319         generated code in the addElementListener bindings other than the DOMWindow one.
320
321         * bindings/js/JSEventListener.h:
322         (WebCore::JSEventListener::create): Changed to return a Ref instead of a PassRefPtr.
323         (WebCore::createJSEventListenerForAttribute): Renamed from createJSAttributeEventListener,
324         changed to return a RefPtr instead of a PassRefPtr and to take references rather than
325         pointers for non-null things.
326         (WebCore::createJSEventListenerForRemove): Added. Small wrapper that calls
327         createJSEventListenerForAdd since they are currently identical.
328
329         * bindings/scripts/CodeGeneratorJS.pm:
330         (GenerateAttributeEventListenerCall): Removed the special case for JSSVGElementInstance
331         and updated to call the new createJSEventListenerForAttribute. The special case for
332         SVGElementInstance is now in JSEventListener.h/cpp, which is nicer since we prefer to
333         keep the generated code simpler if possible.
334         (GenerateEventListenerCall): Removed the special case for JSSVGElementInstance. This
335         has been dead code since the explicit definition of add/removeEventListener was removed
336         from SVGElementInstance.idl, and was also a problem if someone were to use the
337         addEventListener function from EventTarget on an SVGElementInstance object. The function
338         needs to be generic at runtime. Use toAtomicString as in JSDOMWindow::addEventListener above.
339         Call the two new functions, createJSEventListenerForAdd and createJSEventListenerForRemove.
340         Those new functions properly handle SVGElementInstance.
341         (GenerateImplementation): Don't pass the class name to GenerateAttributeEventListenerCall
342         or GenerateEventListenerCall any more.
343         (GenerateConstructorDefinition): Use JSString::toAtomicString instead of calling
344         JSString::value and then converting to AtomicString.
345
346 2015-01-17  Brian J. Burg  <burg@cs.washington.edu>
347
348         Web Inspector: highlight data for overlay should use protocol type builders
349         https://bugs.webkit.org/show_bug.cgi?id=129441
350
351         Reviewed by Timothy Hatcher.
352
353         As a first step towards cleaning up the inspector overlay, convert highlight
354         data construction to use protocol type builders. It's now really obvious what
355         data is being sent to the inspector overlay page.
356
357         This change paves the way towards using inspector protocol commands and events
358         if we want to support more interactive functionality in the inspector overlay.
359
360         This patch makes a few style cleanups, such as standardizing variable names,
361         using default member initializers, passing by reference, and fixing casts.
362
363         No new tests, no behavior changed.
364
365         * WebCore.exp.in:
366         * inspector/InspectorController.cpp:
367         (WebCore::InspectorController::getHighlight):
368         (WebCore::InspectorController::buildObjectForHighlightedNode):
369         (WebCore::InspectorController::inspect): Deleted.
370         * inspector/InspectorController.h:
371         * inspector/InspectorOverlay.cpp:
372         (WebCore::buildRendererHighlight):
373         (WebCore::buildNodeHighlight):
374         (WebCore::buildQuadHighlight):
375         (WebCore::InspectorOverlay::InspectorOverlay):
376         (WebCore::InspectorOverlay::getHighlight):
377         (WebCore::buildObjectForPoint):
378         (WebCore::buildObjectForRect):
379         (WebCore::buildArrayForQuad):
380         (WebCore::buildObjectForHighlight):
381         (WebCore::buildObjectForRegion):
382         (WebCore::buildObjectForFlowRegions):
383         (WebCore::buildObjectForSize):
384         (WebCore::buildQuadObjectForCSSRegionContentClip):
385         Simplify how the clipping area is encoded. It's now 'regionClippingArea'
386         stored on a FragmentHighlightData instance.
387
388         (WebCore::InspectorOverlay::updatePaintRectsTimerFired):
389         (WebCore::InspectorOverlay::drawPaintRects):
390         (WebCore::buildArrayForRendererFragments):
391         (WebCore::appendPathCommandAndPoints):
392         (WebCore::appendPathSegment):
393         (WebCore::buildObjectForShapeOutside):
394         (WebCore::buildObjectForElementData):
395         (WebCore::InspectorOverlay::buildObjectForHighlightedNode):
396         (WebCore::InspectorOverlay::drawNodeHighlight):
397         (WebCore::InspectorOverlay::drawQuadHighlight):
398         (WebCore::InspectorOverlay::reset):
399         (WebCore::buildObjectForRegionHighlight): Deleted.
400         (WebCore::buildObjectForCSSRegionsHighlight): Deleted.
401         (WebCore::buildObjectForCSSRegionContentClip): Deleted.
402         (WebCore::buildObjectForRendererFragments): Deleted.
403         (WebCore::buildObjectForElementInfo): Deleted.
404         * inspector/InspectorOverlay.h:
405         (WebCore::Highlight::Highlight):
406         * inspector/InspectorOverlayPage.js:
407         (_createElementTitle):
408         (_drawElementTitle):
409         (_drawFragmentHighlight):
410         (drawNodeHighlight):
411         * testing/Internals.cpp:
412         (WebCore::Internals::inspectorHighlightRects):
413         (WebCore::Internals::inspectorHighlightObject):
414
415 2015-01-17  Myles C. Maxfield  <mmaxfield@apple.com>
416
417         [SVG -> OTF Converter] Crashes when SVG font is invalid
418         https://bugs.webkit.org/show_bug.cgi?id=140378
419
420         Reviewed by Antti Koivisto.
421
422         Because CachedSVGFonts are cached, they have to be able to be used
423         in subsequent documents regardless how the first document left it.
424
425         Tests: fast/css/font-face-svg-decoding-error.html
426                svg/custom/svg-fonts-in-html.html
427                svg/text/text-overflow-ellipsis-svgfont-kerning-ligatures.html
428
429         * loader/cache/CachedFont.cpp:
430         (WebCore::CachedFont::ensureCustomFontData):
431         * loader/cache/CachedFont.h:
432         * loader/cache/CachedSVGFont.cpp:
433         (WebCore::CachedSVGFont::getFontData):
434         (WebCore::CachedSVGFont::ensureCustomFontData):
435         (WebCore::CachedSVGFont::maybeInitializeExternalSVGFontElement):
436         * loader/cache/CachedSVGFont.h:
437
438 2015-01-17  Chris Dumez  <cdumez@apple.com>
439
440         Converting time, angle and frequency units in CSS calc() function
441         https://bugs.webkit.org/show_bug.cgi?id=138356
442
443         Reviewed by Darin Adler.
444
445         Update CSSPrimitiveValue::primitiveType() to actually query the
446         primitiveType of the CSSCalcValue instead of assuming a given
447         type based on its category (e.g. If category is CalcTime, then
448         assume type is CSS_MS, even though it would be CSS_S as well).
449
450         This would like to calculation errors such as:
451         calc(4s + 1s) -> 5ms
452
453         Because we would assume the unit is CSS_MS without actually
454         checking.
455
456         This patch is inspired by the following Blink revision
457         by <rhodovan.u-szeged@partner.samsung.com> and initial WebKit
458         patch from <tmeszaros.u-szeged@partner.samsung.com>:
459         https://src.chromium.org/viewvc/blink?view=rev&revision=179101
460
461         Test: fast/css/calc-with-angle-time-frequency.html
462
463         * css/CSSCalculationValue.h:
464         (WebCore::CSSCalcValue::primitiveType):
465         * css/CSSPrimitiveValue.cpp:
466         (WebCore::CSSPrimitiveValue::primitiveType):
467
468 2015-01-17  Chris Dumez  <cdumez@apple.com>
469
470         Generate shorthandForProperty() implementation from CSSPropertyNames.in
471         https://bugs.webkit.org/show_bug.cgi?id=140556
472
473         Reviewed by Darin Adler.
474
475         Generate shorthandForProperty() implementation from CSSPropertyNames.in.
476         This is just a big switch() statement calling the right
477         StylePropertyShorthand factory function for a given CSSPropertyID.
478
479         * css/StylePropertyShorthand.cpp:
480         (WebCore::shorthandForProperty): Deleted.
481         * css/StylePropertyShorthand.h:
482         * css/makeprop.pl:
483
484 2015-01-16  Brent Fulgham  <bfulgham@apple.com>
485
486         [Mac] Correct infinite loop in Wheel Handler code in EventHandlerMac
487         https://bugs.webkit.org/show_bug.cgi?id=140564
488         <rdar://problem/19386426.
489
490         Reviewed by Dean Jackson.
491
492         * page/mac/EventHandlerMac.mm:
493         (WebCore::latchingIsLockedToAncestorOfThisFrame): Put missing assignment
494         back into the loop!
495
496 2015-01-16  Zalan Bujtas  <zalan@apple.com>
497
498         When border-radius is present, inset/outset/groove/ridge border color changes.
499         https://bugs.webkit.org/show_bug.cgi?id=140551
500
501         Reviewed by Simon Fraser.
502
503         This patch applies the same color lighten/darken adjustment on the radius borders
504         that we use for non-radius border.
505
506         Test: fast/borders/wrong-border-color-when-radius-is-present.html
507
508         * rendering/RenderBoxModelObject.cpp:
509         (WebCore::RenderBoxModelObject::drawBoxSideFromPath):
510         * rendering/RenderObject.cpp:
511         (WebCore::RenderObject::calculateBorderStyleColor):
512         * rendering/RenderObject.h:
513
514 2015-01-16  Pratik Solanki  <psolanki@apple.com>
515
516         Web pages fail to load using public iOS WebKit; ASSERT(!isMainThread()) in
517         -[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]
518         https://bugs.webkit.org/show_bug.cgi?id=140470
519
520         Reviewed by Alexey Proskuryakov.
521
522         Fixes an issue where a web page would fail to load in iOS WebKit2 built with the public iOS SDK
523         because NSURLConnection callbacks were always being scheduled on the main thread.
524
525         Currently we always schedule NSURLConnection callbacks to occur on the WebThread or the main
526         thread depending on whether the WebThread was started. In iOS WebKit2, the callbacks were
527         always being scheduled on the main thread regardless of whether we were using the NetworkProcess
528         (since the WebThread is only started when using WebKit1). This led to an assertion failure.
529         Instead we want to schedule callbacks to an NSOperationsQueue queue when using WebKit2 with the
530         NetworkProcess (i.e. ResourceHandleClient::usesAsyncCallbacks() is true), on the main thread when
531         using WebKit2 without the NetworkProcess and on the WebThread when using WebKit1.
532
533         * platform/network/mac/ResourceHandleMac.mm:
534         (WebCore::operationQueueForAsyncClients): Remove PLATFORM(IOS)-guards as we want to make use
535         of this code for iOS WebKit2 with the NetworkProcess.
536         (WebCore::ResourceHandle::start): Modified to use the existing Mac code path to conditionally
537         schedule NSURLConnection callbacks to an operation queue when ResourceHandleClient::usesAsyncCallbacks()
538         is true. Otherwise, schedule the callbacks on the run loop returned by WebThreadNSRunLoop(),
539         which is either the WebThread or the main thread run loop when using WebKit1 and WebKit2 without
540         the NetworkProcess, respectively.
541
542 2015-01-16  Brian J. Burg  <burg@cs.washington.edu>
543
544         Web Replay: purge remaining PassRefPtr uses and minor cleanup
545         https://bugs.webkit.org/show_bug.cgi?id=140456
546
547         Reviewed by Andreas Kling.
548
549         Get rid of PassRefPtr. Introduce default initializers where it makes sense. Change
550         uses of ASSERT to ASSERT_ARG when the assert is a precondition on an argument.
551
552         Remove mistaken uses of AtomicString that were not removed as part of r174113.
553
554         No new tests, no behavior changed.
555
556         * inspector/InspectorReplayAgent.cpp:
557         (WebCore::SerializeInputToJSONFunctor::operator()):
558         (WebCore::SerializeInputToJSONFunctor::returnValue):
559         (WebCore::InspectorReplayAgent::sessionCreated):
560         (WebCore::InspectorReplayAgent::sessionModified):
561         (WebCore::InspectorReplayAgent::sessionLoaded):
562         (WebCore::InspectorReplayAgent::segmentCreated):
563         (WebCore::InspectorReplayAgent::segmentCompleted):
564         (WebCore::InspectorReplayAgent::segmentLoaded):
565         (WebCore::InspectorReplayAgent::switchSession):
566         (WebCore::InspectorReplayAgent::insertSessionSegment):
567         (WebCore::InspectorReplayAgent::removeSessionSegment):
568         (WebCore::InspectorReplayAgent::findSession):
569         (WebCore::InspectorReplayAgent::findSegment):
570         * inspector/InspectorReplayAgent.h:
571         * replay/CapturingInputCursor.cpp:
572         (WebCore::CapturingInputCursor::CapturingInputCursor):
573         (WebCore::CapturingInputCursor::create):
574         (WebCore::CapturingInputCursor::loadInput):
575         * replay/CapturingInputCursor.h:
576         * replay/EventLoopInputDispatcher.cpp:
577         (WebCore::EventLoopInputDispatcher::EventLoopInputDispatcher):
578         * replay/EventLoopInputDispatcher.h:
579         * replay/FunctorInputCursor.h:
580         (WebCore::FunctorInputCursor::FunctorInputCursor):
581         (WebCore::FunctorInputCursor::loadInput):
582         * replay/ReplayController.cpp:
583         (WebCore::ReplayController::ReplayController):
584         (WebCore::ReplayController::setForceDeterministicSettings):
585         (WebCore::ReplayController::setSessionState):
586         (WebCore::ReplayController::setSegmentState):
587         (WebCore::ReplayController::switchSession):
588         (WebCore::ReplayController::createSegment):
589         (WebCore::ReplayController::completeSegment):
590         (WebCore::ReplayController::loadSegmentAtIndex):
591         (WebCore::ReplayController::unloadSegment):
592         (WebCore::ReplayController::frameNavigated):
593         (WebCore::ReplayController::loadedSession):
594         (WebCore::ReplayController::loadedSegment):
595         (WebCore::ReplayController::activeInputCursor):
596         (WebCore::ReplayController::dispatcher):
597         * replay/ReplayController.h:
598         * replay/ReplaySession.cpp:
599         (WebCore::ReplaySession::create):
600         (WebCore::ReplaySession::at):
601         (WebCore::ReplaySession::appendSegment):
602         (WebCore::ReplaySession::insertSegment):
603         (WebCore::ReplaySession::removeSegment):
604         * replay/ReplaySession.h:
605         * replay/ReplaySessionSegment.cpp:
606         (WebCore::ReplaySessionSegment::create):
607         (WebCore::ReplaySessionSegment::ReplaySessionSegment):
608         * replay/ReplaySessionSegment.h:
609         * replay/ReplayingInputCursor.cpp:
610         (WebCore::ReplayingInputCursor::ReplayingInputCursor):
611         (WebCore::ReplayingInputCursor::create):
612         (WebCore::ReplayingInputCursor::loadInput):
613         * replay/ReplayingInputCursor.h:
614         * replay/SegmentedInputStorage.cpp:
615         (WebCore::SegmentedInputStorage::store):
616         (WebCore::SegmentedInputStorage::queue):
617         (WebCore::SegmentedInputStorage::SegmentedInputStorage): Deleted.
618         * replay/SegmentedInputStorage.h:
619
620 2015-01-16  Andreas Kling  <akling@apple.com>
621
622         Remove assertion that Page::m_editorClient is non-null.
623
624         Unreviewed debug build fix. (It's a reference, it won't be null.)
625
626         * page/Page.cpp:
627         (WebCore::Page::Page):
628
629 2015-01-16  Andreas Kling  <akling@apple.com>
630
631         Page::editorClient() should return a reference.
632         <https://webkit.org/b/140552>
633
634         Reviewed by Chris Dumez.
635
636         Page always has an EditorClient, so make editorClient() return a reference.
637
638         * editing/AlternativeTextController.cpp:
639         (WebCore::AlternativeTextController::editorClient):
640         (WebCore::AlternativeTextController::textChecker):
641         * editing/Editor.cpp:
642         (WebCore::Editor::client):
643         * editing/SpellChecker.cpp:
644         (WebCore::SpellChecker::client):
645         * page/FocusController.cpp:
646         (WebCore::FocusController::setFocusedElement):
647         * page/Page.cpp:
648         (WebCore::Page::Page):
649         (WebCore::Page::~Page):
650         (WebCore::Page::clearUndoRedoOperations):
651         * page/Page.h:
652         (WebCore::Page::editorClient):
653         * page/scrolling/AsyncScrollingCoordinator.cpp:
654         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
655
656 2015-01-16  Benjamin Poulain  <benjamin@webkit.org>
657
658         Make URL filters case-insensitive by default
659         https://bugs.webkit.org/show_bug.cgi?id=140531
660
661         Reviewed by Andreas Kling.
662
663         Safari's filters were case-insensitive. Adopt that convention in the engine,
664         and add a flag in case someone ever need a case-sensitive filter.
665
666         * contentextensions/ContentExtensionRule.h:
667         * contentextensions/ContentExtensionsBackend.cpp:
668         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
669         * contentextensions/ContentExtensionsManager.cpp:
670         (WebCore::ContentExtensions::ExtensionsManager::loadTrigger):
671         * contentextensions/URLFilterParser.cpp:
672         (WebCore::ContentExtensions::trivialAtomFromASCIICharacter):
673         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder):
674         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
675         (WebCore::ContentExtensions::GraphBuilder::generateTransition):
676         (WebCore::ContentExtensions::URLFilterParser::addPattern):
677         * contentextensions/URLFilterParser.h:
678
679 2015-01-16  Benjamin Poulain  <bpoulain@apple.com>
680
681         Add the alternative syntax for CSS Selector's descendant combinator (">>")
682         https://bugs.webkit.org/show_bug.cgi?id=140525
683
684         Reviewed by Antti Koivisto.
685
686         The latest Selector spec introduces the combinator ">>" as an alias for the descendant
687         relation: http://dev.w3.org/csswg/selectors-4/#descendant-combinators
688
689         This patch implements that combinator as an alias of the existing one. For CSSOM's selector
690         serialization, I use one bit of CSSSelector to store if that alternative syntax was used.
691
692         Tests: fast/css/descendant-combinator-doubled-child-syntax-styling.html
693                fast/css/parsing-css-descendant-combinator-doubled-child-syntax.html
694                fast/selectors/element-closest-descendant-combinator-doubled-child-syntax.html
695                fast/selectors/element-matches-descendant-combinator-doubled-child-syntax.html
696                fast/selectors/querySelector-descendant-combinator-doubled-child-syntax.html
697
698         * css/CSSGrammar.y.in:
699         * css/CSSParserValues.cpp:
700         (WebCore::CSSParserSelector::appendTagHistory):
701         * css/CSSParserValues.h:
702         (WebCore::CSSParserSelector::setDescendantUseDoubleChildSyntax):
703         * css/CSSSelector.cpp:
704         (WebCore::CSSSelector::selectorText):
705         * css/CSSSelector.h:
706         (WebCore::CSSSelector::setDescendantUseDoubleChildSyntax):
707         (WebCore::CSSSelector::CSSSelector):
708
709 2015-01-16  Chris Dumez  <cdumez@apple.com>
710
711         Generate StylePropertyShorthand.* from CSSPropertyNames.in
712         https://bugs.webkit.org/show_bug.cgi?id=140501
713
714         Reviewed by Darin Adler.
715
716         Add initial support for having makeprop.pl generate most of
717         StylePropertyShorthand.* from CSSPropertyNames.in.
718
719         This patch replaces [Shorthand] parameter in CSSPropertyNames.in by a
720         more descriptive [Longhands=property1|property2|...] parameter. With
721         this information, makeprop.pl is now able to generate the
722         StylePropertyShorthand factories for all CSS shorthand properties
723         in a new StylePropertyShorthandFunctions.h header.
724
725         The switches in StylePropertyShorthand.cpp could also be generated
726         but this will be taken care of in follow-up patches to reduce patch
727         size.
728
729         * CMakeLists.txt:
730         * DerivedSources.make:
731         * WebCore.vcxproj/WebCore.vcxproj:
732         * WebCore.vcxproj/WebCore.vcxproj.filters:
733         * WebCore.xcodeproj/project.pbxproj:
734         * css/CSSComputedStyleDeclaration.cpp:
735         (WebCore::ComputedStyleExtractor::propertyValue):
736         * css/CSSParser.cpp:
737         (WebCore::CSSParser::parseValue):
738         * css/CSSPropertyNames.in:
739         * css/StyleProperties.cpp:
740         (WebCore::StyleProperties::getPropertyValue):
741         * css/StylePropertyShorthand.cpp:
742         (WebCore::shorthandForProperty):
743         (WebCore::matchingShorthandsForLonghand):
744         (WebCore::backgroundShorthand): Deleted.
745         (WebCore::backgroundPositionShorthand): Deleted.
746         (WebCore::backgroundRepeatShorthand): Deleted.
747         (WebCore::borderShorthand): Deleted.
748         (WebCore::borderBottomShorthand): Deleted.
749         (WebCore::borderColorShorthand): Deleted.
750         (WebCore::borderImageShorthand): Deleted.
751         (WebCore::borderLeftShorthand): Deleted.
752         (WebCore::borderRadiusShorthand): Deleted.
753         (WebCore::webkitBorderRadiusShorthand): Deleted.
754         (WebCore::borderRightShorthand): Deleted.
755         (WebCore::borderSpacingShorthand): Deleted.
756         (WebCore::borderStyleShorthand): Deleted.
757         (WebCore::borderTopShorthand): Deleted.
758         (WebCore::borderWidthShorthand): Deleted.
759         (WebCore::listStyleShorthand): Deleted.
760         (WebCore::marginShorthand): Deleted.
761         (WebCore::markerShorthand): Deleted.
762         (WebCore::outlineShorthand): Deleted.
763         (WebCore::overflowShorthand): Deleted.
764         (WebCore::paddingShorthand): Deleted.
765         (WebCore::transitionShorthand): Deleted.
766         (WebCore::animationShorthand): Deleted.
767         (WebCore::webkitAnimationShorthand): Deleted.
768         (WebCore::webkitBorderAfterShorthand): Deleted.
769         (WebCore::webkitBorderBeforeShorthand): Deleted.
770         (WebCore::webkitBorderEndShorthand): Deleted.
771         (WebCore::webkitBorderStartShorthand): Deleted.
772         (WebCore::webkitColumnsShorthand): Deleted.
773         (WebCore::webkitColumnRuleShorthand): Deleted.
774         (WebCore::flexFlowShorthand): Deleted.
775         (WebCore::flexShorthand): Deleted.
776         (WebCore::webkitMarginCollapseShorthand): Deleted.
777         (WebCore::webkitGridShorthand): Deleted.
778         (WebCore::webkitGridTemplateShorthand): Deleted.
779         (WebCore::webkitGridAreaShorthand): Deleted.
780         (WebCore::webkitGridColumnShorthand): Deleted.
781         (WebCore::webkitGridRowShorthand): Deleted.
782         (WebCore::webkitMarqueeShorthand): Deleted.
783         (WebCore::webkitMaskShorthand): Deleted.
784         (WebCore::webkitMaskPositionShorthand): Deleted.
785         (WebCore::webkitMaskRepeatShorthand): Deleted.
786         (WebCore::webkitTextDecorationShorthand): Deleted.
787         (WebCore::webkitTextEmphasisShorthand): Deleted.
788         (WebCore::webkitTextStrokeShorthand): Deleted.
789         (WebCore::webkitTransitionShorthand): Deleted.
790         (WebCore::webkitPerspectiveOriginShorthand): Deleted.
791         (WebCore::webkitTransformOriginShorthand): Deleted.
792         * css/StylePropertyShorthand.h:
793         * css/makeprop.pl:
794
795 2015-01-16  Commit Queue  <commit-queue@webkit.org>
796
797         Unreviewed, rolling out r178532.
798         https://bugs.webkit.org/show_bug.cgi?id=140548
799
800         Broke fast/css/parsing-css-lang.html on some bots (Requested
801         by ap on #webkit).
802
803         Reverted changeset:
804
805         "Canonicalization of :lang() should preserve the :lang()'s
806         arguments representations"
807         https://bugs.webkit.org/show_bug.cgi?id=139928
808         http://trac.webkit.org/changeset/178532
809
810 2015-01-16  Commit Queue  <commit-queue@webkit.org>
811
812         Unreviewed, rolling out r178577.
813         https://bugs.webkit.org/show_bug.cgi?id=140546
814
815         Broke fast/css-grid-layout/grid-content-sized-columns-
816         resolution.html (Requested by ap on #webkit).
817
818         Reverted changeset:
819
820         "[CSS Grid Layout] Tracks shrink sometimes with indefinite
821         remaining space"
822         https://bugs.webkit.org/show_bug.cgi?id=139059
823         http://trac.webkit.org/changeset/178577
824
825 2015-01-16  Andreas Kling  <akling@apple.com>
826
827         Some improvements to RuleSet shrinking.
828         <https://webkit.org/b/140534>
829
830         Reviewed by Antti Koivisto.
831
832         Give an inline capacity (1) to the RuleData Vectors in RuleSet.
833         The vast majority of Vectors have only a single entry, and this
834         avoids having to allocate a separate Vector backing store for them.
835
836         Also make sure to shrink some Vectors that we weren't already,
837         like those in RuleFeatureSet.
838
839         * css/ElementRuleCollector.cpp:
840         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
841         * css/ElementRuleCollector.h:
842         * css/RuleFeature.cpp:
843         (WebCore::RuleFeatureSet::shrinkToFit):
844         * css/RuleFeature.h:
845         * css/RuleSet.cpp:
846         (WebCore::RuleSet::addToRuleSet):
847         (WebCore::rulesCountForName):
848         (WebCore::shrinkMapVectorsToFit):
849         (WebCore::RuleSet::shrinkToFit):
850         * css/RuleSet.h:
851         (WebCore::RuleSet::idRules):
852         (WebCore::RuleSet::classRules):
853         (WebCore::RuleSet::tagRules):
854         (WebCore::RuleSet::shadowPseudoElementRules):
855         (WebCore::RuleSet::linkPseudoClassRules):
856         (WebCore::RuleSet::cuePseudoRules):
857         (WebCore::RuleSet::focusPseudoClassRules):
858         (WebCore::RuleSet::universalRules):
859
860 2015-01-16  Antti Koivisto  <antti@apple.com>
861
862         Correct naming for FontCascade implementation files
863         https://bugs.webkit.org/show_bug.cgi?id=140544
864
865         Reviewed by Zalan Bujtas.
866
867         Also reduce their number.
868
869         Merge FontFastPath.cpp into FontCascade.cpp
870         Merge FontMac.mm and FontComplexTextMac.cpp into FontCascadeCocoa.mm
871
872         * CMakeLists.txt:
873         * WebCore.vcxproj/WebCore.vcxproj:
874         * WebCore.xcodeproj/project.pbxproj:
875         * platform/graphics/FontCascade.cpp:
876         (WebCore::FontCascade::getEmphasisMarkGlyphData):
877         (WebCore::FontCascade::emphasisMarkAscent):
878         (WebCore::FontCascade::emphasisMarkDescent):
879         (WebCore::FontCascade::emphasisMarkHeight):
880         (WebCore::FontCascade::getGlyphsAndAdvancesForSimpleText):
881         (WebCore::FontCascade::drawSimpleText):
882         (WebCore::FontCascade::drawEmphasisMarksForSimpleText):
883         (WebCore::FontCascade::drawGlyphBuffer):
884         (WebCore::offsetToMiddleOfGlyph):
885         (WebCore::offsetToMiddleOfGlyphAtIndex):
886         (WebCore::FontCascade::drawEmphasisMarks):
887         (WebCore::FontCascade::floatWidthForSimpleText):
888         (WebCore::FontCascade::adjustSelectionRectForSimpleText):
889         (WebCore::FontCascade::offsetForPositionForSimpleText):
890         * platform/graphics/FontFastPath.cpp: Removed.
891         * platform/graphics/cocoa/FontCascadeCocoa.mm: Copied from Source/WebCore/platform/graphics/mac/FontMac.mm.
892         (WebCore::FontCascade::drawGlyphs):
893         (WebCore::FontCascade::adjustSelectionRectForComplexText):
894         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
895         (WebCore::FontCascade::drawComplexText):
896         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
897         (WebCore::FontCascade::floatWidthForComplexText):
898         (WebCore::FontCascade::offsetForPositionForComplexText):
899         (WebCore::FontCascade::fontDataForCombiningCharacterSequence):
900         * platform/graphics/mac/FontComplexTextMac.cpp: Removed.
901         * platform/graphics/mac/FontMac.mm: Removed.
902
903 2014-11-26  Sergio Villar Senin  <svillar@igalia.com>
904
905         [CSS Grid Layout] Tracks shrink sometimes with indefinite remaining space
906         https://bugs.webkit.org/show_bug.cgi?id=139059
907
908         Reviewed by David Hyatt.
909
910         Test: fast/css-grid-layout/grid-grow-tracks-to-their-max.html
911
912         * rendering/RenderGrid.cpp:
913         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
914
915 2015-01-15  Csaba Osztrogonác  <ossy@webkit.org>
916
917         Remove ENABLE(SQL_DATABASE) guards
918         https://bugs.webkit.org/show_bug.cgi?id=140434
919
920         Reviewed by Darin Adler.
921
922         * Configurations/FeatureDefines.xcconfig:
923         * Modules/webdatabase/AbstractDatabaseServer.h:
924         * Modules/webdatabase/ChangeVersionData.h:
925         * Modules/webdatabase/ChangeVersionWrapper.cpp:
926         * Modules/webdatabase/ChangeVersionWrapper.h:
927         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
928         * Modules/webdatabase/DOMWindowWebDatabase.h:
929         * Modules/webdatabase/DOMWindowWebDatabase.idl:
930         * Modules/webdatabase/Database.cpp:
931         * Modules/webdatabase/Database.h:
932         * Modules/webdatabase/Database.idl:
933         * Modules/webdatabase/DatabaseBackend.cpp:
934         * Modules/webdatabase/DatabaseBackend.h:
935         * Modules/webdatabase/DatabaseBackendBase.cpp:
936         * Modules/webdatabase/DatabaseBackendBase.h:
937         * Modules/webdatabase/DatabaseBasicTypes.h:
938         * Modules/webdatabase/DatabaseCallback.h:
939         * Modules/webdatabase/DatabaseCallback.idl:
940         * Modules/webdatabase/DatabaseContext.cpp:
941         * Modules/webdatabase/DatabaseContext.h:
942         * Modules/webdatabase/DatabaseDetails.h:
943         * Modules/webdatabase/DatabaseError.h:
944         * Modules/webdatabase/DatabaseManager.cpp:
945         * Modules/webdatabase/DatabaseManager.h:
946         * Modules/webdatabase/DatabaseManagerClient.h:
947         * Modules/webdatabase/DatabaseServer.cpp:
948         * Modules/webdatabase/DatabaseServer.h:
949         * Modules/webdatabase/DatabaseTask.cpp:
950         * Modules/webdatabase/DatabaseTask.h:
951         * Modules/webdatabase/DatabaseThread.cpp:
952         * Modules/webdatabase/DatabaseThread.h:
953         * Modules/webdatabase/DatabaseTracker.cpp:
954         * Modules/webdatabase/DatabaseTracker.h:
955         * Modules/webdatabase/OriginLock.cpp:
956         * Modules/webdatabase/OriginLock.h:
957         * Modules/webdatabase/SQLCallbackWrapper.h:
958         * Modules/webdatabase/SQLError.h:
959         * Modules/webdatabase/SQLError.idl:
960         * Modules/webdatabase/SQLException.cpp:
961         * Modules/webdatabase/SQLException.h:
962         * Modules/webdatabase/SQLException.idl:
963         * Modules/webdatabase/SQLResultSet.cpp:
964         * Modules/webdatabase/SQLResultSet.h:
965         * Modules/webdatabase/SQLResultSet.idl:
966         * Modules/webdatabase/SQLResultSetRowList.cpp:
967         * Modules/webdatabase/SQLResultSetRowList.h:
968         * Modules/webdatabase/SQLResultSetRowList.idl:
969         * Modules/webdatabase/SQLStatement.cpp:
970         * Modules/webdatabase/SQLStatement.h:
971         * Modules/webdatabase/SQLStatementBackend.cpp:
972         * Modules/webdatabase/SQLStatementBackend.h:
973         * Modules/webdatabase/SQLStatementCallback.h:
974         * Modules/webdatabase/SQLStatementCallback.idl:
975         * Modules/webdatabase/SQLStatementErrorCallback.h:
976         * Modules/webdatabase/SQLStatementErrorCallback.idl:
977         * Modules/webdatabase/SQLTransaction.cpp:
978         * Modules/webdatabase/SQLTransaction.h:
979         * Modules/webdatabase/SQLTransaction.idl:
980         * Modules/webdatabase/SQLTransactionBackend.cpp:
981         * Modules/webdatabase/SQLTransactionBackend.h:
982         * Modules/webdatabase/SQLTransactionCallback.h:
983         * Modules/webdatabase/SQLTransactionCallback.idl:
984         * Modules/webdatabase/SQLTransactionClient.cpp:
985         * Modules/webdatabase/SQLTransactionClient.h:
986         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
987         * Modules/webdatabase/SQLTransactionCoordinator.h:
988         * Modules/webdatabase/SQLTransactionErrorCallback.h:
989         * Modules/webdatabase/SQLTransactionErrorCallback.idl:
990         * Modules/webdatabase/SQLTransactionState.h:
991         * Modules/webdatabase/SQLTransactionStateMachine.cpp:
992         * Modules/webdatabase/SQLTransactionStateMachine.h:
993         * bindings/js/JSCommandLineAPIHostCustom.cpp:
994         (WebCore::JSCommandLineAPIHost::databaseId):
995         * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
996         * bindings/js/JSExceptionBase.cpp:
997         (WebCore::toExceptionBase):
998         * bindings/js/JSSQLResultSetRowListCustom.cpp:
999         * bindings/js/JSSQLTransactionCustom.cpp:
1000         * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
1001         (webkit_dom_test_callback_finalize):
1002         (webkit_dom_test_callback_constructor):
1003         (webkit_dom_test_callback_callback_with_no_param):
1004         (webkit_dom_test_callback_callback_with_array_param):
1005         (webkit_dom_test_callback_callback_with_serialized_script_value_param):
1006         (webkit_dom_test_callback_callback_with_non_bool_return_type):
1007         (webkit_dom_test_callback_callback_with_string_list):
1008         (webkit_dom_test_callback_callback_with_boolean):
1009         (webkit_dom_test_callback_callback_requires_this_to_pass):
1010         * bindings/scripts/test/GObject/WebKitDOMTestCallbackPrivate.h:
1011         * bindings/scripts/test/JS/JSTestCallback.cpp:
1012         * bindings/scripts/test/JS/JSTestCallback.h:
1013         * bindings/scripts/test/ObjC/DOMTestCallback.mm:
1014         * bindings/scripts/test/TestCallback.idl:
1015         * dom/DOMExceptions.in:
1016         * dom/ScriptExecutionContext.cpp:
1017         (WebCore::ScriptExecutionContext::setDatabaseContext):
1018         * dom/ScriptExecutionContext.h:
1019         * history/PageCache.cpp:
1020         (WebCore::logCanCacheFrameDecision):
1021         (WebCore::PageCache::canCachePageContainingThisFrame):
1022         * inspector/CommandLineAPIHost.cpp:
1023         (WebCore::CommandLineAPIHost::CommandLineAPIHost):
1024         (WebCore::CommandLineAPIHost::disconnect):
1025         (WebCore::CommandLineAPIHost::databaseIdImpl):
1026         * inspector/CommandLineAPIHost.h:
1027         (WebCore::CommandLineAPIHost::init):
1028         * inspector/InspectorController.cpp:
1029         (WebCore::InspectorController::InspectorController):
1030         * inspector/InspectorDatabaseAgent.cpp:
1031         * inspector/InspectorDatabaseAgent.h:
1032         * inspector/InspectorDatabaseInstrumentation.h:
1033         (WebCore::InspectorInstrumentation::didOpenDatabase):
1034         * inspector/InspectorDatabaseResource.cpp:
1035         * inspector/InspectorDatabaseResource.h:
1036         * inspector/InspectorInstrumentation.cpp:
1037         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
1038         (WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
1039         * inspector/InspectorInstrumentation.h:
1040         * inspector/InstrumentingAgents.cpp:
1041         (WebCore::InstrumentingAgents::InstrumentingAgents):
1042         (WebCore::InstrumentingAgents::reset):
1043         * inspector/InstrumentingAgents.h:
1044         * inspector/WorkerInspectorController.cpp:
1045         (WebCore::WorkerInspectorController::WorkerInspectorController):
1046         * loader/EmptyClients.h:
1047         * loader/FrameLoader.cpp:
1048         (WebCore::FrameLoader::stopLoading):
1049         * page/ChromeClient.h:
1050         * platform/FeatureCounterKeys.h:
1051
1052 2015-01-15  Zalan Bujtas  <zalan@apple.com>
1053
1054         Element appears correctly but does not receive event with a large translation.
1055         https://bugs.webkit.org/show_bug.cgi?id=139815
1056
1057         Reviewed by Simon Fraser.
1058
1059         When the hit point gets translated beyond the min/max value of LayoutRect (infiniteRect()),
1060         we fail to find the corresponding layer.
1061         When there's no clipping on a layer, we use min/max values to represent infiniteness.
1062         However it does not work well across types. With IntPoint(hittest) we can address a point that's outside
1063         of LayoutRect's boundary(clipping).
1064         This patch addresses the immediate issue of not being able to hittest transformed layers properly. 
1065         Fixing the representation of infiniteness is tracked here: webkit.org/b/140533
1066
1067         Test: transforms/hittest-translated-content-off-to-infinity-and-back.html
1068
1069         * rendering/ClipRect.cpp:
1070         (WebCore::ClipRect::intersects):
1071
1072 2015-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
1073
1074         tables/mozilla/bugs/bug10633.html is flakey on Yosemite
1075         https://bugs.webkit.org/show_bug.cgi?id=140487
1076
1077         Reviewed by Simon Fraser.
1078
1079         The workaround in https://bugs.webkit.org/show_bug.cgi?id=140253 works
1080         on both OSes.
1081
1082         * platform/graphics/mac/SimpleFontDataMac.mm:
1083         (WebCore::SimpleFontData::platformInit):
1084
1085 2015-01-15  Ryosuke Niwa  <rniwa@webkit.org>
1086
1087         Removing an HTML element spends a lot of time in adjustDirectionalityIfNeededAfterChildrenChanged
1088         https://bugs.webkit.org/show_bug.cgi?id=140523
1089         <rdar://problem/19464329>
1090
1091         Reviewed by Chris Dumez.
1092
1093         The bug was caused by adjustDirectionalityIfNeededAfterChildrenChanged always traversing children to
1094         unset selfOrAncestorHasDirAutoAttribute flag while removing a child element.
1095
1096         Fixed the bug by removing this code. This code was no-op prior to being refactored in r154957 since
1097         we only entered a for loop with the invariant "counter < childCountDelta" when "childCountDelta < 0".
1098
1099         See http://trac.webkit.org/changeset/154957/trunk/Source/WebCore/html/HTMLElement.cpp.
1100
1101         * html/HTMLElement.cpp:
1102         (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
1103
1104 2015-01-15  Brent Fulgham  <bfulgham@apple.com>
1105
1106         RenderLayerCompositor: Strange comparison of opacity (float) to boolean.
1107         https://bugs.webkit.org/show_bug.cgi?id=140477.
1108
1109         Reviewed by Simon Fraser.
1110
1111         * rendering/RenderLayerCompositor.cpp:
1112         (WebCore::styleChangeRequiresLayerRebuild): Add a cast to make the meaning of this
1113         code clearer.
1114
1115 2015-01-15  Joseph Pecoraro  <pecoraro@apple.com>
1116
1117         Unreviewed, rolling out r178531.
1118
1119         Caused LayoutTest ASSERTs/CRASHs on Debug Yosemite build-bot.
1120
1121         Reverted changeset:
1122
1123         "Layers need to be already updated before we call adjustViewSize."
1124         https://bugs.webkit.org/show_bug.cgi?id=135514
1125         http://trac.webkit.org/changeset/178531
1126
1127         * page/FrameView.cpp:
1128         (WebCore::FrameView::layout):
1129         (WebCore::FrameView::updateCompositingLayersAfterScrolling):
1130         (WebCore::FrameView::paintContents):
1131         (WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange): Deleted.
1132         * page/FrameView.h:
1133         * platform/ScrollView.cpp:
1134         (WebCore::ScrollView::scrollTo):
1135         (WebCore::ScrollView::handleDeferredScrollUpdateAfterContentSizeChange): Deleted.
1136         * platform/ScrollView.h:
1137         (WebCore::ScrollView::shouldDeferScrollUpdateAfterContentSizeChange): Deleted.
1138
1139 2015-01-15  Chris Dumez  <cdumez@apple.com>
1140
1141         [WK2] Wire diagnostic logging messages through the UIProcess
1142         https://bugs.webkit.org/show_bug.cgi?id=140486
1143
1144         Reviewed by Sam Weinig.
1145
1146         Wire diagnostic logging messages through the UIProcess.
1147         Eventually, the corresponding bundle API should go away.
1148
1149         * WebCore.vcxproj/WebCore.vcxproj:
1150         * WebCore.vcxproj/WebCore.vcxproj.filters:
1151         Add page/DiagnosticLoggingResultType.h to Windows project.
1152
1153         * WebCore.xcodeproj/project.pbxproj:
1154         Add page/DiagnosticLoggingResultType.h to XCode project.
1155
1156         * html/HTMLMediaElement.cpp:
1157         * loader/EmptyClients.h:
1158         * loader/FrameLoader.cpp:
1159         * page/DiagnosticLoggingClient.h:
1160         * page/DiagnosticLoggingResultType.h: Copied from Source/WebCore/page/DiagnosticLoggingClient.h.
1161         Use new DiagnosticLoggingResultType enum instead of old
1162         DiagnosticLoggingClient::LogType one.
1163
1164 2015-01-15  Zalan Bujtas  <zalan@apple.com>
1165
1166         Reduce LayoutRect::infiniteRect() usage.
1167         https://bugs.webkit.org/show_bug.cgi?id=140511
1168
1169         Reviewed by Simon Fraser.
1170
1171         This is in preparation to get rid of LayoutRect/FloatRect::infiniteRect().
1172
1173         No change in functionality.
1174
1175         * platform/graphics/LayoutRect.h:
1176         (WebCore::LayoutRect::isInfinite):
1177         * rendering/ClipRect.h:
1178         (WebCore::ClipRect::reset):
1179         (WebCore::ClipRect::isEmpty):
1180         (WebCore::ClipRect::isInfinite):
1181         (WebCore::ClipRect::setRect): Deleted.
1182         * rendering/PaintInfo.h:
1183         (WebCore::PaintInfo::applyTransform):
1184         * rendering/RenderLayer.cpp:
1185         (WebCore::RenderLayer::calculateClipRects):
1186         * rendering/RenderLayer.h:
1187         (WebCore::ClipRects::reset):
1188         * rendering/RenderLayerBacking.cpp:
1189         (WebCore::RenderLayerBacking::updateGeometry):
1190         * rendering/RenderLayerCompositor.cpp:
1191         (WebCore::RenderLayerCompositor::clippedByAncestor):
1192
1193 2015-01-15  Chris Dumez  <cdumez@apple.com>
1194
1195         Intermittent WebCore build failures - CSSPropertyNames.gperf: No keywords in input file! calling gperf failed: 256 at WebCore/css/makeprop.pl line 901
1196         https://bugs.webkit.org/show_bug.cgi?id=140521
1197
1198         Reviewed by Alexey Proskuryakov.
1199
1200         Close the CSSPropertyNames.gperf file before calling gperf on it
1201         to make sure the content we wrote was flushed. This was causing
1202         intermittent build failures.
1203
1204         * css/makeprop.pl:
1205
1206 2015-01-15  Zalan Bujtas  <zalan@apple.com>
1207
1208         LayerFragment should be able to intersect with ClipRect.
1209         https://bugs.webkit.org/show_bug.cgi?id=140498
1210
1211         Reviewed by Simon Fraser.
1212
1213         No change in functionality.
1214
1215         * rendering/LayerFragment.h:
1216         (WebCore::LayerFragment::intersect):
1217         * rendering/RenderLayer.cpp:
1218         (WebCore::RenderLayer::collectFragments):
1219
1220 2015-01-15  Zalan Bujtas  <zalan@apple.com>
1221
1222         Move ClipRects and ClipRectsCache classes to RenderLayer.cpp.
1223         https://bugs.webkit.org/show_bug.cgi?id=140461
1224
1225         Reviewed by Simon Fraser.
1226
1227         Move classes only used by RenderLayer to RenderLayer.cpp.
1228
1229         No change in functionality.
1230
1231         * rendering/RenderLayer.cpp:
1232         (WebCore::ClipRects::create):
1233         (WebCore::ClipRects::reset):
1234         (WebCore::ClipRects::overflowClipRect):
1235         (WebCore::ClipRects::setOverflowClipRect):
1236         (WebCore::ClipRects::fixedClipRect):
1237         (WebCore::ClipRects::setFixedClipRect):
1238         (WebCore::ClipRects::posClipRect):
1239         (WebCore::ClipRects::setPosClipRect):
1240         (WebCore::ClipRects::fixed):
1241         (WebCore::ClipRects::setFixed):
1242         (WebCore::ClipRects::ref):
1243         (WebCore::ClipRects::deref):
1244         (WebCore::ClipRects::operator==):
1245         (WebCore::ClipRects::operator=):
1246         (WebCore::ClipRects::ClipRects):
1247         (WebCore::ClipRectsCache::ClipRectsCache):
1248         (WebCore::ClipRectsCache::getClipRects):
1249         (WebCore::ClipRectsCache::setClipRects):
1250         (WebCore::ClipRectsCache::getIndex):
1251         (WebCore::RenderLayer::clipRects):
1252         (WebCore::RenderLayer::calculateClipRects):
1253         * rendering/RenderLayer.h:
1254         (WebCore::ClipRects::create): Deleted.
1255         (WebCore::ClipRects::ClipRects): Deleted.
1256         (WebCore::ClipRects::reset): Deleted.
1257         (WebCore::ClipRects::overflowClipRect): Deleted.
1258         (WebCore::ClipRects::setOverflowClipRect): Deleted.
1259         (WebCore::ClipRects::fixedClipRect): Deleted.
1260         (WebCore::ClipRects::setFixedClipRect): Deleted.
1261         (WebCore::ClipRects::posClipRect): Deleted.
1262         (WebCore::ClipRects::setPosClipRect): Deleted.
1263         (WebCore::ClipRects::fixed): Deleted.
1264         (WebCore::ClipRects::setFixed): Deleted.
1265         (WebCore::ClipRects::ref): Deleted.
1266         (WebCore::ClipRects::deref): Deleted.
1267         (WebCore::ClipRects::operator==): Deleted.
1268         (WebCore::ClipRects::operator=): Deleted.
1269         (WebCore::ClipRectsCache::ClipRectsCache): Deleted.
1270         (WebCore::ClipRectsCache::getClipRects): Deleted.
1271         (WebCore::ClipRectsCache::setClipRects): Deleted.
1272         (WebCore::ClipRectsCache::getIndex): Deleted.
1273
1274 2015-01-15  Dhi Aurrahman  <diorahman@rockybars.com>
1275
1276         Canonicalization of :lang() should preserve the :lang()'s arguments representations
1277         https://bugs.webkit.org/show_bug.cgi?id=139928
1278
1279         Reviewed by Benjamin Poulain.
1280
1281         Preserve the representation of IDENT and STRING when serializing the 
1282         :lang(). For example, :lang(foo,"bar"   ,baz) should be serialized as 
1283         :lang(foo, "bar", baz) instead of :lang(foo, bar, baz).
1284
1285         Rename CSSParserSelector::setArgumentList, CSSSelector::setArgumentList
1286         and CSSSelector::argumentList to CSSParserSelector::setLangArgumentList,
1287         CSSSelector::setLangArgumentList and CSSSelector::langArgumentList 
1288         respectively, since those methods are being exclusively used in respect
1289         with :lang().
1290
1291         Update the test of serializing :lang() with IDENT and STRING arguments.
1292
1293         * css/CSSGrammar.y.in:
1294         * css/CSSParserValues.cpp:
1295         (WebCore::CSSParserSelector::setLangArgumentList):
1296         (WebCore::CSSParserSelector::setArgumentList): Deleted.
1297         * css/CSSParserValues.h:
1298         (WebCore::CSSParserString::init):
1299         (WebCore::CSSParserString::clear):
1300         (WebCore::CSSParserString::isParsedFromString):
1301         (WebCore::CSSParserString::setParsedFromString):
1302         * css/CSSSelector.cpp:
1303         (WebCore::appendLangArgumentList):
1304         (WebCore::CSSSelector::selectorText):
1305         (WebCore::CSSSelector::setLangArgumentList):
1306         (WebCore::appendArgumentList): Deleted.
1307         (WebCore::CSSSelector::setArgumentList): Deleted.
1308         * css/CSSSelector.h:
1309         (WebCore::CSSSelector::langArgumentList):
1310         (WebCore::CSSSelector::langArgumentParsedFromStringFlagList):
1311         (WebCore::CSSSelector::argumentList): Deleted.
1312         * css/SelectorChecker.cpp:
1313         (WebCore::SelectorChecker::checkOne):
1314
1315 2015-01-15  Brent Fulgham  <bfulgham@apple.com>
1316
1317         Layers need to be already updated before we call adjustViewSize
1318         https://bugs.webkit.org/show_bug.cgi?id=135514
1319
1320         Reviewed by Simon Fraser.
1321
1322         Tested by 'fast/dynamic/layer-no-longer-paginated.html'
1323
1324         Defer updating scrollbars until we have finished layout. This
1325         has a couple of benefits:
1326         (1) We do not attempt to modify render layers during layout.
1327         (2) In WK1 we do not attempt to paint during layout.
1328
1329         Add a new virtual predicate to ScrollView indicating when we are in
1330         layout so that calls to setContentsSize do not attempt
1331         to adjust scrollbars.
1332
1333         Modify FrameView to set its ScrollView state to block drawing
1334         scrollbar updates during layout. Also add a post-layout
1335         handler to complete the scrollbar updates after layout is
1336         finished.
1337
1338         * page/FrameView.cpp:
1339         (WebCore::FrameView::layout):
1340         (WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange): Added.
1341         * page/FrameView.h:
1342         * platform/ScrollView.cpp:
1343         (WebCore::ScrollView::handleDeferredScrollUpdateAfterContentSizeChange): Added.
1344         (WebCore::ScrollView::scrollTo): If we should defer painting, cache the
1345         the scroll delta and apply it after the layout is complete.
1346         * platform/ScrollView.h:
1347         (WebCore::ScrollView::shouldDeferScrollUpdateAfterContentSizeChange): Added.
1348
1349 2015-01-15  Benjamin Poulain  <benjamin@webkit.org>
1350
1351         When building the NFA of the global disjunction, share the prefix subgraph of existing subpatterns
1352         https://bugs.webkit.org/show_bug.cgi?id=140465
1353
1354         Reviewed by Andreas Kling.
1355
1356         This patch updates the parser to produce smaller graphs when multiple patterns
1357         of the rule list share a common prefix.
1358
1359         Previously, GraphBuilder would generate subgraph in place of each parsed
1360         atom. We now only create subgraph if an atom does not appear in the prefix tree.
1361
1362         We accumulate the parsing information into small uint16_t named TrivialAtom.
1363         When generating the subgraph for an new atom, we first check if the prefix tree already
1364         has a corresponding subgraph for that atom. If it does, we do not generate anything and we extend the existing
1365         graph. If there is no existing prefix, we create the subgraph and extend the prefix tree.
1366
1367         Sharing prefix subtrees slows down the subtree generation a bit but the resulting graph is much
1368         simpler for many kind of inputs.
1369
1370         * WebCore.xcodeproj/project.pbxproj:
1371         * contentextensions/ContentExtensionsBackend.cpp:
1372         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
1373         The URLFilterParser now maintains states (the prefix tree) between patterns.
1374
1375         * contentextensions/DFA.cpp:
1376         (WebCore::ContentExtensions::DFA::debugPrintDot):
1377         * contentextensions/DFANode.h:
1378         Fix a typo :)
1379
1380         * contentextensions/NFA.cpp:
1381         (WebCore::ContentExtensions::NFA::createNode):
1382         (WebCore::ContentExtensions::NFA::setFinal):
1383         (WebCore::ContentExtensions::NFA::restoreToGraphSize):
1384         (WebCore::ContentExtensions::NFA::addRuleId):
1385         (WebCore::ContentExtensions::NFA::debugPrintDot):
1386         * contentextensions/NFA.h:
1387         (WebCore::ContentExtensions::NFA::addRuleId):
1388         * contentextensions/NFANode.cpp: Removed.
1389         * contentextensions/NFANode.h:
1390         NFA nodes from two patterns are now "merged" by construction, thus we need
1391         to keep track of multiple rules per node.
1392
1393         * contentextensions/NFAToDFA.cpp:
1394         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate):
1395         * contentextensions/URLFilterParser.cpp:
1396         (WebCore::ContentExtensions::trivialAtomFromAsciiCharacter):
1397         (WebCore::ContentExtensions::quantifyTrivialAtom):
1398         (WebCore::ContentExtensions::trivialAtomForNewlineClassIDBuiltin):
1399         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder):
1400         (WebCore::ContentExtensions::GraphBuilder::m_LastPrefixTreeEntry):
1401         (WebCore::ContentExtensions::GraphBuilder::finalize):
1402         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
1403         (WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
1404         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
1405         (WebCore::ContentExtensions::GraphBuilder::fail):
1406         (WebCore::ContentExtensions::GraphBuilder::generateTransition):
1407         (WebCore::ContentExtensions::GraphBuilder::sinkTrivialAtom):
1408         (WebCore::ContentExtensions::GraphBuilder::sinkPendingAtomIfNecessary):
1409         (WebCore::ContentExtensions::URLFilterParser::URLFilterParser):
1410         (WebCore::ContentExtensions::URLFilterParser::addPattern):
1411         (WebCore::ContentExtensions::GraphBuilder::m_lastAtom): Deleted.
1412         (WebCore::ContentExtensions::URLFilterParser::parse): Deleted.
1413         * contentextensions/URLFilterParser.h:
1414         (WebCore::ContentExtensions::URLFilterParser::hasError): Deleted.
1415         (WebCore::ContentExtensions::URLFilterParser::errorMessage): Deleted.
1416
1417 2015-01-14  Alexey Proskuryakov  <ap@apple.com>
1418
1419         Web Inspector and regular console use different source code locations for messages
1420         https://bugs.webkit.org/show_bug.cgi?id=140478
1421
1422         Reviewed by Brian Burg.
1423
1424         We now create a ConsoleMessage object in a place where we can look at it and use
1425         the source location it computed in a client call.
1426
1427         * inspector/InspectorConsoleInstrumentation.h:
1428         (WebCore::InspectorInstrumentation::addMessageToConsole):
1429         * inspector/InspectorInstrumentation.cpp:
1430         (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
1431         * inspector/InspectorInstrumentation.h:
1432         * inspector/WebConsoleAgent.cpp:
1433         (WebCore::WebConsoleAgent::didFinishXHRLoading):
1434         (WebCore::WebConsoleAgent::didReceiveResponse):
1435         (WebCore::WebConsoleAgent::didFailLoading):
1436         * page/PageConsoleClient.cpp:
1437         (WebCore::PageConsoleClient::addMessage):
1438         (WebCore::PageConsoleClient::messageWithTypeAndLevel):
1439         * workers/WorkerGlobalScope.cpp:
1440         (WebCore::WorkerGlobalScope::addMessageToWorkerConsole):
1441
1442 2015-01-15  Brent Fulgham  <bfulgham@apple.com>
1443
1444         [Win] Unreviewed Windows build fix.
1445
1446         More missing Font->FontCascade changes.
1447
1448         * platform/win/WebCoreTextRenderer.cpp:
1449         (WebCore::WebCoreSetAlwaysUsesComplexTextCodePath):
1450         (WebCore::WebCoreAlwaysUsesComplexTextCodePath):
1451
1452 2015-01-15  Antti Koivisto  <antti@apple.com>
1453
1454         REGRESSION(r178133): Membuster regressed ~4%
1455         https://bugs.webkit.org/show_bug.cgi?id=140495
1456
1457         Reviewed by Andreas Kling.
1458
1459         * platform/graphics/FontCache.cpp:
1460         (WebCore::FontCache::purgeInactiveFontData):
1461
1462             Fonts may ref other fonts. Keep clearing until there are no changes.
1463
1464 2015-01-15  Brent Fulgham  <bfulgham@apple.com>
1465
1466         [Win] Unreviewed build fix.
1467
1468         * platform/graphics/win/FontCacheWin.cpp:
1469         * platform/win/DragImageWin.cpp:
1470         * platform/win/WebCoreTextRenderer.h:
1471
1472 2015-01-15  Antti Koivisto  <antti@apple.com>
1473
1474         Try to fix windows build.
1475
1476         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1477         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1478         (PlatformCALayerWinInternal::displayCallback):
1479         * platform/win/DragImageWin.cpp:
1480         (WebCore::dragLabelFont):
1481         (WebCore::createDragImageForLink):
1482         * platform/win/PopupMenuWin.cpp:
1483         (WebCore::PopupMenuWin::calculatePositionAndSize):
1484         (WebCore::PopupMenuWin::paint):
1485         * platform/win/WebCoreTextRenderer.cpp:
1486         (WebCore::doDrawTextAtPoint):
1487         (WebCore::WebCoreDrawDoubledTextAtPoint):
1488         (WebCore::WebCoreTextFloatWidth):
1489         (WebCore::WebCoreSetAlwaysUsesComplexTextCodePath):
1490         (WebCore::WebCoreAlwaysUsesComplexTextCodePath):
1491         * rendering/RenderThemeSafari.cpp:
1492         (WebCore::RenderThemeSafari::setFontFromControlSize):
1493
1494 2015-01-15  Antti Koivisto  <antti@apple.com>
1495
1496         Unreviewed, rolling out r178518.
1497
1498         Didn't mean to commit some of this
1499
1500         Reverted changeset:
1501
1502         "Try to fix windows build."
1503         http://trac.webkit.org/changeset/178518
1504
1505 2015-01-15  Antti Koivisto  <antti@apple.com>
1506
1507         Try to fix windows build.
1508
1509         * platform/graphics/Font.cpp: Copied from Source/WebCore/platform/graphics/SimpleFontData.cpp.
1510         * platform/graphics/Font.h: Copied from Source/WebCore/platform/graphics/SimpleFontData.h.
1511         * platform/graphics/FontCascadeFastPath.cpp: Copied from Source/WebCore/platform/graphics/FontFastPath.cpp.
1512         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1513         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1514         (PlatformCALayerWinInternal::displayCallback):
1515         * platform/graphics/ios/FontIOS.mm: Copied from Source/WebCore/platform/graphics/ios/SimpleFontDataIOS.mm.
1516         * platform/graphics/mac/FontCascadeComplexTextMac.cpp: Copied from Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp.
1517         * platform/graphics/mac/FontCascadeMac.mm: Copied from Source/WebCore/platform/graphics/mac/FontMac.mm.
1518         * platform/graphics/mac/FontCoreText.cpp: Copied from Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp.
1519         * platform/graphics/mac/FontMac.mm: Replaced with Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm.
1520         * platform/win/DragImageWin.cpp:
1521         (WebCore::dragLabelFont):
1522         (WebCore::createDragImageForLink):
1523         * platform/win/PopupMenuWin.cpp:
1524         (WebCore::PopupMenuWin::calculatePositionAndSize):
1525         (WebCore::PopupMenuWin::paint):
1526         * platform/win/WebCoreTextRenderer.cpp:
1527         (WebCore::doDrawTextAtPoint):
1528         (WebCore::WebCoreDrawDoubledTextAtPoint):
1529         (WebCore::WebCoreTextFloatWidth):
1530         (WebCore::WebCoreSetAlwaysUsesComplexTextCodePath):
1531         (WebCore::WebCoreAlwaysUsesComplexTextCodePath):
1532         * rendering/RenderThemeSafari.cpp:
1533         (WebCore::RenderThemeSafari::setFontFromControlSize):
1534
1535 2015-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
1536
1537         http/tests/misc/acid3.html is flakey on Mavericks
1538         https://bugs.webkit.org/show_bug.cgi?id=140253
1539
1540         Reviewed by Alexey Proskuryakov.
1541
1542         CoreText has a bug <rdar://problem/19433490> in which kerning is not applied for a font
1543         if a CTTypesetter is created using that font before a call to CTFontTransformGlyphs. We
1544         often create typesetters in the complex code path, so it's not obvious when this bug
1545         might present itself. This patch simply makes a dummy invocation of
1546         CTFontTransformGlyphs() when creating a SimpleFontData.
1547
1548         No new tests because this is covered by http/tests/misc/acid3.html.
1549
1550         * platform/graphics/mac/SimpleFontDataMac.mm:
1551         (WebCore::SimpleFontData::platformInit):
1552
1553 2015-01-15  Chris Dumez  <cdumez@apple.com>
1554
1555         Get rid of custom StyleBuilder code for 'line-height' CSS property
1556         https://bugs.webkit.org/show_bug.cgi?id=140462
1557
1558         Reviewed by Antti Koivisto.
1559
1560         Get rid of custom StyleBuilder code for 'line-height' CSS property by
1561         using a conditional converter.
1562
1563         * css/CSSPropertyNames.in:
1564         * css/StyleBuilderConverter.h:
1565         (WebCore::StyleBuilderConverter::convertLineHeight):
1566         * css/StyleBuilderCustom.h:
1567         (WebCore::StyleBuilderCustom::applyValueLineHeight):
1568         (WebCore::StyleBuilderCustom::convertLineHeight): Deleted.
1569
1570 2015-01-15  Antti Koivisto  <antti@apple.com>
1571
1572         Rename Font to FontCascade
1573         https://bugs.webkit.org/show_bug.cgi?id=140442
1574
1575         Reviewed by Darin Adler.
1576
1577         We can then rename SimpleFontData to Font. This will match the usual definition of a "font".
1578
1579 2015-01-15  Mihnea Ovidenie  <mihnea@adobe.com>
1580
1581         [CSSRegions] Assert failure in RenderBlock::locateFlowThreadContainingBlock when showing the render tree debug info
1582         https://bugs.webkit.org/show_bug.cgi?id=140441
1583
1584         Reviewed by Andrei Bucur.
1585
1586         When showing the render tree debug information for an element inside a flow thread,
1587         we will display the region range information for all the render boxes. To avoid
1588         computation of flow thread containing block in these situations, we will use
1589         only the cached flow thread containing block information.
1590
1591         No new tests as this code path is only touched when using showRenderTree* methods.
1592
1593         * rendering/RenderObject.cpp:
1594         (WebCore::flowThreadContainingBlockFromRenderer):
1595         (WebCore::RenderObject::showRegionsInformation):
1596
1597 2015-01-14  Simon Fraser  <simon.fraser@apple.com>
1598
1599         Graphics corruption after Find on some pages
1600         https://bugs.webkit.org/show_bug.cgi?id=140489
1601
1602         Reviewed by Zalan Bujtas.
1603         
1604         After doing a Find on http://shop.outlier.cc/shop/retail/chino.html,
1605         garbage could appear on some parts of the page. This is caused by creating
1606         a compositing layer which is marked as opaque, yet failing to paint the entire
1607         layer contents.
1608         
1609         This was caused by a bug in RenderBox::computeBackgroundIsKnownToBeObscured()
1610         logic. On the page in question, doing a Find could cause overflow:hidden sections
1611         to get scrolled (since Find can reveal the selection by scrolling overflow).
1612         However, the render tree walking under RenderBox::foregroundIsKnownToBeOpaqueInRect()
1613         fails to take overflow scrolling into account, so gives the wrong answer
1614         in some content configurations. As a result, we'd think that the background
1615         is obscured, and never paint it.
1616         
1617         Conservative fix is to have isCandidateForOpaquenessTest() return false
1618         when the content has any non-zero scroll offset.
1619
1620         Tests: compositing/contents-opaque/opaque-with-scrolled.html
1621                fast/backgrounds/opaque-scrolled-paint-background.html
1622
1623         * rendering/RenderBox.cpp:
1624         (WebCore::isCandidateForOpaquenessTest):
1625
1626 2015-01-14  Jer Noble  <jer.noble@apple.com>
1627
1628         [Mac][MSE] Stalled YouTube playback does not allow display to sleep.
1629         https://bugs.webkit.org/show_bug.cgi?id=140468
1630         rdar://problem/19171162
1631
1632         Reviewed by Eric Carlson.
1633
1634         Test: media/media-source/media-source-stalled-holds-sleep-assertion.html
1635
1636         The unstated convention of MediaPlayerPrivate::paused() is that implementations should 
1637         return 'true' if the playback rate is 0. However, MediaPlayerPrivateMediaSourceAVFObjC
1638         was returning 'false' if it was supposed to be playing, regardless of the actual rate.
1639         This caused a check in HTMLMediaElement of whether to release the sleep assertion token
1640         to fail, thinking the media engine was still playing.
1641
1642         Add some testing infrastructure to allow us to test whether the media element is disabling
1643         display sleep from within layout tests.
1644
1645         * html/HTMLMediaElement.h:
1646         (WebCore::HTMLMediaElement::isDisablingSleep):
1647         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1648         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paused):
1649         * testing/Internals.cpp:
1650         (WebCore::Internals::elementIsBlockingDisplaySleep):
1651         * testing/Internals.h:
1652         * testing/Internals.idl:
1653
1654 2015-01-14  Zalan Bujtas  <zalan@apple.com>
1655
1656         Move LayoutFragment and ClipRect to their own files.
1657         https://bugs.webkit.org/show_bug.cgi?id=140457
1658
1659         Reviewed by Simon Fraser.
1660
1661         Move these classes to their own files to to make RenderLayer.h less heavy.
1662
1663         No change in functionality.
1664
1665         * WebCore.xcodeproj/project.pbxproj:
1666         * rendering/ClipRect.cpp: Added.
1667         (WebCore::ClipRect::intersects):
1668         * rendering/ClipRect.h: Added.
1669         (WebCore::ClipRect::ClipRect):
1670         (WebCore::ClipRect::rect):
1671         (WebCore::ClipRect::setRect):
1672         (WebCore::ClipRect::affectedByRadius):
1673         (WebCore::ClipRect::setAffectedByRadius):
1674         (WebCore::ClipRect::operator==):
1675         (WebCore::ClipRect::operator!=):
1676         (WebCore::ClipRect::intersect):
1677         (WebCore::ClipRect::move):
1678         (WebCore::ClipRect::moveBy):
1679         (WebCore::ClipRect::isEmpty):
1680         (WebCore::ClipRect::intersects):
1681         (WebCore::ClipRect::inflateX):
1682         (WebCore::ClipRect::inflateY):
1683         (WebCore::ClipRect::inflate):
1684         (WebCore::intersection):
1685         * rendering/LayerFragment.h: Added.
1686         (WebCore::LayerFragment::setRects):
1687         (WebCore::LayerFragment::moveBy):
1688         (WebCore::LayerFragment::intersect):
1689         * rendering/RenderFlowThread.h:
1690         * rendering/RenderLayer.cpp:
1691         (WebCore::ClipRect::intersects): Deleted.
1692         * rendering/RenderLayer.h:
1693         (WebCore::ClipRect::ClipRect): Deleted.
1694         (WebCore::ClipRect::rect): Deleted.
1695         (WebCore::ClipRect::setRect): Deleted.
1696         (WebCore::ClipRect::affectedByRadius): Deleted.
1697         (WebCore::ClipRect::setAffectedByRadius): Deleted.
1698         (WebCore::ClipRect::operator==): Deleted.
1699         (WebCore::ClipRect::operator!=): Deleted.
1700         (WebCore::ClipRect::intersect): Deleted.
1701         (WebCore::ClipRect::move): Deleted.
1702         (WebCore::ClipRect::moveBy): Deleted.
1703         (WebCore::ClipRect::isEmpty): Deleted.
1704         (WebCore::ClipRect::intersects): Deleted.
1705         (WebCore::ClipRect::inflateX): Deleted.
1706         (WebCore::ClipRect::inflateY): Deleted.
1707         (WebCore::ClipRect::inflate): Deleted.
1708         (WebCore::intersection): Deleted.
1709         (WebCore::LayerFragment::LayerFragment): Deleted.
1710         (WebCore::LayerFragment::setRects): Deleted.
1711         (WebCore::LayerFragment::moveBy): Deleted.
1712         (WebCore::LayerFragment::intersect): Deleted.
1713         * rendering/RenderMultiColumnSet.h:
1714         * rendering/RenderRegion.h:
1715         * rendering/RenderTreeAsText.cpp:
1716
1717 2015-01-14  Commit Queue  <commit-queue@webkit.org>
1718
1719         Unreviewed, rolling out r178438.
1720         https://bugs.webkit.org/show_bug.cgi?id=140484
1721
1722         Broke a few MediaSource tests (Requested by JoePeck on
1723         #webkit).
1724
1725         Reverted changeset:
1726
1727         "[MSE] Implement per TrackBuffer buffered."
1728         https://bugs.webkit.org/show_bug.cgi?id=139813
1729         http://trac.webkit.org/changeset/178438
1730
1731 2015-01-14  Enrica Casucci  <enrica@apple.com>
1732
1733         REGRESSION (r165385): Crash when applying autocorrection exceeds maximum text area length.
1734         https://bugs.webkit.org/show_bug.cgi?id=137902
1735         rdar://problem/18568864
1736
1737         Reviewed by Darin Adler.
1738
1739         Test: editing/text-iterator/invalid-subrange.html
1740
1741         characterSubrange should check the iterator position after each advance.
1742         This changed adds a new method to the Internals object to be able to test this.
1743
1744         * editing/TextIterator.cpp:
1745         (WebCore::characterSubrange):
1746         (WebCore::TextIterator::subrange):
1747         (WebCore::findPlainText):
1748         * testing/Internals.cpp:
1749         (WebCore::Internals::subrange):
1750         * testing/Internals.h:
1751         * testing/Internals.idl:
1752
1753 2015-01-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
1754
1755         REGRESSION (r154769): Wrong <title> taken as a tooltip for SVG element.
1756         https://bugs.webkit.org/show_bug.cgi?id=139690.
1757
1758         Reviewed by Daniel Bates.
1759
1760         Before r154769, we were calling Traversal<SVGTitleElement>::firstWithin(), which returns
1761         the first immediate SVGTitleElement child. In r154769, Traversal<SVGTitleElement>::firstWithin()
1762         was replaced by descendantsOfType<SVGTitleElement> which returns all descendants SVGTitleElements.
1763         Then we were returning the first element of these descendants, which may not be an immediate
1764         child of the element, as the title of the SVGElement. This was the reason of this bug. The
1765         fix is to use childrenOfType<SVGTitleElement>() instead, which returns the immediate SVGTitleElement
1766         children of an SVGElement.
1767
1768         Also we were not following exactly the specs for the rootmost SVG element's title value.
1769         According to the W3C specs, for stand-alone SVG documents only, the rootmost SVG element
1770         should not return a title. But we were not returning a title for the rootmost SVG element
1771         always. The fix is to return a empty title for the rootmost SVG element only if topDocument()
1772         of the element isSVGDocument().
1773         
1774         NOTE: The main SVG specs http://www.w3.org/TR/SVG/interact.html#hit-testing (W3C Recommendation
1775         16 August 2011) and http://www.w3.org/TR/SVG/struct.html#DescriptionAndTitleElements (W3C
1776         Recommendation 16 August 2011) do not say how the tooltip of an SVG element is calculated. But
1777         the SVG tiny specs http://www.w3.org/TR/SVGTiny12/struct.html#uiTitleDescBehavior (W3C
1778         Recommendation 22 December 2008) however explains well the tooltip calculation for the embedded
1779         and the stand-alone SVG cases. And it seems this what we should rely on.
1780
1781         Test: svg/hittest/svg-standalone-tooltip.svg
1782               svg/hittest/svg-embedded-tooltip.html
1783
1784         * WebCore.exp.in:
1785         * rendering/HitTestResult.h:
1786         Make HitTestResult::setInnerNode be WEBCORE_EXPORT
1787         
1788         * svg/SVGElement.cpp:
1789         (WebCore::SVGElement::title):
1790         Replace descendantsOfType<SVGTitleElement>() by childrenOfType<SVGTitleElement>().
1791         Fix the title value of the rootmost SVG element.
1792         
1793         * testing/Internals.cpp:
1794         (WebCore::Internals::toolTipFromElement):
1795         * testing/Internals.h:
1796         * testing/Internals.idl:
1797         Add a new internal function toolTipFromElement() which returns the tooltip text for a
1798         given element.
1799
1800 2015-01-14  Csaba Osztrogonác  <ossy@webkit.org>
1801
1802         Buildfix after r178434
1803         https://bugs.webkit.org/show_bug.cgi?id=140467
1804
1805         Reviewed by Chris Dumez.
1806
1807         * css/StyleBuilderConverter.h:
1808         (WebCore::StyleBuilderConverter::convertPerspective):
1809
1810 2015-01-14  Benjamin Poulain  <bpoulain@apple.com>
1811
1812         Build fix for NFAToDFA on ARM
1813
1814         * contentextensions/NFAToDFA.cpp:
1815         (WebCore::ContentExtensions::UniqueNodeIdSet::UniqueNodeIdSet):
1816         (WebCore::ContentExtensions::UniqueNodeIdSet::isDeletedValue):
1817
1818 2015-01-14  Bartlomiej Gajda  <b.gajda@samsung.com>
1819
1820         [MSE] Implement per TrackBuffer buffered.
1821         https://bugs.webkit.org/show_bug.cgi?id=139813.
1822
1823         Reviewed by Jer Noble.
1824
1825         Added implementation of SourceBuffer buffered() algorithm as per specification,
1826         and caching mechanism called when samples are added, removed, or MediaSource
1827         readyState is changed.
1828
1829         Tests: media/media-source/media-source-multiple-trackBuffers-buffered-in-ended-state.html
1830                media/media-source/media-source-multiple-trackBuffers-buffered.html
1831
1832         * Modules/mediasource/MediaSource.cpp:
1833         (WebCore::MediaSource::setReadyState):
1834         * Modules/mediasource/SourceBuffer.cpp:
1835         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer):
1836         (WebCore::SourceBuffer::SourceBuffer):
1837         (WebCore::SourceBuffer::buffered):
1838         (WebCore::SourceBuffer::invalidateBuffered):
1839         (WebCore::SourceBuffer::recalculateBuffered):
1840         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
1841         (WebCore::SourceBuffer::removeCodedFrames):
1842         (WebCore::SourceBuffer::evictCodedFrames):
1843         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1844         (WebCore::SourceBuffer::bufferedAccountingForEndOfStream):
1845         (WebCore::SourceBuffer::hasCurrentTime):
1846         * Modules/mediasource/SourceBuffer.h:
1847
1848 2015-01-14  Benjamin Poulain  <benjamin@webkit.org>
1849
1850         Do not create new set for every sub-operation when converting a NFA to DFA
1851         https://bugs.webkit.org/show_bug.cgi?id=140380
1852
1853         Reviewed by Andreas Kling.
1854
1855         This is the first step toward making the NFA-to-DFA conversion more scalable: instead
1856         of creating new sets for each step of the algorithm, we use two kinds of sets
1857         and never do any copy.
1858
1859         The first new tool to do that is UniqueNodeIdSetImpl. It represents a set of NFA state corresponding to a DFA
1860         state. It is unique per DFA state.
1861
1862         HashableNodeIdSet is a helper tool storing a UniqueNodeIdSetImpl.
1863
1864         The creation of new sets now goes like this:
1865         1) Get a NodeIdSet for each possible transition.
1866         2) For each transition:
1867            2a) Extend the NodeIdSet in place with its epsilon closure.
1868            2b) Get the UniqueNodeIdSetImpl corresponding to the new set we discovered.
1869            2c) If the UniqueNodeIdSetImpl is new, queue it for processing.
1870
1871         * WebCore.xcodeproj/project.pbxproj:
1872         * contentextensions/ContentExtensionsDebugging.h: Copied from Source/WebCore/contentextensions/DFANode.h.
1873         * contentextensions/ContentExtensionsBackend.cpp:
1874         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
1875         * contentextensions/ContentExtensionsManager.cpp:
1876         (WebCore::ContentExtensions::ExtensionsManager::loadExtension):
1877         Added some logging to inspect more easily what the clients are sending.
1878
1879         * contentextensions/DFA.cpp:
1880         * contentextensions/DFA.h:
1881         * contentextensions/DFANode.h:
1882         * contentextensions/NFA.cpp:
1883         * contentextensions/NFA.h:
1884         * contentextensions/NFAToDFA.cpp:
1885
1886         (WebCore::ContentExtensions::epsilonClosure):
1887         Instead of returning a new HashSet, extend the input HashSet.
1888
1889         (WebCore::ContentExtensions::UniqueNodeIdSetImpl::buffer):
1890         (WebCore::ContentExtensions::UniqueNodeIdSet::UniqueNodeIdSet):
1891         (WebCore::ContentExtensions::UniqueNodeIdSet::operator=):
1892         (WebCore::ContentExtensions::UniqueNodeIdSet::~UniqueNodeIdSet):
1893         (WebCore::ContentExtensions::UniqueNodeIdSet::operator==):
1894         (WebCore::ContentExtensions::UniqueNodeIdSet::impl):
1895         (WebCore::ContentExtensions::UniqueNodeIdSet::hash):
1896         (WebCore::ContentExtensions::UniqueNodeIdSet::isEmptyValue):
1897         (WebCore::ContentExtensions::UniqueNodeIdSet::isDeletedValue):
1898         (WebCore::ContentExtensions::UniqueNodeIdSetHash::hash):
1899         (WebCore::ContentExtensions::UniqueNodeIdSetHash::equal):
1900         UniqueNodeIdSetImpl is a compact representation of a NodeIdSet corresponding to a DFA node.
1901
1902         It is never built directly, it is only built on demand through NodeIdSetToUniqueNodeIdSetTranslator
1903         from a NodeIdSet.
1904
1905         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource):
1906         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::hash):
1907         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::equal):
1908         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate):
1909         (WebCore::ContentExtensions::SetTransitionsExcludingEpsilon::operator[]):
1910         (WebCore::ContentExtensions::SetTransitionsExcludingEpsilon::size):
1911         (WebCore::ContentExtensions::SetTransitionsExcludingEpsilon::begin):
1912         (WebCore::ContentExtensions::SetTransitionsExcludingEpsilon::end):
1913         (WebCore::ContentExtensions::populateTransitionsExcludingEpsilon):
1914         (WebCore::ContentExtensions::NFAToDFA::convert):
1915         (WebCore::ContentExtensions::setTransitionsExcludingEpsilon): Deleted.
1916         (WebCore::ContentExtensions::HashableNodeIdSet::HashableNodeIdSet): Deleted.
1917         (WebCore::ContentExtensions::HashableNodeIdSet::operator=): Deleted.
1918         (WebCore::ContentExtensions::HashableNodeIdSet::isEmptyValue): Deleted.
1919         (WebCore::ContentExtensions::HashableNodeIdSet::isDeletedValue): Deleted.
1920         (WebCore::ContentExtensions::HashableNodeIdSet::nodeIdSet): Deleted.
1921         (WebCore::ContentExtensions::HashableNodeIdSetHash::hash): Deleted.
1922         (WebCore::ContentExtensions::HashableNodeIdSetHash::equal): Deleted.
1923         (WebCore::ContentExtensions::addDFAState): Deleted.
1924
1925 2015-01-14  Chris Dumez  <cdumez@apple.com>
1926
1927         Make 'TypeName' parameter unnecessary in CSSPropertyNames.in
1928         https://bugs.webkit.org/show_bug.cgi?id=140347
1929
1930         Reviewed by Darin Adler.
1931
1932         Make 'TypeName' parameter unnecessary in CSSPropertyNames.in by:
1933         - Removing the static_cast to the destination type in the generated
1934           StyleBuilder code and let compiler implicitly convert the
1935           CSSPrimitiveValue to the setter's argument type.
1936         - Updating conditional converters to return a WTF::Optional<>
1937           instead of returning a boolean and having an output argument
1938           passed by reference. This way, we can use "auto" in the generated
1939           StyleBuilder code to deduce the return type.
1940
1941         * css/CSSPropertyNames.in:
1942         Drop TypeName parameter from all properties as it is no longer needed.
1943
1944         * css/StyleBuilderConverter.h:
1945         (WebCore::StyleBuilderConverter::convertGridTrackSize):
1946         (WebCore::StyleBuilderConverter::convertGridPosition):
1947         (WebCore::StyleBuilderConverter::convertWordSpacing):
1948         (WebCore::StyleBuilderConverter::convertPerspective):
1949         (WebCore::StyleBuilderConverter::convertMarqueeIncrement):
1950         (WebCore::StyleBuilderConverter::convertFilterOperations):
1951         (WebCore::StyleBuilderConverter::convertMaskImageOperations):
1952         Update conditional converters to return an Optional<>.
1953
1954         * css/makeprop.pl:
1955         (generateValueSetter):
1956         Drop support for TypeName, stop using static_cast to destination
1957         type and update the generated code now that the conditional
1958         converters return an Optional.
1959
1960         * platform/efl/RenderThemeEfl.cpp:
1961         (WebCore::RenderThemeEfl::systemFont):
1962         * platform/graphics/Font.cpp:
1963         (WebCore::Font::Font):
1964         * platform/graphics/FontDescription.h:
1965         (WebCore::FontDescription::setIsItalic):
1966         (WebCore::FontDescription::setIsSmallCaps):
1967         (WebCore::FontDescription::setItalic): Deleted.
1968         (WebCore::FontDescription::setSmallCaps): Deleted.
1969         * rendering/RenderThemeGtk.cpp:
1970         (WebCore::RenderThemeGtk::systemFont):
1971         * rendering/RenderThemeIOS.mm:
1972         (WebCore::RenderThemeIOS::systemFont):
1973         * rendering/RenderThemeMac.mm:
1974         (WebCore::RenderThemeMac::systemFont):
1975         * rendering/RenderThemeSafari.cpp:
1976         (WebCore::RenderThemeSafari::systemFont):
1977         * rendering/RenderThemeWin.cpp:
1978         (WebCore::fillFontDescription):
1979         * rendering/mathml/RenderMathMLToken.cpp:
1980         (WebCore::RenderMathMLToken::updateStyle):
1981         Now that we call the RenderStyle setters with a CSSPrimitiveValue
1982         and let it be implicitly converted to the right type, instead of
1983         doing an explicit static_cast, two setters on FontDescription
1984         were ambiguous: setItalic() / setSmallCaps(). Rename the overloads
1985         taking a boolean in argument to setIsItalic() / setIsSmallCaps()
1986         to resolve the ambiguity.
1987
1988 2015-01-14  Jer Noble  <jer.noble@apple.com>
1989
1990         Null-deref crash when seeking immediately before looping.
1991         https://bugs.webkit.org/show_bug.cgi?id=140394
1992
1993         Reviewed by Eric Carlson.
1994
1995         It is possible for finishSeek() to be called when a seek() has caused a pending seek task
1996         to be scheduled, but before that pending seek task is run. In this case, if a seek request
1997         is issued, the existing pending seek task will not be cancelled, which will cause a crash
1998         when the pending seek task is run.
1999
2000         When checking whether an existing seek task needs to be cancelled, check the actual timer,
2001         rather than the m_seeking boolean, so that this case is covered.
2002
2003         Test: media/video-ended-seek-crash.html
2004
2005         * html/HTMLMediaElement.cpp:
2006         (WebCore::HTMLMediaElement::seekWithTolerance):
2007
2008 2015-01-14  Brent Fulgham  <bfulgham@apple.com>
2009
2010         [Win] Layout Test fast/css/crash-on-custom-cursor-when-loading.html is failing
2011         https://bugs.webkit.org/show_bug.cgi?id=140425
2012
2013         Reviewed by Anders Carlsson.
2014
2015         * platform/win/CursorWin.cpp:
2016         (WebCore::createSharedCursor): Return nullptr when operating system
2017         cannot support the requested icon specification.
2018         (WebCore::Cursor::ensurePlatformCursor): Check for 'createSharedCursor'
2019         returning nullptr, and fall back to the default icon construction.
2020
2021 2015-01-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2022
2023         REGRESSION(r178367): [GStreamer] Several media tests time out after r178367
2024         https://bugs.webkit.org/show_bug.cgi?id=140437
2025
2026         Reviewed by Philippe Normand.
2027
2028         Add implementation for MediaPlayerPrivate::rate() to GStreamer
2029         media backend.
2030
2031         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2032         (WebCore::MediaPlayerPrivateGStreamer::rate):
2033         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2034
2035 2015-01-13  Commit Queue  <commit-queue@webkit.org>
2036
2037         Unreviewed, rolling out r178390, r178392, r178398, r178400,
2038         r178402, and r178410.
2039         https://bugs.webkit.org/show_bug.cgi?id=140431
2040
2041         Way too many failures to skip (Requested by ap_ on #webkit).
2042
2043         Reverted changesets:
2044
2045         "WebGL2: Support webgl2 context creation."
2046         https://bugs.webkit.org/show_bug.cgi?id=126408
2047         http://trac.webkit.org/changeset/178390
2048
2049         "Unreviewed iOS build fix after r178390."
2050         http://trac.webkit.org/changeset/178392
2051
2052         "[Unreviewed] Windows build fix after r178390."
2053         http://trac.webkit.org/changeset/178398
2054
2055         "[Unreviewed] Speculative test fix after r178390."
2056         http://trac.webkit.org/changeset/178400
2057
2058         "[Unreviewed] Skip webgl tests for temporarily."
2059         https://bugs.webkit.org/show_bug.cgi?id=140423
2060         http://trac.webkit.org/changeset/178402
2061
2062         "[EFL] Fix build after r178390"
2063         https://bugs.webkit.org/show_bug.cgi?id=140424
2064         http://trac.webkit.org/changeset/178410
2065
2066 2015-01-13  Hunseop Jeong  <hs85.jeong@samsung.com>
2067
2068         [EFL] Fix build after r178390 
2069         https://bugs.webkit.org/show_bug.cgi?id=140424
2070
2071         Reviewed by Csaba Osztrogonác.
2072
2073         * CMakeLists.txt: 
2074
2075 2015-01-13  Zalan Bujtas  <zalan@apple.com>
2076
2077         Simple line layout: Refactor TextFragment class.
2078         https://bugs.webkit.org/show_bug.cgi?id=140417
2079
2080         Reviewed by Andreas Kling.
2081
2082         Introduce text fragment type and use class member initializers.
2083
2084         No change in functionality.
2085
2086         * rendering/SimpleLineLayout.cpp:
2087         (WebCore::SimpleLineLayout::TextFragment::TextFragment):
2088         (WebCore::SimpleLineLayout::LineState::addUncommitted):
2089         (WebCore::SimpleLineLayout::removeTrailingWhitespace):
2090         (WebCore::SimpleLineLayout::nextFragment):
2091         (WebCore::SimpleLineLayout::createLineRuns):
2092
2093 2015-01-13  Commit Queue  <commit-queue@webkit.org>
2094
2095         Unreviewed, rolling out r178400.
2096         https://bugs.webkit.org/show_bug.cgi?id=140422
2097
2098         Test fix breaks build (Requested by rfong on #webkit).
2099
2100         Reverted changeset:
2101
2102         "[Unreviewed] Speculative test fix after r178390."
2103         http://trac.webkit.org/changeset/178400
2104
2105 2015-01-13  Roger Fong  <roger_fong@apple.com>
2106
2107         [Unreviewed] Speculative test fix after r178390.
2108
2109         * html/canvas/WebGL1RenderingContext.idl:
2110
2111 2015-01-13  Roger Fong  <roger_fong@apple.com>
2112
2113         [Unreviewed] Windows build fix after r178390.
2114
2115         * DerivedSources.cpp:
2116         * WebCore.vcxproj/WebCore.vcxproj:
2117         * WebCore.vcxproj/WebCore.vcxproj.filters:
2118         * bindings/js/JSBindingsAllInOne.cpp:
2119         * html/canvas/WebGLRenderingContextBase.cpp:
2120         (WebCore::WebGLRenderingContextBase::create):
2121
2122 2015-01-13  Joseph Pecoraro  <pecoraro@apple.com>
2123
2124         NSButtonCell leak allocated under WebCore::paintToggleButton
2125         https://bugs.webkit.org/show_bug.cgi?id=137014
2126
2127         Reviewed by Alexey Proskuryakov.
2128
2129         * platform/mac/ThemeMac.mm:
2130         (WebCore::createToggleButtonCell):
2131         Immediately adopt the NSButtonCell allocation.
2132
2133         (WebCore::sharedRadioCell):
2134         (WebCore::sharedCheckboxCell):
2135         Move from the RetainPtr into the static variable.
2136
2137         (WebCore::paintToggleButton):
2138         Use RetainPtr logic to better manage lifetimes.
2139
2140 2015-01-13  Zalan Bujtas  <zalan@apple.com>
2141
2142         Simple line layout: Refactor SimpleLineLayout::nextFragment().
2143         https://bugs.webkit.org/show_bug.cgi?id=140407
2144
2145         Reviewed by Andreas Kling.
2146
2147         Simplify the code by using content specific branches with early returns.
2148
2149         No change in functionality.
2150
2151         * rendering/SimpleLineLayout.cpp:
2152         (WebCore::SimpleLineLayout::nextFragment):
2153
2154 2015-01-13  Chris Dumez  <cdumez@apple.com>
2155
2156         Unreviewed iOS build fix after r178390.
2157
2158         * html/canvas/CanvasRenderingContext2D.cpp:
2159         (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
2160         m_type is undeclared.
2161
2162         * html/canvas/WebGLContextGroup.h:
2163         Fix bad include.
2164
2165 2015-01-13  Roger Fong  <roger_fong@apple.com>
2166
2167         WebGL2: Support webgl2 context creation.
2168         https://bugs.webkit.org/show_bug.cgi?id=126408
2169         <rdar://problem/15002170>
2170
2171         Reviewed by Dean Jackson.
2172
2173         Tests covered by existing Khronos tests for WebGL 1.0 conformance.
2174
2175         Create a WebGLRenderingContextBase class that extends to a WebGL1RenderingContext and WebGL2RenderingContext.
2176         Replace all previous instances of WebGLRenderingContext usages with WebGLRenderingContextBase usages for now.
2177         As the first step, the WebGL1 and WebGL2 contexts will have the exact same functionality.
2178
2179         * CMakeLists.txt:
2180         * DerivedSources.make:
2181         * WebCore.xcodeproj/project.pbxproj:
2182         * bindings/js/JSCanvasRenderingContextCustom.cpp:
2183         (WebCore::toJS):
2184         * bindings/js/JSDocumentCustom.cpp:
2185         * bindings/js/JSHTMLCanvasElementCustom.cpp:
2186         * bindings/js/JSWebGL1RenderingContextCustom.cpp: Copied from Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp.
2187         * bindings/js/JSWebGL2RenderingContextCustom.cpp: Added.
2188         (WebCore::JSWebGL2RenderingContext::visitAdditionalChildren):
2189         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp: Added.
2190         * bindings/js/JSWebGLRenderingContextCustom.cpp: Removed.
2191         * bindings/scripts/CodeGeneratorJS.pm:
2192         (GenerateImplementation):
2193         * html/HTMLCanvasElement.cpp:
2194         (WebCore::HTMLCanvasElement::getContext):
2195         (WebCore::HTMLCanvasElement::is3dType):
2196         (WebCore::HTMLCanvasElement::reset):
2197         (WebCore::HTMLCanvasElement::paint):
2198         (WebCore::HTMLCanvasElement::getImageData):
2199         * html/canvas/ANGLEInstancedArrays.cpp:
2200         (WebCore::ANGLEInstancedArrays::ANGLEInstancedArrays):
2201         (WebCore::ANGLEInstancedArrays::supported):
2202         * html/canvas/ANGLEInstancedArrays.h:
2203         * html/canvas/CanvasRenderingContext.h:
2204         (WebCore::CanvasRenderingContext::type):
2205         * html/canvas/CanvasRenderingContext2D.cpp:
2206         (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
2207         * html/canvas/EXTBlendMinMax.cpp:
2208         (WebCore::EXTBlendMinMax::EXTBlendMinMax):
2209         * html/canvas/EXTBlendMinMax.h:
2210         * html/canvas/EXTFragDepth.cpp:
2211         (WebCore::EXTFragDepth::EXTFragDepth):
2212         * html/canvas/EXTFragDepth.h:
2213         * html/canvas/EXTShaderTextureLOD.cpp:
2214         (WebCore::EXTShaderTextureLOD::EXTShaderTextureLOD):
2215         * html/canvas/EXTShaderTextureLOD.h:
2216         * html/canvas/EXTTextureFilterAnisotropic.cpp:
2217         (WebCore::EXTTextureFilterAnisotropic::EXTTextureFilterAnisotropic):
2218         * html/canvas/EXTTextureFilterAnisotropic.h:
2219         * html/canvas/EXTsRGB.cpp:
2220         (WebCore::EXTsRGB::EXTsRGB):
2221         * html/canvas/EXTsRGB.h:
2222         * html/canvas/OESElementIndexUint.cpp:
2223         (WebCore::OESElementIndexUint::OESElementIndexUint):
2224         * html/canvas/OESElementIndexUint.h:
2225         * html/canvas/OESStandardDerivatives.cpp:
2226         (WebCore::OESStandardDerivatives::OESStandardDerivatives):
2227         * html/canvas/OESStandardDerivatives.h:
2228         * html/canvas/OESTextureFloat.cpp:
2229         (WebCore::OESTextureFloat::OESTextureFloat):
2230         * html/canvas/OESTextureFloat.h:
2231         * html/canvas/OESTextureFloatLinear.cpp:
2232         (WebCore::OESTextureFloatLinear::OESTextureFloatLinear):
2233         * html/canvas/OESTextureFloatLinear.h:
2234         * html/canvas/OESTextureHalfFloat.cpp:
2235         (WebCore::OESTextureHalfFloat::OESTextureHalfFloat):
2236         * html/canvas/OESTextureHalfFloat.h:
2237         * html/canvas/OESTextureHalfFloatLinear.cpp:
2238         (WebCore::OESTextureHalfFloatLinear::OESTextureHalfFloatLinear):
2239         * html/canvas/OESTextureHalfFloatLinear.h:
2240         * html/canvas/OESVertexArrayObject.cpp:
2241         (WebCore::OESVertexArrayObject::OESVertexArrayObject):
2242         * html/canvas/OESVertexArrayObject.h:
2243         * html/canvas/WebGL1RenderingContext.cpp: Copied from Source/WebCore/html/canvas/WebGLRenderingContext.cpp.
2244         * html/canvas/WebGL1RenderingContext.h: Copied from Source/WebCore/html/canvas/WebGLRenderingContext.h.
2245         * html/canvas/WebGL1RenderingContext.idl: Copied from Source/WebCore/html/canvas/WebGLRenderingContext.idl.
2246         * html/canvas/WebGL2RenderingContext.cpp: Added.
2247         (WebCore::WebGL2RenderingContext::WebGL2RenderingContext):
2248         * html/canvas/WebGL2RenderingContext.h: Added.
2249         * html/canvas/WebGL2RenderingContext.idl: Added.
2250         * html/canvas/WebGLBuffer.cpp:
2251         (WebCore::WebGLBuffer::create):
2252         (WebCore::WebGLBuffer::WebGLBuffer):
2253         * html/canvas/WebGLBuffer.h:
2254         * html/canvas/WebGLCompressedTextureATC.cpp:
2255         (WebCore::WebGLCompressedTextureATC::WebGLCompressedTextureATC):
2256         (WebCore::WebGLCompressedTextureATC::supported):
2257         * html/canvas/WebGLCompressedTextureATC.h:
2258         * html/canvas/WebGLCompressedTexturePVRTC.cpp:
2259         (WebCore::WebGLCompressedTexturePVRTC::WebGLCompressedTexturePVRTC):
2260         (WebCore::WebGLCompressedTexturePVRTC::supported):
2261         * html/canvas/WebGLCompressedTexturePVRTC.h:
2262         * html/canvas/WebGLCompressedTextureS3TC.cpp:
2263         (WebCore::WebGLCompressedTextureS3TC::WebGLCompressedTextureS3TC):
2264         (WebCore::WebGLCompressedTextureS3TC::supported):
2265         * html/canvas/WebGLCompressedTextureS3TC.h:
2266         * html/canvas/WebGLContextGroup.cpp:
2267         (WebCore::WebGLContextGroup::getAGraphicsContext3D):
2268         (WebCore::WebGLContextGroup::addContext):
2269         (WebCore::WebGLContextGroup::removeContext):
2270         (WebCore::WebGLContextGroup::loseContextGroup):
2271         * html/canvas/WebGLContextGroup.h:
2272         * html/canvas/WebGLContextObject.cpp:
2273         (WebCore::WebGLContextObject::WebGLContextObject):
2274         * html/canvas/WebGLContextObject.h:
2275         (WebCore::WebGLContextObject::context):
2276         * html/canvas/WebGLDebugRendererInfo.cpp:
2277         (WebCore::WebGLDebugRendererInfo::WebGLDebugRendererInfo):
2278         * html/canvas/WebGLDebugRendererInfo.h:
2279         * html/canvas/WebGLDebugShaders.cpp:
2280         (WebCore::WebGLDebugShaders::WebGLDebugShaders):
2281         * html/canvas/WebGLDebugShaders.h:
2282         * html/canvas/WebGLDepthTexture.cpp:
2283         (WebCore::WebGLDepthTexture::WebGLDepthTexture):
2284         * html/canvas/WebGLDepthTexture.h:
2285         * html/canvas/WebGLDrawBuffers.cpp:
2286         (WebCore::WebGLDrawBuffers::WebGLDrawBuffers):
2287         (WebCore::WebGLDrawBuffers::supported):
2288         (WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements):
2289         * html/canvas/WebGLDrawBuffers.h:
2290         * html/canvas/WebGLExtension.cpp:
2291         (WebCore::WebGLExtension::WebGLExtension):
2292         * html/canvas/WebGLExtension.h:
2293         (WebCore::WebGLExtension::context):
2294         * html/canvas/WebGLFramebuffer.cpp:
2295         (WebCore::WebGLFramebuffer::create):
2296         (WebCore::WebGLFramebuffer::WebGLFramebuffer):
2297         * html/canvas/WebGLFramebuffer.h:
2298         * html/canvas/WebGLLoseContext.cpp:
2299         (WebCore::WebGLLoseContext::WebGLLoseContext):
2300         (WebCore::WebGLLoseContext::loseContext):
2301         * html/canvas/WebGLLoseContext.h:
2302         * html/canvas/WebGLObject.cpp:
2303         (WebCore::WebGLObject::WebGLObject):
2304         * html/canvas/WebGLObject.h:
2305         * html/canvas/WebGLProgram.cpp:
2306         (WebCore::WebGLProgram::create):
2307         (WebCore::WebGLProgram::WebGLProgram):
2308         * html/canvas/WebGLProgram.h:
2309         * html/canvas/WebGLRenderbuffer.cpp:
2310         (WebCore::WebGLRenderbuffer::create):
2311         (WebCore::WebGLRenderbuffer::WebGLRenderbuffer):
2312         * html/canvas/WebGLRenderbuffer.h:
2313         * html/canvas/WebGLRenderingContext.cpp: Removed.
2314         * html/canvas/WebGLRenderingContext.h: Removed.
2315         * html/canvas/WebGLRenderingContext.idl: Removed.
2316         * html/canvas/WebGLRenderingContextBase.cpp: Added.
2317         * html/canvas/WebGLRenderingContextBase.h: Added.
2318         * html/canvas/WebGLRenderingContextBase.idl: Added.
2319         * html/canvas/WebGLShader.cpp:
2320         (WebCore::WebGLShader::create):
2321         (WebCore::WebGLShader::WebGLShader):
2322         * html/canvas/WebGLShader.h:
2323         * html/canvas/WebGLSharedObject.cpp:
2324         (WebCore::WebGLSharedObject::WebGLSharedObject):
2325         * html/canvas/WebGLSharedObject.h:
2326         * html/canvas/WebGLTexture.cpp:
2327         (WebCore::WebGLTexture::create):
2328         (WebCore::WebGLTexture::WebGLTexture):
2329         * html/canvas/WebGLTexture.h:
2330         * html/canvas/WebGLVertexArrayObjectOES.cpp:
2331         (WebCore::WebGLVertexArrayObjectOES::create):
2332         (WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES):
2333         * html/canvas/WebGLVertexArrayObjectOES.h:
2334
2335 2015-01-13  Chris Dumez  <cdumez@apple.com>
2336
2337         Unreviewed, fix Mac build after r178388
2338
2339         FontRanges::isEmpty() -> FontRanges::isNull().
2340
2341         * platform/graphics/mac/FontComplexTextMac.cpp:
2342         (WebCore::Font::fontDataForCombiningCharacterSequence):
2343
2344 2015-01-13  Antti Koivisto  <antti@apple.com>
2345
2346         Devirtualize FontData
2347         https://bugs.webkit.org/show_bug.cgi?id=140390
2348
2349         Reviewed by Andreas Kling.
2350
2351         This patch removes the FontData base class and turns SegmentedFontData into a non-virtual FontRanges type.
2352
2353         SimpleFontData remains as is (without the base) and it can be renamed later to something more sensible.
2354
2355         * WebCore.exp.in:
2356         * WebCore.xcodeproj/project.pbxproj:
2357         * css/CSSFontSelector.cpp:
2358         (WebCore::CSSFontSelector::fontRangesForFamily):
2359         (WebCore::CSSFontSelector::fallbackFontDataAt):
2360         (WebCore::CSSFontSelector::getFontData): Deleted.
2361         (WebCore::CSSFontSelector::getFallbackFontData): Deleted.
2362         * css/CSSFontSelector.h:
2363         * css/CSSSegmentedFontFace.cpp:
2364         (WebCore::CSSSegmentedFontFace::pruneTable):
2365         (WebCore::appendFontDataWithInvalidUnicodeRangeIfLoading):
2366         (WebCore::CSSSegmentedFontFace::fontRanges):
2367         (WebCore::CSSSegmentedFontFace::loadFont):
2368         (WebCore::CSSSegmentedFontFace::getFontData): Deleted.
2369         * css/CSSSegmentedFontFace.h:
2370         * platform/graphics/Font.h:
2371         (WebCore::Font::fallbackRangesAt):
2372         (WebCore::Font::fontDataAt): Deleted.
2373         * platform/graphics/FontData.cpp: Removed.
2374         * platform/graphics/FontData.h: Removed.
2375         * platform/graphics/FontGlyphs.cpp:
2376         (WebCore::FontGlyphs::FontGlyphs):
2377         (WebCore::FontGlyphs::determinePitch):
2378         (WebCore::FontGlyphs::isLoadingCustomFonts):
2379         (WebCore::realizeNextFallback):
2380         (WebCore::FontGlyphs::realizeFallbackRangesAt):
2381         (WebCore::FontGlyphs::glyphDataForSystemFallback):
2382         (WebCore::FontGlyphs::glyphDataForVariant):
2383         (WebCore::FontGlyphs::glyphDataForNormalVariant):
2384         (WebCore::glyphPageFromFontRanges):
2385         (WebCore::FontGlyphs::glyphDataForCharacter):
2386         (WebCore::realizeNextFamily): Deleted.
2387         (WebCore::FontGlyphs::realizeFontDataAt): Deleted.
2388         (WebCore::glyphPageFromFontData): Deleted.
2389         * platform/graphics/FontGlyphs.h:
2390         (WebCore::FontGlyphs::primarySimpleFontData):
2391         * platform/graphics/FontRanges.cpp: Copied from Source/WebCore/platform/graphics/SegmentedFontData.cpp.
2392         (WebCore::FontRanges::FontRanges):
2393         (WebCore::FontRanges::~FontRanges):
2394         (WebCore::FontRanges::fontDataForCharacter):
2395         (WebCore::FontRanges::fontDataForFirstRange):
2396         (WebCore::FontRanges::isLoading):
2397         (WebCore::SegmentedFontData::SegmentedFontData): Deleted.
2398         (WebCore::SegmentedFontData::~SegmentedFontData): Deleted.
2399         (WebCore::SegmentedFontData::simpleFontDataForCharacter): Deleted.
2400         (WebCore::SegmentedFontData::simpleFontDataForFirstRange): Deleted.
2401         (WebCore::SegmentedFontData::isCustomFont): Deleted.
2402         (WebCore::SegmentedFontData::isLoading): Deleted.
2403         (WebCore::SegmentedFontData::isSegmented): Deleted.
2404         (WebCore::SegmentedFontData::description): Deleted.
2405         * platform/graphics/FontRanges.h: Copied from Source/WebCore/platform/graphics/SegmentedFontData.h.
2406         (WebCore::FontRanges::Range::Range):
2407         (WebCore::FontRanges::Range::from):
2408         (WebCore::FontRanges::Range::to):
2409         (WebCore::FontRanges::Range::fontData):
2410         (WebCore::FontRanges::isEmpty):
2411         (WebCore::FontRanges::appendRange):
2412         (WebCore::FontRanges::size):
2413         (WebCore::FontRanges::rangeAt):
2414         (WebCore::FontDataRange::FontDataRange): Deleted.
2415         (WebCore::FontDataRange::from): Deleted.
2416         (WebCore::FontDataRange::to): Deleted.
2417         (WebCore::FontDataRange::fontData): Deleted.
2418         (WebCore::SegmentedFontData::create): Deleted.
2419         (WebCore::SegmentedFontData::appendRange): Deleted.
2420         (WebCore::SegmentedFontData::numRanges): Deleted.
2421         (WebCore::SegmentedFontData::rangeAt): Deleted.
2422         (isType): Deleted.
2423         * platform/graphics/FontSelector.h:
2424         * platform/graphics/SegmentedFontData.cpp: Removed.
2425         * platform/graphics/SegmentedFontData.h: Removed.
2426         * platform/graphics/SimpleFontData.cpp:
2427         (WebCore::SimpleFontData::simpleFontDataForCharacter): Deleted.
2428         (WebCore::SimpleFontData::simpleFontDataForFirstRange): Deleted.
2429         (WebCore::SimpleFontData::isSegmented): Deleted.
2430         * platform/graphics/SimpleFontData.h:
2431         (WebCore::SimpleFontData::isCustomFont):
2432         (WebCore::SimpleFontData::isLoading):
2433         (isType): Deleted.
2434         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2435         (-[WebCascadeList initWithFont:character:]):
2436         (-[WebCascadeList objectAtIndex:]):
2437         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2438         * platform/graphics/mac/FontComplexTextMac.cpp:
2439         (WebCore::Font::fontDataForCombiningCharacterSequence):
2440
2441 2015-01-13  Dean Jackson  <dino@apple.com>
2442
2443         Filters aren't applied to elements in columns after the first
2444         https://bugs.webkit.org/show_bug.cgi?id=140331
2445
2446         Reviewed by Simon Fraser.
2447
2448         The important bits of this change came from Simon.
2449
2450         Filters and clipping were not taking columns into
2451         account when using their offset rectangles. The fix
2452         is to recalculate the rects if you're in such a
2453         situation.
2454
2455         Tests: fast/multicol/clip-in-columns.html
2456                fast/multicol/filter-in-columns.html
2457
2458         * rendering/RenderLayer.cpp:
2459         (WebCore::RenderLayer::hasFilterThatIsPainting): New method used
2460         to check if we're about to paint a filter.
2461         (WebCore::RenderLayer::setupFilters): Use the new helper if possible.
2462         (WebCore::RenderLayer::paintLayerContents): If we're in columns,
2463         and we either have a clip or a filter, recalculate the offset rectangles.
2464         * rendering/RenderLayer.h:
2465
2466 2015-01-13  Beth Dakin  <bdakin@apple.com>
2467
2468         Should disable immediate actions for iTunes
2469         https://bugs.webkit.org/show_bug.cgi?id=140405
2470         -and corresponding-
2471         rdar://problem/19461358
2472
2473         Reviewed by Tim Horton.
2474
2475         * WebCore.exp.in:
2476
2477 2015-01-13  Anders Carlsson  <andersca@apple.com>
2478
2479         Remove pure virtual functions from DatabaseBackendBase
2480         https://bugs.webkit.org/show_bug.cgi?id=140402
2481
2482         Reviewed by Sam Weinig.
2483
2484         Also change DatabaseBackendBase to Database in a couple of places.
2485
2486         * Modules/webdatabase/DatabaseBackendBase.cpp:
2487         (WebCore::DatabaseBackendBase::closeDatabase):
2488         (WebCore::DoneCreatingDatabaseOnExitCaller::~DoneCreatingDatabaseOnExitCaller):
2489         (WebCore::DatabaseBackendBase::performOpenAndVerify):
2490         (WebCore::DatabaseBackendBase::maximumSize):
2491         * Modules/webdatabase/DatabaseBackendBase.h:
2492         * Modules/webdatabase/DatabaseServer.cpp:
2493         (WebCore::DatabaseServer::createDatabase):
2494         * Modules/webdatabase/DatabaseTracker.cpp:
2495         (WebCore::DatabaseTracker::getMaxSizeForDatabase):
2496         (WebCore::DatabaseTracker::doneCreatingDatabase):
2497         (WebCore::DatabaseTracker::addOpenDatabase):
2498         (WebCore::DatabaseTracker::removeOpenDatabase):
2499         (WebCore::DatabaseTracker::getOpenDatabases):
2500         (WebCore::DatabaseTracker::deleteDatabaseFile):
2501         * Modules/webdatabase/DatabaseTracker.h:
2502
2503 2015-01-13  Joseph Pecoraro  <pecoraro@apple.com>
2504
2505         Web Inspector: Remove unused ResizeImage and DecodeImageData timeline events
2506         https://bugs.webkit.org/show_bug.cgi?id=140404
2507
2508         Reviewed by Timothy Hatcher.
2509
2510         * inspector/InspectorTimelineAgent.cpp:
2511         (WebCore::toProtocol):
2512         * inspector/InspectorTimelineAgent.h:
2513         * inspector/TimelineRecordFactory.cpp:
2514         (WebCore::TimelineRecordFactory::createDecodeImageData): Deleted.
2515         (WebCore::TimelineRecordFactory::createResizeImageData): Deleted.
2516         * inspector/TimelineRecordFactory.h:
2517
2518 2015-01-13  Jer Noble  <jer.noble@apple.com>
2519
2520         defaultPlaybackRate not respected when set before source is loaded
2521         https://bugs.webkit.org/show_bug.cgi?id=140282
2522
2523         Reviewed by Eric Carlson.
2524
2525         Test: media/video-defaultplaybackrate-before-load.html
2526
2527         When the HTMLMediaElement is notified that the media player's rate has changed, it asks
2528         for the rate from MediaPlayer. However, MediaPlayer never requests the playback rate
2529         from the underlying MediaPlayerPrivate; it just returns the last rate which was set, or
2530         1 if no rate was set. HTMLMediaElement then sets its playbackRate to the returned
2531         value. So the end result is that the value from defaultPlaybackRate is overwritten by
2532         the default value of 1 in MediaPlayer.
2533
2534         Rather than caching the requested rate in MediaPlayer, cache the value reported by
2535         MediaPlayer inside HTMLMediaElement. And instead of returning the reported playback
2536         rate from HTMLMediaElement.playbackRate, just return the last value set. The reported
2537         value is still used for estimating the current time during playback.
2538
2539         Add MediaPlayerPrivate interface method to return the current playback rate.
2540
2541         * html/HTMLMediaElement.cpp:
2542         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_reportedPlaybackRate.
2543         (WebCore::HTMLMediaElement::effectivePlaybackRate): Return m_reportedPlaybackRate.
2544         (WebCore::HTMLMediaElement::requestedPlaybackRate): Return m_playbackRate.
2545         (WebCore::HTMLMediaElement::updatePlaybackRate): Use requestedPlaybackRate() instead
2546             of effectivePlaybackRate();
2547         (WebCore::HTMLMediaElement::ended): Ditto.
2548         (WebCore::HTMLMediaElement::playbackProgressTimerFired): Ditto.
2549         (WebCore::HTMLMediaElement::endedPlayback): Ditto.
2550         (WebCore::HTMLMediaElement::updatePlayState): Ditto.
2551         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Ditto.
2552         (WebCore::HTMLMediaElement::mediaPlayerRateChanged): Set m_reportedPlaybackRate.
2553         (WebCore::HTMLMediaElement::mediaPlayerRequestedPlaybackRate): Return
2554             requestedPlaybackRate() if playing and 0 if not.
2555         * html/HTMLMediaElement.h:
2556         * platform/graphics/MediaPlayer.cpp:
2557         (WebCore::MediaPlayer::MediaPlayer): Removed m_rate.
2558         (WebCore::MediaPlayer::rate): Pass to MediaPlayerPrivate.
2559         (WebCore::MediaPlayer::setRate): Do not cache the rate.
2560         (WebCore::MediaPlayer::requestedRate): Added; ask HTMLMediaElement.
2561         * platform/graphics/MediaPlayer.h:
2562         (WebCore::MediaPlayerClient::mediaPlayerRequestedPlaybackRate): Added.
2563         * platform/graphics/MediaPlayerPrivate.h:
2564         (WebCore::MediaPlayerPrivateInterface::rate): Added.
2565         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2566         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
2567             Do not cache the requested rate.
2568         (WebCore::MediaPlayerPrivateAVFoundation::requestedRate): Pass to MediaPlayer.
2569         (WebCore::MediaPlayerPrivateAVFoundation::setRate): Deleted.
2570         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2571         (WebCore::MediaPlayerPrivateAVFoundation::requestedRate): Deleted.
2572         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2573         (WebCore::MediaPlayerPrivateAVFoundationCF::setRate): Renamed from updateRate.
2574         (WebCore::MediaPlayerPrivateAVFoundationCF::rate): Fetch the rate from the player.
2575         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
2576         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2577         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2578         (WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble): Renamed from updateRate.
2579         (WebCore::MediaPlayerPrivateAVFoundationObjC::rate): Fetch the rate from the player.
2580         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2581         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2582         (WebCore::MediaPlayerPrivateQTKit::rate): Fetch the rate from the QTMovie.
2583
2584 2015-01-13  Andreas Kling  <akling@apple.com>
2585
2586         Element::normalizeAttributes() needs to handle arbitrary JS executing between loop iterations.
2587         <https://webkit.org/b/140379>
2588         <rdar://problem/19446901>
2589
2590         Reviewed by Benjamin Poulain.
2591
2592         Since DOM mutation events may arise below the call to Node::normalize(),
2593         have the loop in Element::normalizeAttributes() make a copy of the Attr nodes
2594         beforehand, to guard against mutations.
2595
2596         Based on a patch by Chris "Chris Dumez" Dumez.
2597
2598         Test: fast/dom/Element/normalize-crash2.html
2599
2600         * dom/Element.cpp:
2601         (WebCore::Element::normalizeAttributes):
2602
2603 2015-01-13  Shivakumar JM  <shiva.jm@samsung.com>
2604
2605         Fix Debug Build Error in Webcore module.
2606         https://bugs.webkit.org/show_bug.cgi?id=140383
2607
2608         Reviewed by Csaba Osztrogonác.
2609
2610         No new tests because there is no visible behavior change.
2611
2612         * platform/linux/MemoryPressureHandlerLinux.cpp:
2613         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog):
2614
2615 2015-01-12  Benjamin Poulain  <benjamin@webkit.org>
2616
2617         Fix a typo in r178313
2618
2619         * contentextensions/URLFilterParser.cpp:
2620         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
2621
2622 2015-01-12  Benjamin Poulain  <benjamin@webkit.org>
2623
2624         Add basic pattern matching support to the url filters
2625         https://bugs.webkit.org/show_bug.cgi?id=140283
2626
2627         Reviewed by Andreas Kling.
2628
2629         This patch adds some basic generic pattern support for the url filters
2630         of ContentExtensions.
2631
2632         Instead of writting a new parser, I re-used Gavin's parser for JavaScript
2633         RegExp.
2634
2635         This patch only implements the very basic stuffs: transition on any character
2636         and repetition.
2637
2638         * WebCore.xcodeproj/project.pbxproj:
2639         * contentextensions/ContentExtensionsBackend.cpp:
2640         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
2641         Use the new parser.
2642
2643         * contentextensions/DFA.cpp:
2644         (WebCore::ContentExtensions::DFA::DFA):
2645         (WebCore::ContentExtensions::printRange):
2646         (WebCore::ContentExtensions::printTransition):
2647         (WebCore::ContentExtensions::DFA::debugPrintDot):
2648         * contentextensions/NFA.cpp:
2649         (WebCore::ContentExtensions::printRange):
2650         (WebCore::ContentExtensions::printTransition):
2651         (WebCore::ContentExtensions::NFA::debugPrintDot):
2652         The graphs generated with the extended patterns are vastly more complicated
2653         than the old prefix matcher.
2654         I changed the debug output to have a single link between any two nodes
2655         instead of one per transition. This makes the graph a little more manageable.
2656
2657         * contentextensions/NFA.cpp:
2658         (WebCore::ContentExtensions::NFA::addTransition):
2659         (WebCore::ContentExtensions::NFA::addEpsilonTransition):
2660         (WebCore::ContentExtensions::NFA::graphSize):
2661         (WebCore::ContentExtensions::NFA::restoreToGraphSize):
2662         * contentextensions/NFA.h:
2663         * contentextensions/NFANode.h:
2664         (WebCore::ContentExtensions::epsilonClosure):
2665         The new parser can generate transitions back to the root node of index zero.
2666         All the hash structures had to be updated to support this kind of key.
2667
2668         * contentextensions/NFAToDFA.cpp:
2669         (WebCore::ContentExtensions::HashableNodeIdSetHash::hash):
2670         Two tiny improvements:
2671         -Don't hash zero to zero, it causes more conflicts that needed.
2672         -The hash operation must use a commutative operation, otherwise the order
2673          of elements can affect the hash, which is undesired for a set.
2674         I'll improve this further later.
2675
2676         (WebCore::ContentExtensions::NFAToDFA::convert):
2677
2678         * contentextensions/URLFilterParser.cpp: Added.
2679         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder):
2680         (WebCore::ContentExtensions::GraphBuilder::m_lastAtom):
2681         (WebCore::ContentExtensions::GraphBuilder::finalize):
2682         (WebCore::ContentExtensions::GraphBuilder::errorMessage):
2683         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
2684         (WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
2685         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
2686         (WebCore::ContentExtensions::GraphBuilder::atomBackReference):
2687         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassAtom):
2688         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
2689         (WebCore::ContentExtensions::GraphBuilder::assertionEOL):
2690         (WebCore::ContentExtensions::GraphBuilder::assertionWordBoundary):
2691         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBegin):
2692         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassRange):
2693         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBuiltIn):
2694         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassEnd):
2695         (WebCore::ContentExtensions::GraphBuilder::atomParenthesesSubpatternBegin):
2696         (WebCore::ContentExtensions::GraphBuilder::atomParentheticalAssertionBegin):
2697         (WebCore::ContentExtensions::GraphBuilder::atomParenthesesEnd):
2698         (WebCore::ContentExtensions::GraphBuilder::disjunction):
2699         (WebCore::ContentExtensions::GraphBuilder::hasError):
2700         (WebCore::ContentExtensions::GraphBuilder::fail):
2701         (WebCore::ContentExtensions::URLFilterParser::parse):
2702         * contentextensions/URLFilterParser.h:
2703         (WebCore::ContentExtensions::URLFilterParser::hasError):
2704         (WebCore::ContentExtensions::URLFilterParser::errorMessage):
2705
2706 2015-01-11  Sam Weinig  <sam@webkit.org>
2707
2708         Remove support for SharedWorkers
2709         https://bugs.webkit.org/show_bug.cgi?id=140344
2710
2711         Reviewed by Anders Carlsson.
2712
2713         * CMakeLists.txt:
2714         * Configurations/FeatureDefines.xcconfig:
2715         * DerivedSources.cpp:
2716         * DerivedSources.make:
2717         * PlatformGTK.cmake:
2718         * PlatformMac.cmake:
2719         * WebCore.vcxproj/WebCore.vcxproj:
2720         * WebCore.vcxproj/WebCore.vcxproj.filters:
2721         * WebCore.xcodeproj/project.pbxproj:
2722         * bindings/generic/RuntimeEnabledFeatures.cpp:
2723         (WebCore::RuntimeEnabledFeatures::sharedWorkerEnabled): Deleted.
2724         * bindings/generic/RuntimeEnabledFeatures.h:
2725         * bindings/js/JSBindingsAllInOne.cpp:
2726         * bindings/js/JSDOMWindowCustom.cpp:
2727         * bindings/js/JSSharedWorkerCustom.cpp: Removed.
2728         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2729         (WebCore::toJSWorkerGlobalScope):
2730         (WebCore::toJSSharedWorkerGlobalScope): Deleted.
2731         * bindings/js/JSWorkerGlobalScopeBase.h:
2732         * bindings/js/WorkerScriptController.cpp:
2733         (WebCore::WorkerScriptController::initScript):
2734         * bindings/scripts/IDLAttributes.txt:
2735         * bindings/scripts/preprocess-idls.pl:
2736         * dom/Document.cpp:
2737         (WebCore::Document::prepareForDestruction):
2738         * dom/EventTarget.h:
2739         * dom/EventTargetFactory.in:
2740         * history/PageCache.cpp:
2741         (WebCore::logCanCacheFrameDecision):
2742         (WebCore::PageCache::canCachePageContainingThisFrame):
2743         * loader/FrameLoader.cpp:
2744         * page/SecurityOrigin.h:
2745         (WebCore::SecurityOrigin::canAccessLocalStorage):
2746         (WebCore::SecurityOrigin::canAccessSharedWorkers): Deleted.
2747         * platform/FeatureCounterKeys.h:
2748         * platform/PlatformStrategies.h:
2749         (WebCore::PlatformStrategies::PlatformStrategies):
2750         (WebCore::PlatformStrategies::sharedWorkerStrategy): Deleted.
2751         * workers/DefaultSharedWorkerRepository.cpp: Removed.
2752         * workers/DefaultSharedWorkerRepository.h: Removed.
2753         * workers/SharedWorker.cpp: Removed.
2754         * workers/SharedWorker.h: Removed.
2755         * workers/SharedWorker.idl: Removed.
2756         * workers/SharedWorkerGlobalScope.cpp: Removed.
2757         * workers/SharedWorkerGlobalScope.h: Removed.
2758         * workers/SharedWorkerGlobalScope.idl: Removed.
2759         * workers/SharedWorkerRepository.cpp: Removed.
2760         * workers/SharedWorkerRepository.h: Removed.
2761         * workers/SharedWorkerStrategy.h: Removed.
2762         * workers/SharedWorkerThread.cpp: Removed.
2763         * workers/SharedWorkerThread.h: Removed.
2764         * workers/WorkerGlobalScope.h:
2765         (WebCore::WorkerGlobalScope::isSharedWorkerGlobalScope): Deleted.
2766
2767 2015-01-12  Byungseon Shin  <sun.shin@lge.com>
2768
2769         REGRESSION(r178029): [GTK][EFL] Caused no-backing-for-clip-overlap test failures
2770         https://bugs.webkit.org/show_bug.cgi?id=140336
2771
2772         Reviewed by Simon Fraser.
2773
2774         Avoid creating childClippingMaskLayer when renderer has not border radius nor clip path.
2775
2776         * rendering/RenderLayerBacking.cpp:
2777         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
2778
2779 2015-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
2780
2781         [Apple] Squelch stderr log regarding negative stroke thickness
2782         https://bugs.webkit.org/show_bug.cgi?id=140372
2783         <rdar://problem/19426485>
2784
2785         Reviewed by Eric Carlson.
2786
2787         No new tests because there is no visible behavior change.
2788
2789         * platform/graphics/cg/GraphicsContextCG.cpp:
2790         (WebCore::GraphicsContext::setPlatformStrokeThickness):
2791
2792 2015-01-12  Timothy Horton  <timothy_horton@apple.com>
2793
2794         Get rid of unnecessary reimplementations of CGFloor/Ceiling
2795         https://bugs.webkit.org/show_bug.cgi?id=140375
2796
2797         Reviewed by Simon Fraser.
2798
2799         * platform/mac/DragImageMac.mm:
2800         (WebCore::widthWithFont):
2801         (WebCore::drawAtPoint):
2802         (WebCore::webkit_CGCeiling): Deleted.
2803         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
2804         (-[WebVideoFullscreenHUDWindowController windowDidLoad]):
2805         (webkit_CGFloor): Deleted.
2806         Delete unnecessary code, use the real CGFloor/Ceiling instead.
2807
2808 2015-01-12  Timothy Horton  <timothy_horton@apple.com>
2809
2810         REGRESSION (r177656): Text in find-in-page yellow bouncy rectangle is not crisp
2811         https://bugs.webkit.org/show_bug.cgi?id=140373
2812         <rdar://problem/19447156>
2813
2814         Reviewed by Simon Fraser.
2815
2816         * page/mac/TextIndicatorWindow.mm:
2817         (WebCore::TextIndicatorWindow::setTextIndicator):
2818         Expand the window margin to the nearest integer.
2819         The window was already being pixel-snapped, but then we'd translate by
2820         the non-integral margin when building up the layer tree.
2821         It's OK to do this on 2x because it's fine to have the margin be bigger
2822         than needed.
2823
2824         * platform/spi/cg/CoreGraphicsSPI.h:
2825         Add a CGCeiling to match CGFloor.
2826
2827 2015-01-12  Andreas Kling  <akling@apple.com>
2828
2829         Guard web thread stuff with USE(WEB_THREAD) instead of PLATFORM(IOS).
2830
2831         Dan pointed out that we should guard WebThreadIsLockedOrDisabled() with
2832         USE(WEB_THREAD) to communicate our ambitions to someday have an iOS
2833         build of WebKit that doesn't need any of that.
2834
2835         * Modules/geolocation/Geolocation.cpp:
2836         (WebCore::Geolocation::resume):
2837
2838 2015-01-12  Andreas Kling  <akling@apple.com>
2839
2840         Fix build for non-iOS platforms. :|
2841
2842         * Modules/geolocation/Geolocation.cpp:
2843         (WebCore::Geolocation::resume):
2844
2845 2015-01-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2846
2847         [Freetype] Don't use non-scalable fonts.
2848         https://bugs.webkit.org/show_bug.cgi?id=31931
2849
2850         Reviewed by Martin Robinson.
2851
2852         No new tests needed.
2853
2854         * platform/graphics/freetype/FontCacheFreeType.cpp:
2855         (WebCore::FontCache::createFontPlatformData): Prefer scalable fonts.
2856
2857 2015-01-12  Andreas Kling  <akling@apple.com>
2858
2859         Geolocation objects shouldn't prevent page caching.
2860         <https://webkit.org/b/140369>
2861
2862         Reviewed by Joseph Pecoraro.
2863
2864         Enable the code for suspend/resume of Geolocation objects on all platforms
2865         instead of just iOS. This allows pages using geolocation to use page cache
2866         instead of reloading on back/forward navigation.
2867
2868         Test: fast/history/page-cache-geolocation.html
2869
2870         * Modules/geolocation/Geolocation.cpp:
2871         (WebCore::Geolocation::Geolocation):
2872         (WebCore::Geolocation::resetAllGeolocationPermission):
2873         (WebCore::Geolocation::stop):
2874         (WebCore::Geolocation::setIsAllowed):
2875         (WebCore::Geolocation::positionChanged):
2876         (WebCore::Geolocation::setError):
2877         * Modules/geolocation/Geolocation.h:
2878
2879 2015-01-12  Chris Dumez  <cdumez@apple.com>
2880
2881         Log navigation types using DiagnosticLoggingClient
2882         https://bugs.webkit.org/show_bug.cgi?id=140323
2883
2884         Reviewed by Darin Adler.
2885
2886         Log navigation types using DiagnosticLoggingClient to help us understand
2887         what types of navigations are common and give us an estimate on the
2888         total number of navigations.
2889
2890         * loader/FrameLoader.cpp:
2891         (WebCore::logNavigation):
2892         (WebCore::FrameLoader::loadWithDocumentLoader):
2893         (WebCore::logNavigationWithFeatureCounter): Deleted.
2894         * page/DiagnosticLoggingKeys.cpp:
2895         (WebCore::DiagnosticLoggingKeys::navigationKey):
2896         * page/DiagnosticLoggingKeys.h:
2897
2898 2015-01-12  Brian J. Burg  <burg@cs.washington.edu>
2899
2900         Web Inspector: ASSERT under WebCore::InspectorResourceAgent::loadResource
2901         https://bugs.webkit.org/show_bug.cgi?id=140367
2902
2903         Reviewed by Andreas Kling.
2904
2905         * inspector/InspectorResourceAgent.cpp:
2906         (WebCore::InspectorResourceAgent::loadResource): use copyRef() instead of move(),
2907         since we check the callback after giving it to the loader client.
2908
2909 2015-01-12  Anders Carlsson  <andersca@apple.com>
2910
2911         Move DatabaseBackend functions back to Database
2912         https://bugs.webkit.org/show_bug.cgi?id=140368
2913
2914         Reviewed by Sam Weinig.
2915
2916         * Modules/webdatabase/Database.cpp:
2917         (WebCore::Database::openAndVerifyVersion):
2918         (WebCore::Database::close):
2919         (WebCore::Database::performOpenAndVerify):
2920         (WebCore::Database::scheduleTransaction):
2921         (WebCore::Database::runTransaction):
2922         (WebCore::Database::scheduleTransactionStep):
2923         (WebCore::Database::inProgressTransactionCompleted):
2924         (WebCore::Database::transactionClient):
2925         (WebCore::Database::transactionCoordinator):
2926         * Modules/webdatabase/Database.h:
2927         * Modules/webdatabase/DatabaseBackend.cpp:
2928         (WebCore::DatabaseBackend::openAndVerifyVersion): Deleted.
2929         (WebCore::DatabaseBackend::performOpenAndVerify): Deleted.
2930         (WebCore::DatabaseBackend::close): Deleted.
2931         (WebCore::DatabaseBackend::runTransaction): Deleted.
2932         (WebCore::DatabaseBackend::inProgressTransactionCompleted): Deleted.
2933         (WebCore::DatabaseBackend::scheduleTransaction): Deleted.
2934         (WebCore::DatabaseBackend::scheduleTransactionStep): Deleted.
2935         (WebCore::DatabaseBackend::transactionClient): Deleted.
2936         (WebCore::DatabaseBackend::transactionCoordinator): Deleted.
2937         * Modules/webdatabase/DatabaseBackend.h:
2938         * Modules/webdatabase/DatabaseThread.cpp:
2939         (WebCore::DatabaseThread::recordDatabaseOpen):
2940         (WebCore::DatabaseThread::recordDatabaseClosed):
2941         (WebCore::SameDatabasePredicate::SameDatabasePredicate):
2942         (WebCore::DatabaseThread::unscheduleDatabaseTasks):
2943         * Modules/webdatabase/DatabaseThread.h:
2944         * Modules/webdatabase/SQLTransactionBackend.cpp:
2945         (WebCore::SQLTransactionBackend::create):
2946         (WebCore::SQLTransactionBackend::SQLTransactionBackend):
2947         * Modules/webdatabase/SQLTransactionBackend.h:
2948         (WebCore::SQLTransactionBackend::database):
2949
2950 2015-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
2951
2952         Addressing post-review comment after r178292
2953         https://bugs.webkit.org/show_bug.cgi?id=136769
2954
2955         Unreviewed.
2956
2957         * loader/cache/CachedFont.cpp:
2958         (WebCore::CachedFont::ensureCustomFontData):
2959
2960 2015-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
2961
2962         Allow targetting the SVG->OTF font converter with ENABLE(SVG_OTF_CONVERTER)
2963         https://bugs.webkit.org/show_bug.cgi?id=136769
2964
2965         Reviewed by Antti Koivisto.
2966
2967         If ENABLE(SVG_OTF_CONVERTER) is defined, use the converter. It can be defined at the same
2968         time as ENABLE(SVG_FONTS) but, if so, the SVG font code will be dead code.
2969
2970         No new tests because the define is off by default. Tests will come soon, I promise.
2971
2972         * Configurations/FeatureDefines.xcconfig:
2973         * css/CSSFontFaceSource.cpp:
2974         (WebCore::CSSFontFaceSource::getFontData): When creating a font, if the ENABLE is on,
2975         do the transcode and take the non-SVG path.
2976         (WebCore::CSSFontFaceSource::ensureFontData): Pass extra arguments to
2977         CachedFont::ensureCustomFontData()
2978         * css/CSSFontFaceSource.h: For the case of in-document SVG fonts, keep the transcoded
2979         bytes around.
2980         * loader/cache/CachedFont.cpp:
2981         (WebCore::CachedFont::ensureCustomFontData): For out-of-document SVG fonts, do the
2982         transcode if the ENABLE is on, then treat as if the font is any old webfont.
2983         (WebCore::CachedFont::getSVGFontById): This function looks up the relevant <font>
2984         element. Modify it to take a pointer to a (possibly external) document within which
2985         to search.
2986         * loader/cache/CachedFont.h: Extra arguments to CachedFont::ensureCustomFontData()
2987         and CachedFont::getSVGFontById()
2988
2989 2015-01-12  Zan Dobersek  <zdobersek@igalia.com>
2990
2991         Clean up FrameTree::traverseNext() traversals of main frames
2992         https://bugs.webkit.org/show_bug.cgi?id=140338
2993
2994         Reviewed by Andreas Kling.
2995
2996         There's no reason to pass the main frame as the stayWithin parameter
2997         to FrameTree::traverseNext() when traversing over that same main frame.
2998
2999         * inspector/InspectorApplicationCacheAgent.cpp:
3000         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
3001         * inspector/InspectorPageAgent.cpp:
3002         (WebCore::InspectorPageAgent::getCookies):
3003         (WebCore::InspectorPageAgent::deleteCookie):
3004         (WebCore::InspectorPageAgent::searchInResources):
3005         * replay/SerializationMethods.cpp:
3006         (WebCore::frameIndexFromFrame):
3007         (WebCore::frameFromFrameIndex):
3008
3009 2015-01-12  Timothy Horton  <timothy_horton@apple.com>
3010
3011         Multi-rect TextIndicators are vertically flipped in WebKit1
3012         https://bugs.webkit.org/show_bug.cgi?id=140350
3013         <rdar://problem/19441243>
3014
3015         Reviewed by Beth Dakin.
3016
3017         * page/TextIndicator.cpp:
3018         (WebCore::TextIndicator::createWithSelectionInFrame):
3019         (WebCore::TextIndicator::TextIndicator):
3020         * page/TextIndicator.h:
3021         (WebCore::TextIndicator::selectionRectInRootViewCoordinates):
3022         (WebCore::TextIndicator::textBoundingRectInRootViewCoordinates):
3023         (WebCore::TextIndicator::selectionRectInWindowCoordinates): Deleted.
3024         (WebCore::TextIndicator::textBoundingRectInWindowCoordinates): Deleted.
3025         * page/mac/TextIndicatorWindow.mm:
3026         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
3027         (WebCore::TextIndicatorWindow::setTextIndicator):
3028         Compute, store, and use TextIndicator's selectionRect and textBoundingRect
3029         in root view coordinates instead of window coordinates; this way, each
3030         WebKit can do the conversion itself, and the rootView vs. window flipping
3031         isn't wrongly factored into textRectsInBoundingRectCoordinates.
3032
3033 2015-01-12  Commit Queue  <commit-queue@webkit.org>
3034
3035         Unreviewed, rolling out r178281.
3036         https://bugs.webkit.org/show_bug.cgi?id=140366
3037
3038         Broke many media tests (Requested by ap on #webkit).
3039
3040         Reverted changeset:
3041
3042         "defaultPlaybackRate not respected when set before source is
3043         loaded"
3044         https://bugs.webkit.org/show_bug.cgi?id=140282
3045         http://trac.webkit.org/changeset/178281
3046
3047 2015-01-12  Anders Carlsson  <andersca@apple.com>
3048
3049         Merge DatabaseBackendContext into DatabaseContext
3050         https://bugs.webkit.org/show_bug.cgi?id=140365
3051
3052         Reviewed by Antti Koivisto.
3053
3054         * CMakeLists.txt:
3055         * Modules/webdatabase/AbstractDatabaseServer.h:
3056         * Modules/webdatabase/Database.cpp:
3057         (WebCore::Database::Database):
3058         * Modules/webdatabase/Database.h:
3059         * Modules/webdatabase/DatabaseBackend.cpp:
3060         (WebCore::DatabaseBackend::DatabaseBackend):
3061         * Modules/webdatabase/DatabaseBackend.h:
3062         * Modules/webdatabase/DatabaseBackendBase.cpp:
3063         (WebCore::DatabaseBackendBase::DatabaseBackendBase):
3064         * Modules/webdatabase/DatabaseBackendBase.h:
3065         (WebCore::DatabaseBackendBase::databaseContext):
3066         * Modules/webdatabase/DatabaseBackendContext.cpp: Removed.
3067         * Modules/webdatabase/DatabaseBackendContext.h: Removed.
3068         * Modules/webdatabase/DatabaseContext.cpp:
3069         (WebCore::DatabaseContext::securityOrigin):
3070         (WebCore::DatabaseContext::isContextThread):
3071         (WebCore::DatabaseContext::backend): Deleted.
3072         * Modules/webdatabase/DatabaseContext.h:
3073         * Modules/webdatabase/DatabaseManager.cpp:
3074         (WebCore::DatabaseManager::openDatabaseBackend):
3075         (WebCore::DatabaseManager::interruptAllDatabasesForContext):
3076         * Modules/webdatabase/DatabaseServer.cpp:
3077         (WebCore::DatabaseServer::interruptAllDatabasesForContext):
3078         (WebCore::DatabaseServer::openDatabase):
3079         (WebCore::DatabaseServer::createDatabase):
3080         * Modules/webdatabase/DatabaseServer.h:
3081         * Modules/webdatabase/DatabaseTracker.cpp:
3082         (WebCore::DatabaseTracker::canEstablishDatabase):
3083         (WebCore::DatabaseTracker::retryCanEstablishDatabase):
3084         (WebCore::DatabaseTracker::interruptAllDatabasesForContext):
3085         * Modules/webdatabase/DatabaseTracker.h:
3086         * Modules/webdatabase/SQLTransactionBackend.cpp:
3087         * Modules/webdatabase/SQLTransactionClient.cpp:
3088         * WebCore.vcxproj/WebCore.vcxproj:
3089         * WebCore.vcxproj/WebCore.vcxproj.filters:
3090         * WebCore.xcodeproj/project.pbxproj:
3091
3092 2015-01-12  Jer Noble  <jer.noble@apple.com>
3093
3094         defaultPlaybackRate not respected when set before source is loaded
3095         https://bugs.webkit.org/show_bug.cgi?id=140282
3096
3097         Reviewed by Eric Carlson.
3098
3099         Test: media/video-defaultplaybackrate-before-load.html
3100
3101         When the HTMLMediaElement is notified that the media player's rate has changed, it asks
3102         for the rate from MediaPlayer. However, MediaPlayer never requests the playback rate
3103         from the underlying MediaPlayerPrivate; it just returns the last rate which was set, or
3104         1 if no rate was set. HTMLMediaElement then sets its playbackRate to the returned
3105         value. So the end result is that the value from defaultPlaybackRate is overwritten by
3106         the default value of 1 in MediaPlayer.
3107
3108         Rather than caching the requested rate in MediaPlayer, cache the value reported by
3109         MediaPlayer inside HTMLMediaElement. And instead of returning the reported playback
3110         rate from HTMLMediaElement.playbackRate, just return the last value set. The reported
3111         value is still used for estimating the current time during playback.
3112
3113         Add MediaPlayerPrivate interface method to return the current playback rate.
3114
3115         * html/HTMLMediaElement.cpp:
3116         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_reportedPlaybackRate.
3117         (WebCore::HTMLMediaElement::effectivePlaybackRate): Return m_reportedPlaybackRate.
3118         (WebCore::HTMLMediaElement::requestedPlaybackRate): Return m_playbackRate.
3119         (WebCore::HTMLMediaElement::updatePlaybackRate): Use requestedPlaybackRate() instead
3120             of effectivePlaybackRate();
3121         (WebCore::HTMLMediaElement::ended): Ditto.
3122         (WebCore::HTMLMediaElement::playbackProgressTimerFired): Ditto.
3123         (WebCore::HTMLMediaElement::endedPlayback): Ditto.
3124         (WebCore::HTMLMediaElement::updatePlayState): Ditto.
3125         (WebCore::HTMLMediaElement::mediaPlayerRateChanged): Set m_reportedPlaybackRate.
3126         (WebCore::HTMLMediaElement::mediaPlayerRequestedPlaybackRate): Return
3127             requestedPlaybackRate() if playing and 0 if not.
3128         * html/HTMLMediaElement.h:
3129         * platform/graphics/MediaPlayer.cpp:
3130         (WebCore::MediaPlayer::MediaPlayer): Removed m_rate.
3131         (WebCore::MediaPlayer::rate): Pass to MediaPlayerPrivate.
3132         (WebCore::MediaPlayer::setRate): Do not cache the rate.
3133         (WebCore::MediaPlayer::requestedRate): Added; ask HTMLMediaElement.
3134         * platform/graphics/MediaPlayer.h:
3135         (WebCore::MediaPlayerClient::mediaPlayerRequestedPlaybackRate): Added.
3136         * platform/graphics/MediaPlayerPrivate.h:
3137         (WebCore::MediaPlayerPrivateInterface::rate): Added.
3138         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3139         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
3140             Do not cache the requested rate.
3141         (WebCore::MediaPlayerPrivateAVFoundation::requestedRate): Pass to MediaPlayer.
3142         (WebCore::MediaPlayerPrivateAVFoundation::setRate): Deleted.
3143         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3144         (WebCore::MediaPlayerPrivateAVFoundation::requestedRate): Deleted.
3145         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3146         (WebCore::MediaPlayerPrivateAVFoundationCF::setRate): Renamed from updateRate.
3147         (WebCore::MediaPlayerPrivateAVFoundationCF::rate): Fetch the rate from the player.
3148         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
3149         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3150         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3151         (WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble): Renamed from updateRate.
3152         (WebCore::MediaPlayerPrivateAVFoundationObjC::rate): Fetch the rate from the player.
3153         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3154         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3155         (WebCore::MediaPlayerPrivateQTKit::rate): Fetch the rate from the QTMovie.
3156
3157 2015-01-11  Anders Carlsson  <andersca@apple.com>
3158
3159         Merge DatabaseBase into Database
3160         https://bugs.webkit.org/show_bug.cgi?id=140345
3161
3162         Reviewed by Antti Koivisto.
3163
3164         * CMakeLists.txt:
3165         * Modules/webdatabase/Database.cpp:
3166         (WebCore::Database::Database):
3167         (WebCore::Database::runTransaction):
3168         (WebCore::Database::logErrorMessage):
3169         * Modules/webdatabase/Database.h:
3170         (WebCore::Database::scriptExecutionContext):
3171         * Modules/webdatabase/DatabaseBackendBase.cpp:
3172         * Modules/webdatabase/DatabaseBackendBase.h:
3173         (WebCore::DatabaseBackendBase::setFrontend):
3174         * Modules/webdatabase/DatabaseBase.cpp: Removed.
3175         * Modules/webdatabase/DatabaseBase.h: Removed.
3176         * WebCore.vcxproj/WebCore.vcxproj:
3177         * WebCore.vcxproj/WebCore.vcxproj.filters:
3178         * WebCore.xcodeproj/project.pbxproj:
3179
3180 2015-01-12  Darin Adler  <darin@apple.com>
3181
3182         Modernize and streamline HTMLTokenizer
3183         https://bugs.webkit.org/show_bug.cgi?id=140166
3184
3185         Reviewed by Sam Weinig.
3186
3187         * html/parser/AtomicHTMLToken.h:
3188         (WebCore::AtomicHTMLToken::initializeAttributes): Removed unneeded assertions
3189         based on fields I removed.
3190
3191         * html/parser/HTMLDocumentParser.cpp:
3192         (WebCore::HTMLDocumentParser::HTMLDocumentParser): Change to use updateStateFor
3193         to set the initial state when parsing a fragment, since it implements the same
3194         rule taht the tokenizerStateForContextElement function did.
3195         (WebCore::HTMLDocumentParser::pumpTokenizer): Updated to use the revised
3196         interfaces for HTMLSourceTracker and HTMLTokenizer.
3197         (WebCore::HTMLDocumentParser::constructTreeFromHTMLToken): Changed to take a
3198         TokenPtr instead of an HTMLToken, so we can clear out the TokenPtr earlier
3199         for non-character tokens, and let them get cleared later for character tokens.
3200         (WebCore::HTMLDocumentParser::insert): Pass references.
3201         (WebCore::HTMLDocumentParser::append): Ditto.
3202         (WebCore::HTMLDocumentParser::appendCurrentInputStreamToPreloadScannerAndScan): Ditto.
3203
3204         * html/parser/HTMLDocumentParser.h: Updated argument type for constructTreeFromHTMLToken
3205         and removed now-unneeded m_token data members.
3206
3207         * html/parser/HTMLEntityParser.cpp: Removed unneeded uses of the inline keyword.
3208         (WebCore::HTMLEntityParser::consumeNamedEntity): Replaced two uses of
3209         advanceAndASSERT with just plain advance; there's really no need to assert the
3210         character is the one we just got out of the string.
3211
3212         * html/parser/HTMLInputStream.h: Moved the include of TextPosition.h here from
3213         its old location since this class has two data members that are OrdinalNumber.
3214
3215         * html/parser/HTMLMetaCharsetParser.cpp:
3216         (WebCore::HTMLMetaCharsetParser::HTMLMetaCharsetParser): Removed most of the
3217         initialization, since it's now done by defaults.
3218         (WebCore::extractCharset): Rewrote this to be a non-member function, and to
3219         use a for loop, and to handle quote marks in a simpler way. Also changed it
3220         to return a StringView so we don't have to allocate a new string.
3221         (WebCore::HTMLMetaCharsetParser::processMeta): Use a modern for loop, and
3222         also take a token argument since it's no longer a data member.
3223         (WebCore::HTMLMetaCharsetParser::encodingFromMetaAttributes): Use a modern for
3224         loop, StringView instead of string, and don't bother naming the local enum.
3225         (WebCore::HTMLMetaCharsetParser::checkForMetaCharset): Updated for the new
3226         way of getting tokens from the tokenizer.
3227
3228         * html/parser/HTMLMetaCharsetParser.h: Got rid of some data members and
3229         tightened up the formatting a little. Don't bother allocating the tokenizer
3230         on the heap.
3231
3232         * html/parser/HTMLPreloadScanner.cpp:
3233         (WebCore::TokenPreloadScanner::TokenPreloadScanner): Removed unneeded
3234         initialization.
3235         (WebCore::HTMLPreloadScanner::HTMLPreloadScanner): Ditto.
3236         (WebCore::HTMLPreloadScanner::scan): Changed to take a reference.
3237
3238         * html/parser/HTMLPreloadScanner.h: Removed unneeded includes, typedefs,
3239         and forward declarations. Removed explicit declaration of the destructor,
3240         since the default one works. Removed unused createCheckpoint and rewindTo
3241         functions. Gave initial values for various data members. Marked the device
3242         scale factor const beacuse it's set in the constructor and never changed.
3243         Also removed the unneeded isSafeToSendToAnotherThread.
3244
3245         * html/parser/HTMLResourcePreloader.cpp:
3246         (WebCore::PreloadRequest::isSafeToSendToAnotherThread): Deleted.
3247
3248         * html/parser/HTMLResourcePreloader.h:
3249         (WebCore::PreloadRequest::PreloadRequest): Removed unneeded calls to
3250         isolatedCopy. Also removed isSafeToSendToAnotherThread.
3251
3252         * html/parser/HTMLSourceTracker.cpp:
3253         (WebCore::HTMLSourceTracker::startToken): Renamed. Changed to keep state
3254          in the source tracker itself, not the token.
3255         (WebCore::HTMLSourceTracker::endToken): Ditto.
3256         (WebCore::HTMLSourceTracker::source): Renamed. Changed to use the state
3257         from the source tracker.
3258
3259         * html/parser/HTMLSourceTracker.h: Removed unneeded include of HTMLToken.h.
3260         Renamed functions, removed now-unneeded comment.
3261
3262         * html/parser/HTMLToken.h: Cut down on the fields used by the source tracker.
3263         It only needs to know the start and end of each attribute, not each part of
3264         each attribute. Removed setBaseOffset, setEndOffset, length, addNewAttribute,
3265         beginAttributeName, endAttributeName, beginAttributeValue, endAttributeValue,
3266         m_baseOffset and m_length. Added beginAttribute and endAttribute.
3267         (WebCore::HTMLToken::clear): No need to zero m_length or m_baseOffset any more.
3268         (WebCore::HTMLToken::length): Deleted.
3269         (WebCore::HTMLToken::setBaseOffset): Deleted.
3270         (WebCore::HTMLToken::setEndOffset): Deleted.
3271         (WebCore::HTMLToken::beginStartTag): Only null out m_currentAttribute if we
3272         are compiling in assertions.
3273         (WebCore::HTMLToken::beginEndTag): Ditto.
3274         (WebCore::HTMLToken::addNewAttribute): Deleted.
3275         (WebCore::HTMLToken::beginAttribute): Moved the code from addNewAttribute in
3276         here and set the start offset.
3277         (WebCore::HTMLToken::beginAttributeName): Deleted.
3278         (WebCore::HTMLToken::endAttributeName): Deleted.
3279         (WebCore::HTMLToken::beginAttributeValue): Deleted.
3280         (WebCore::HTMLToken::endAttributeValue): Deleted.
3281
3282         * html/parser/HTMLTokenizer.cpp:
3283         (WebCore::HTMLToken::endAttribute): Added. Sets the end offset.
3284         (WebCore::HTMLToken::appendToAttributeName): Updated assertion.
3285         (WebCore::HTMLToken::appendToAttributeValue): Ditto.
3286         (WebCore::convertASCIIAlphaToLower): Renamed from toLowerCase and changed
3287         so it's legal to call on lower case letters too.
3288         (WebCore::vectorEqualsString): Changed to take a string literal rather than
3289         a WTF::String.
3290         (WebCore::HTMLTokenizer::inEndTagBufferingState): Made this a member function.
3291         (WebCore::HTMLTokenizer::HTMLTokenizer): Updated for data member changes.
3292         (WebCore::HTMLTokenizer::bufferASCIICharacter): Added. Optimized version of
3293         bufferCharacter for the common case where we know the character is ASCII.
3294         (WebCore::HTMLTokenizer::bufferCharacter): Moved this function here from the
3295         header since it's only used inside the class.
3296         (WebCore::HTMLTokenizer::emitAndResumeInDataState): Moved this here, renamed
3297         it and removed the state argument.
3298         (WebCore::HTMLTokenizer::emitAndReconsumeInDataState): Ditto.
3299         (WebCore::HTMLTokenizer::emitEndOfFile): More of the same.
3300         (WebCore::HTMLTokenizer::saveEndTagNameIfNeeded): Ditto.
3301         (WebCore::HTMLTokenizer::haveBufferedCharacterToken): Ditto.
3302         (WebCore::HTMLTokenizer::flushBufferedEndTag): Updated since m_token is now
3303         the actual token, not just a pointer.
3304         (WebCore::HTMLTokenizer::flushEmitAndResumeInDataState): Renamed this and
3305         removed the state argument.
3306         (WebCore::HTMLTokenizer::processToken): This function, formerly nextToken,
3307         is now the internal function used by nextToken. Updated its contents to use
3308         simpler macros, changed code to set m_state when returning, rather than
3309         constantly setting it when cycling through states, switched style to use
3310         early return/goto rather than lots of else statements, took out unneeded
3311         braces now that BEGIN/END_STATE handles the braces, collapsed upper and
3312         lower case letter handling in many states, changed lookAhead call sites to
3313         use the new advancePast function instead.
3314         (WebCore::HTMLTokenizer::updateStateFor): Set m_state directly instead of
3315         calling a setstate function.
3316         (WebCore::HTMLTokenizer::appendToTemporaryBuffer): Moved here from header.
3317         (WebCore::HTMLTokenizer::temporaryBufferIs): Changed argument type to
3318         a literal instead of a WTF::String.
3319         (WebCore::HTMLTokenizer::appendToPossibleEndTag): Renamed and changed type
3320         to be a UChar instead of LChar, although all characters will be ASCII.
3321         (WebCore::HTMLTokenizer::isAppropriateEndTag): Marked const, and changed
3322         type from size_t to unsigned.
3323
3324         * html/parser/HTMLTokenizer.h: Changed interface of nextToken so it returns
3325         a TokenPtr so code doesn't have to understand special rules about when to
3326         work with an HTMLToken and when to clear it. Made most functions private,
3327         and made the State enum private as well. Replaced the state and setState
3328         functions with more specific functions for the few states we need to deal
3329         with outside the class. Moved function bodies outside the class definition
3330         so it's easier to read the class definition.
3331
3332         * html/parser/HTMLTreeBuilder.cpp:
3333         (WebCore::HTMLTreeBuilder::processStartTagForInBody): Updated to use the
3334         new set state functions instead of setState.
3335         (WebCore::HTMLTreeBuilder::processEndTag): Ditto.
3336         (WebCore::HTMLTreeBuilder::processGenericRCDATAStartTag): Ditto.
3337         (WebCore::HTMLTreeBuilder::processGenericRawTextStartTag): Ditto.
3338         (WebCore::HTMLTreeBuilder::processScriptStartTag): Ditto.
3339
3340         * html/parser/InputStreamPreprocessor.h: Marked the constructor explicit,
3341         and mde it take a reference rather than a pointer.
3342
3343         * html/parser/TextDocumentParser.cpp:
3344         (WebCore::TextDocumentParser::insertFakePreElement): Updated to use the
3345         new set state functions instead of setState.
3346
3347         * html/parser/XSSAuditor.cpp:
3348         (WebCore::XSSAuditor::decodedSnippetForName): Updated for name change.
3349         (WebCore::XSSAuditor::decodedSnippetForAttribute): Updated for changes to
3350         attribute range tracking.
3351         (WebCore::XSSAuditor::decodedSnippetForJavaScript): Updated for name change.
3352         (WebCore::XSSAuditor::isSafeToSendToAnotherThread): Deleted.
3353
3354         * html/parser/XSSAuditor.h: Deleted isSafeToSendToAnotherThread.
3355
3356         * html/track/WebVTTTokenizer.cpp: Removed the local state variable from
3357         WEBVTT_ADVANCE_TO; there is no need for it.
3358         (WebCore::WebVTTTokenizer::WebVTTTokenizer): Use a reference instead of a
3359         pointer for the preprocessor.
3360         (WebCore::WebVTTTokenizer::nextToken): Ditto. Also removed the state local
3361         variable and the switch statement, replacing with labels instead since we
3362         go between states with goto.
3363
3364         * platform/text/SegmentedString.cpp:
3365         (WebCore::SegmentedString::operator=): Changed the return type to be non-const
3366         to match normal C++ design rules.
3367         (WebCore::SegmentedString::pushBack): Renamed from prepend since this is not a
3368         general purpose prepend function. Also fixed assertions to not use the strangely
3369         named "escaped" function, since we are deleting it.
3370         (WebCore::SegmentedString::append): Ditto.
3371         (WebCore::SegmentedString::advancePastNonNewlines): Renamed from advance, since
3372         the function only works for non-newlines.
3373         (WebCore::SegmentedString::currentColumn): Got rid of unneeded local variable.
3374         (WebCore::SegmentedString::advancePastSlowCase): Moved here from header and
3375         renamed. This function now consumes the characters if they match.
3376
3377         * platform/text/SegmentedString.h: Made the changes mentioned above.
3378         (WebCore::SegmentedString::excludeLineNumbers): Deleted.
3379         (WebCore::SegmentedString::advancePast): Renamed from lookAhead. Also changed
3380         behavior so the characters are consumed.
3381         (WebCore::SegmentedString::advancePastIgnoringCase): Ditto.
3382         (WebCore::SegmentedString::advanceAndASSERT): Deleted.
3383         (WebCore::SegmentedString::advanceAndASSERTIgnoringCase): Deleted.
3384         (WebCore::SegmentedString::escaped): Deleted.
3385
3386         * xml/parser/CharacterReferenceParserInlines.h:
3387         (WebCore::isHexDigit): Deleted.
3388         (WebCore::unconsumeCharacters): Updated for name change.
3389         (WebCore::consumeCharacterReference): Removed unneeded name for local enum,
3390         renamed local variable "cc" to character. Changed code to use helpers like
3391         isASCIIAlpha and toASCIIHexValue. Removed unneeded use of advanceAndASSERT,
3392         since we don't really need to assert the character we just extracted.
3393
3394         * xml/parser/MarkupTokenizerInlines.h:
3395         (WebCore::isTokenizerWhitespace): Renamed argument to character.
3396         (WebCore::advanceStringAndASSERTIgnoringCase): Deleted.
3397         (WebCore::advanceStringAndASSERT): Deleted.
3398         Changed all the macro implementations so they set m_state only when
3399         returning from the function and just use goto inside the state machine.
3400
3401 2015-01-11  Andreas Kling  <akling@apple.com>
3402
3403         Enable Vector bounds checking for ElementDescendantIterator.
3404         <https://webkit.org/b/140346>
3405
3406         Reviewed by Sam Weinig.
3407
3408         I had originally disabled Vector bounds checking for
3409         ElementDescendantIterator's internal ancestor stack, but upon
3410         re-running performance benchmarks, it appears to have little-to-no
3411         measurable benefit.
3412
3413         This change adds back the bounds checking.
3414
3415         * dom/ElementDescendantIterator.h:
3416
3417 2015-01-11  Chris Dumez  <cdumez@apple.com>
3418
3419         Drop legacy SVGCSSStyleSelector.cpp
3420         https://bugs.webkit.org/show_bug.cgi?id=140342
3421
3422         Reviewed by Antti Koivisto.
3423
3424         Drop legacy SVGCSSStyleSelector.cpp by porting the remaining SVG CSS
3425         properties to the generated StyleBuilder. This patch also removes
3426         support for the "LegacyStyleBuilder" option in CSSPropertyNames.in
3427         as all properties have now been ported over.
3428
3429         * CMakeLists.txt:
3430         * WebCore.vcxproj/WebCore.vcxproj:
3431         * WebCore.vcxproj/WebCore.vcxproj.filters:
3432         * WebCore.xcodeproj/project.pbxproj:
3433         Drop SVGCSSStyleSelector.cpp file as it was removed.
3434
3435         * css/CSSPropertyNames.in:
3436         * css/SVGCSSStyleSelector.cpp: Removed.
3437         * css/StyleBuilder.h: