Remove unused methods from MediaPlayerClient
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-09-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         Remove unused methods from MediaPlayerClient
4         https://bugs.webkit.org/show_bug.cgi?id=136884
5
6         Reviewed by Eric Carlson.
7
8         Remove unused methods from MediaPlayerClient that introduce
9         dependencies on WebCore types.
10
11         * html/HTMLMediaElement.cpp:
12         * html/HTMLMediaElement.h:
13         * platform/graphics/MediaPlayer.h:
14         (WebCore::MediaPlayerClient::mediaPlayerOwningDocument): Deleted.
15         (WebCore::MediaPlayerClient::mediaPlayerHostWindow): Deleted.
16         (WebCore::MediaPlayerClient::mediaPlayerWindowClipRect): Deleted.
17
18 2014-09-17  Iago Toral  <itoral@igalia.com> and Zan Dobersek  <zdobersek@igalia.com>
19
20         [GTK] Add Wayland support to GLContextEGL
21         https://bugs.webkit.org/show_bug.cgi?id=136829
22
23         Reviewed by Martin Robinson.
24
25         * platform/graphics/egl/GLContextEGL.cpp:
26         (WebCore::sharedEGLDisplay): Special-case the shared EGL display initialization
27         for the GTK port when running under Wayland. In that case the pointer to the
28         native wl_display object should be passed to eglGetDisplay(). If not running
29         under Wayland we should fall back to using the shared X11 display (if support
30         for that display system is enabled) or the EGL_DEFAULT_DISPLAY.
31
32 2014-09-17  Daniel Bates  <dabates@apple.com>
33
34         Unreviewed, rolling out r173695.
35
36         Broke building third-party Legacy WebKit apps; will
37         investigate offline
38
39         Reverted changeset:
40
41         "[iOS] Make WebCore build with public iOS SDK"
42         https://bugs.webkit.org/show_bug.cgi?id=136487
43         http://trac.webkit.org/changeset/173695
44
45 2014-09-17  Roger Fong  <roger_fong@apple.com>
46
47         Speculative fix for a fast\dom\html-collections-named-getter failing only in Debug builds.
48
49         * dom/Node.cpp:
50         (WebCore::Document::invalidateNodeListAndCollectionCaches):
51
52 2014-09-17  Benjamin Poulain  <bpoulain@apple.com>
53
54         Add parsing for :nth-child(An+B of selector)
55         https://bugs.webkit.org/show_bug.cgi?id=136845
56
57         Reviewed by Antti Koivisto.
58
59         Add support for parsing :nth-child(of). The implementation of selector matching
60         will be in a follow up, there are enough edge cases here already.
61
62         Spec here: http://dev.w3.org/csswg/selectors4/#the-nth-child-pseudo
63
64         Test: fast/css/parsing-css-nth-child-of.html
65
66         * css/CSSParser.cpp:
67         (WebCore::CSSParser::detectFunctionTypeToken):
68         (WebCore::CSSParser::realLex):
69         The parser generate two new kinds of tokens:
70         -NTHCHILDFUNCTION, matching the "nth-child" identifier.
71         -NTHCHILDSELECTORSEPARATOR, matching the "of" keyword separating An+B from the selector list.
72
73         NTHCHILDFUNCTION is used to extend the new syntax only for :nth-child() and not all the "nth" functions
74         (e.g. :nth-of-type()).
75
76         NTHCHILDSELECTORSEPARATOR exists for two reasons:
77         -We must clear the "parsingMode" before parsing selectorList. If we failed to do that, the complex selectors
78          would be parsed in NthChildMode, which has all kind of bad side effects.
79         -The second reason is differentiacting "of" for all the other identifiers. Arguably, this could have been done
80          in the grammar, but it is clearer this way since we already need the branches for the parsingMode.
81
82         * css/CSSGrammar.y.in:
83         Those are pretty much duplicates of the existing FUNCTION rules but supporting the new syntax.
84
85         * css/CSSParserValues.cpp:
86         (WebCore::selectorListMatchesPseudoElement):
87         (WebCore::CSSParserSelector::matchesPseudoElement):
88         Matching pseudo elements does not make much sense for those selectorList (e.g. :nth-child(2n of ::before)).
89         Add helper function to fail parsing of those cases.
90
91         * css/CSSParserValues.h:
92         * css/CSSSelector.cpp:
93         (WebCore::CSSSelector::selectorText):
94         * css/CSSSelector.h:
95         (WebCore::CSSSelector::selectorList):
96         Updated serialization code for CSS OM.
97
98 2014-09-17  Benjamin Poulain  <bpoulain@apple.com>
99
100         CSS value in whitespace-separated list attribute selector (~=) mishandles tab/newline/etc.
101         https://bugs.webkit.org/show_bug.cgi?id=136807
102
103         Reviewed by Antti Koivisto.
104
105         The spec defines selector lists as token separated by white space.
106
107         The definition of white space for CSS Selectors is:
108         "White space in Selectors consists of the code points SPACE (U+0020),
109         TAB (U+0009), LINE FEED (U+000A), CARRIAGE RETURN (U+000D), and FORM FEED (U+000C)
110         can occur in whitespace. Other space-like code points, such as EM SPACE (U+2003)
111         and IDEOGRAPHIC SPACE (U+3000), are never part of white space."
112
113         The old code was only matching SPACE (U+0020) which is buggy. This patch
114         adds support for the other caracters.
115
116         Tests: fast/selectors/attr-list-01.html
117                fast/selectors/attribute-list-with-whitespace-in-selector.html
118                fast/selectors/attribute-list-with-whitespace-in-value.html
119
120         * css/SelectorChecker.cpp:
121         (WebCore::attributeValueMatches):
122         * cssjit/SelectorCompiler.cpp:
123         (WebCore::SelectorCompiler::constructFragments):
124         (WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains):
125         Add the missing checks.
126
127         * html/track/VTTRegion.cpp:
128         (WebCore::VTTRegion::setRegionSettings):
129         (WebCore::VTTRegion::parseSettingValue):
130         * html/track/WebVTTParser.cpp:
131         (WebCore::WebVTTParser::hasRequiredFileIdentifier):
132         (WebCore::WebVTTParser::collectTimingsAndSettings):
133         * html/track/WebVTTParser.h:
134         While looking for affected code, I discovered WebVTT redefines isHTMLSpace().
135         I cleaned that code.
136
137 2014-09-17  Gavin Barraclough  <baraclough@apple.com>
138
139         Aways have a PageThrottler (sometimes have a UserActivity::Impl)
140         https://bugs.webkit.org/show_bug.cgi?id=136892
141
142         Reviewed by Geoffrey Garen.
143
144         Some instances of Page have a PageThrottler to track activity on the Page, and some do not.
145         (Specifically, those created from WebPage in WK2 do, those related to WK1, SVG & inspector do not).
146
147         We do this for three reasons:
148             * We do not need to take AppNap assertions on WK1.
149             * Some Pages do not track their visibility correctly, and would always claim to be visible.
150             * Page VisibilityState is not set until after construction, so if we instantiate
151
152         Creating the entire PageThrottler lazily has the drawback that we have to check for its existence at
153         numerous points throughout the code, and we'll miss activity that occurs between the Page being created
154         & the PageThrottler added to it (really a theoretical problem right now, since they're currently always
155         created pretty much back to back).
156
157         Instead, Page should always have a PageThrottler, & instead make the UserActivity::Impl on the
158         PageThrottler be added later.
159
160         * WebCore.exp.in:
161             - createPageThrottler -> enablePageThrottler
162         * html/HTMLMediaElement.cpp:
163         (WebCore::HTMLMediaElement::parseAttribute):
164             - Page::pageThrottler now returns a reference rather than a pointer
165         * loader/FrameLoader.cpp:
166         (WebCore::FrameLoader::started):
167             - Page::pageThrottler now returns a reference rather than a pointer
168         * page/Page.cpp:
169         (WebCore::Page::Page):
170             - instantiate PageThrottler in constructor
171         (WebCore::Page::enablePageThrottler):
172             - renamed from createPageThrottler, instead of creating the PageThrottler this method now
173               instruct PageThrottler to create a UserActivity::Impl
174         (WebCore::Page::setViewState):
175             - m_pageThrottler is not a pointer
176         (WebCore::Page::createPageThrottler): Deleted.
177             - renamed to enablePageThrottler
178         * page/Page.h:
179         (WebCore::Page::pageThrottler):
180             - now returns a reference
181         * page/PageThrottler.cpp:
182         (WebCore::PageThrottler::PageThrottler):
183             - no longer instantiate m_activity
184         (WebCore::PageThrottler::createUserActivity):
185             - lazily instantiate m_activity, call updateUserActivity
186         (WebCore::PageThrottler::updateUserActivity):
187             - m_activity may not yet be instantiated; added early return
188         * page/PageThrottler.h:
189             - m_activity becomes a std::unique_ptr, added createUserActivity
190
191 2014-09-17  Daniel Bates  <dabates@apple.com>
192
193         [iOS] Make WebCore build with public iOS SDK
194         https://bugs.webkit.org/show_bug.cgi?id=136487
195
196         Reviewed by David Kilzer.
197
198         Add headers that wrap Mac and iOS SPIs and update WebCore source files to include these
199         headers instead of the corresponding actual SPI header(s).
200
201         * WebCore.vcxproj/WebCore.vcxproj:
202         * WebCore.vcxproj/WebCore.vcxproj.filters:
203         * WebCore.vcxproj/WebCoreCG.props:
204         * WebCore.vcxproj/copyForwardingHeaders.cmd:
205         * WebCore.xcodeproj/project.pbxproj:
206         * bindings/objc/DOMInternal.mm:
207         * bridge/objc/objc_instance.mm:
208         * platform/audio/ios/MediaSessionManagerIOS.mm:
209         * platform/cocoa/DisplaySleepDisablerCocoa.cpp:
210         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
211         * platform/graphics/SimpleFontData.h:
212         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
213         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
214         * platform/graphics/cg/BitmapImageCG.cpp:
215         * platform/graphics/cg/ColorCG.cpp:
216         * platform/graphics/cg/GraphicsContextCG.cpp:
217         * platform/graphics/cg/ImageSourceCG.cpp:
218         * platform/graphics/cg/PDFDocumentImage.cpp:
219         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
220         * platform/graphics/ios/FontCacheIOS.mm:
221         * platform/graphics/ios/FontServicesIOS.mm:
222         * platform/graphics/ios/SimpleFontDataIOS.mm:
223         * platform/graphics/mac/FontMac.mm:
224         * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
225         * platform/graphics/mac/MediaPlayerProxy.h:
226         * platform/graphics/mac/SimpleFontDataMac.mm:
227         * platform/ios/LegacyTileCache.mm:
228         * platform/ios/LegacyTileGrid.mm:
229         * platform/ios/LegacyTileGridTile.mm:
230         * platform/ios/PlatformEventFactoryIOS.mm:
231         * platform/ios/PlatformScreenIOS.mm:
232         * platform/ios/WebEvent.mm:
233         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
234         * platform/ios/wak/WAKAppKitStubs.h:
235         * platform/ios/wak/WAKView.h:
236         * platform/ios/wak/WKGraphics.h:
237         * platform/ios/wak/WKGraphics.mm:
238         * platform/ios/wak/WebCoreThread.mm:
239         * platform/network/ios/QuickLook.mm:
240         * platform/spi/ca/CALayerSPI.h: Added.
241         * platform/spi/ca/CATiledLayerSPI.h: Added.
242         * platform/spi/cf/CFLocaleSPI.h: Modified to use EXTERN_C.
243         * platform/spi/cf/CFNetworkConnectionCacheSPI.h: Ditto. Also changed header visibility from private to project.
244         * platform/spi/cf/CFURLRequestSPI.h: Ditto. Also modified to unconditionally include header <CoreFoundation/CFBase.h>.
245         * platform/spi/cg/CGColorTransformSPI.h: Added.
246         * platform/spi/cg/CGContextSPI.h: Added.
247         * platform/spi/cg/CGFloatSPI.h: Added.
248         * platform/spi/cg/CGFontGlyphSupportSPI.h: Added.
249         * platform/spi/cg/CGFontInfoSPI.h: Added.
250         * platform/spi/cg/CGFontRenderingSPI.h: Added.
251         * platform/spi/cg/CGFontUnicodeSupportSPI.h: Added.
252         * platform/spi/cg/CGImageSPI.h: Added.
253         * platform/spi/cg/CGSRegionSPI.h: Added.
254         * platform/spi/cocoa/DispatchSPI.h: Added.
255         * platform/spi/cocoa/IOPMLibSPI.h: Added.
256         * platform/spi/cocoa/MachVMSPI.h: Added.
257         * platform/spi/cocoa/NSFileManagerSPI.h: Added.
258         * platform/spi/cocoa/NSGeometrySPI.h: Added.
259         * platform/spi/cocoa/NSPointerFunctionsSPI.h: Added.
260         * platform/spi/cocoa/dyldSPI.h: Added.
261         * platform/spi/ios/AVPlayerControllerSPI.h: Added.
262         * platform/spi/ios/AVPlayerViewControllerSPI.h: Added.
263         * platform/spi/ios/AVValueTimingSPI.h: Added.
264         * platform/spi/ios/AVVideoLayerSPI.h: Added.
265         * platform/spi/ios/CTFontDescriptorSPI.h: Added.
266         * platform/spi/ios/CTFontSPI.h: Added.
267         * platform/spi/ios/CUICatalogSPI.h: Added.
268         * platform/spi/ios/CUIStyleEffectConfigurationSPI.h: Added.
269         * platform/spi/ios/MPAVRoutingControllerSPI.h: Added.
270         * platform/spi/ios/MobileGestaltSPI.h: Added.
271         * platform/spi/ios/QLPreviewConverterSPI.h: Added.
272         * platform/spi/ios/QuickLookSPI.h: Added.
273         * rendering/RenderThemeIOS.mm:
274
275 2014-09-17  Gavin Barraclough  <barraclough@apple.com>
276
277         DOM timer throttling for hidden plugins
278         https://bugs.webkit.org/show_bug.cgi?id=136197
279
280         Reviewed by Geoff Garen & Andreas Kling.
281
282         For non-visible web pages we slow timers (since they can't be driving animations, etc).
283         We should do the same for plugins.
284
285         There are a few steps to this:
286             - JSPluginElementFunctions notifies DOMTimer when script interacts with a plugin.
287             - DOMTimerFireState keeps a record of events that occur while a timer is firing.
288             - DOMTimer::fired detects timers that interact with invisible/inaudible plugins, and flags itself for throtting.
289             - DOMTimer::intervalClampedToMinimum sets timer intervals appropriately.
290
291         * bindings/js/JSPluginElementFunctions.cpp:
292         (WebCore::pluginScriptObject):
293             - notify DOMTimer when script interacts with a plugin.
294         * html/HTMLPlugInElement.cpp:
295         (WebCore::HTMLPlugInElement::isDetectable):
296         * html/HTMLPlugInElement.h:
297             - added isDetectable, to check for visible / audible plugins.
298         * page/DOMTimer.cpp:
299         (WebCore::DOMTimerFireState::DOMTimerFireState):
300         (WebCore::DOMTimerFireState::~DOMTimerFireState):
301             - track current DOMTimerFireState.
302         (WebCore::DOMTimer::DOMTimer):
303             - initialize m_throttleState.
304         (WebCore::DOMTimer::scriptDidInteractWithPlugin):
305             - if interaction with a plugin occurs while a timer is firing, record on the DOMTimerFireState.
306         (WebCore::DOMTimer::fired):
307             - set DOMTimerFireState, and update m_throttleState accordingly.
308         (WebCore::DOMTimer::updateTimerIntervalIfNecessary):
309             - remove redundant check of maxTimerNestingLevel (covered by intervalClampedToMinimum).
310         (WebCore::DOMTimer::intervalClampedToMinimum):
311             - Also take m_throttleState into account when throttling.
312         * page/DOMTimer.h:
313             - added scriptDidInteractWithPlugin, m_throttleState.
314         * platform/audio/AudioHardwareListener.h:
315             - enum -> enum class.
316         * plugins/PluginViewBase.h:
317         (WebCore::PluginViewBase::audioHardwareActivity):
318             - expose audioHardwareActivity on PluginViewBase (previously available in subclass).
319
320 2014-09-16  Gavin Barraclough  <baraclough@apple.com>
321
322         Exclude page visibility from PageThrottler's hysteresis
323         https://bugs.webkit.org/show_bug.cgi?id=136866
324
325         Reviewed by Geoff Garen.
326
327         Including visibility in the hysteresis mechanism has the effect of prolonging the visually
328         idle timeout, and causing the page hide event to be run at foreground priority. Neither of
329         these are particularly desirable. Instead separate visibility from the rest of the page
330         activities we track (and apply hysteresis to), and feed this directly into determination
331         of the UserActivity state.
332
333         * page/PageThrottler.cpp:
334         (WebCore::PageThrottler::PageThrottler):
335             - when the PageThrottler is instantiated call updateUserActivity to set initial UserActivity.
336         (WebCore::PageThrottler::incrementActivityCount):
337             - simplified - when m_activityCount becomes non-zero, start m_hysteresis.
338         (WebCore::PageThrottler::decrementActivityCount):
339             - simplified - when m_activityCount becomes zero, stop m_hysteresis.
340         (WebCore::PageThrottler::updateUserActivity):
341             - end the UserActivity (allow AppNap) if visually idle and no page activity is taking place.
342         (WebCore::PageThrottler::setViewState):
343             - when the visually idle state changed call updateUserActivity to update the UserActivity.
344         (WebCore::PageThrottler::started):
345         (WebCore::PageThrottler::stopped):
346             - when the hysteresis state changed call updateUserActivity to update the UserActivity.
347         (WebCore::PageThrottler::updateHysteresis): Deleted.
348             - removed: simplified the hysteresis trigger, we now incorporate visually idle state in updateUserActivity.
349         * page/PageThrottler.h:
350             - removed updateHysteresis, added updateUserActivity.
351         * platform/HysteresisActivity.h:
352         (WebCore::HysteresisActivity::state):
353             - determine the curent state of the HysteresisActivity - started, waiting, or stopped.
354
355 2014-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
356
357         [GTK] Fix runtime critical warnings when writing to the clipboard after r173687
358         https://bugs.webkit.org/show_bug.cgi?id=136891
359
360         Reviewed by Philippe Normand.
361
362         * platform/gtk/PasteboardHelper.cpp:
363         (WebCore::PasteboardHelper::writeClipboardContents): Check passed
364         callback is not null before trying to ref/unref it since
365         g_closure_ref/unref are not null safe.
366
367 2014-09-17  Zan Dobersek  <zdobersek@igalia.com>
368
369         [GTK] Add a helper function for display system deduction
370         https://bugs.webkit.org/show_bug.cgi?id=136849
371
372         Reviewed by Martin Robinson.
373
374         getDisplaySystemType() is a helper function that checks the type of the
375         default GdkDisplay object and initializes a static variable to the
376         corresponding value. It then returns the value of that variable.
377
378         When building with the GTK+2 API (still the case with the GTK+2 plugin
379         process) we default to X11.
380
381         The function is declared and implemented in GtkUtilities files.
382
383         * platform/gtk/GtkUtilities.cpp:
384         (WebCore::widgetIsOnscreenToplevelWindow):
385         (WebCore::getDisplaySystemType):
386         * platform/gtk/GtkUtilities.h:
387
388 2014-09-16  Yusuke Suzuki  <utatane.tea@gmail.com>
389
390         filterRootById accidentally clears inAdjacentChain flag
391         https://bugs.webkit.org/show_bug.cgi?id=136851
392
393         Reviewed by Benjamin Poulain.
394
395         Test: fast/selectors/filter-root-node-with-selector-contains-adjacents.html
396
397         * dom/SelectorQuery.cpp:
398         (WebCore::filterRootById):
399
400 2014-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
401
402         [GTK] Fix layering violations in PasteboardGtk
403         https://bugs.webkit.org/show_bug.cgi?id=136802
404
405         Reviewed by Darin Adler.
406
407         Refactor the Pasteboard code moving the WebCore parts to the Editor.
408
409         * PlatformGTK.cmake: Add new file to compilation.
410         * editing/Editor.cpp:
411         (WebCore::Editor::performCutOrCopy):
412         (WebCore::Editor::copyImage):
413         * editing/Editor.h:
414         * editing/gtk/EditorGtk.cpp: Added.
415         (WebCore::createFragmentFromPasteBoardData):
416         (WebCore::Editor::pasteWithPasteboard):
417         (WebCore::getImageAndURLForElement):
418         (WebCore::Editor::writeImageToPasteboard):
419         (WebCore::Editor::writeSelectionToPasteboard):
420         * page/DragController.cpp:
421         (WebCore::DragController::startDrag):
422         * page/gtk/DragControllerGtk.cpp:
423         (WebCore::DragController::declareAndWriteDragImage):
424         * platform/Pasteboard.h:
425         * platform/gtk/DataObjectGtk.cpp: Remove range member, the caller
426         should call setText() + setMarkup() intead.
427         (WebCore::DataObjectGtk::setText):
428         (WebCore::DataObjectGtk::setMarkup):
429         (WebCore::DataObjectGtk::clearText):
430         (WebCore::DataObjectGtk::clearMarkup):
431         (WebCore::DataObjectGtk::clearAllExceptFilenames):
432         * platform/gtk/DataObjectGtk.h:
433         (WebCore::DataObjectGtk::hasText):
434         (WebCore::DataObjectGtk::hasMarkup):
435         (WebCore::DataObjectGtk::clearImage):
436         (WebCore::DataObjectGtk::text):
437         (WebCore::DataObjectGtk::markup):
438         (WebCore::DataObjectGtk::setRange): Deleted.
439         * platform/gtk/GtkDragAndDropHelper.h:
440         * platform/gtk/PasteboardGtk.cpp:
441         (WebCore::PasteboardImage::PasteboardImage):
442         (WebCore::PasteboardImage::~PasteboardImage):
443         (WebCore::Pasteboard::write):
444         (WebCore::Pasteboard::writeSelection): Deleted.
445         (WebCore::getURLForImageElement): Deleted.
446         (WebCore::Pasteboard::writeImage): Deleted.
447         (WebCore::Pasteboard::documentFragment): Deleted.
448         * platform/gtk/PasteboardHelper.cpp:
449         (WebCore::displayFromFrame): Deleted.
450         (WebCore::PasteboardHelper::getPrimarySelectionClipboard): Deleted.
451         * platform/gtk/PasteboardHelper.h:
452
453 2014-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
454
455         DragData should not depend on Clipboard, DocumentFragment, and Document
456         https://bugs.webkit.org/show_bug.cgi?id=21358
457
458         Reviewed by Darin Adler.
459
460         Refactor DragData to not depend on Frame, DocumentFragment,
461         Document and Range. DragData::asFragment() has been moved to
462         DragController and implemented in the platform specific file.
463         DragData methods using Frame has been reworked in Mac to not use
464         Frame, since all other ports were ignoreing the frame parameter.
465
466         * page/DragController.cpp:
467         (WebCore::DragController::documentFragmentFromDragData): Make it
468         a static member to be able to use createFragmentFromDragData().
469         (WebCore::DragController::performDragOperation): Update to
470         DragData API changes.
471         (WebCore::DragController::dispatchTextInputEventFor): Ditto.
472         (WebCore::DragController::concludeEditDrag): Ditto.
473         (WebCore::documentFragmentFromDragData): Deleted.
474         * page/DragController.h:
475         * page/efl/DragControllerEfl.cpp:
476         (WebCore::DragController::createFragmentFromDragData): Move
477         DragData::asFragment() implementation here.
478         * page/gtk/DragControllerGtk.cpp:
479         (WebCore::DragController::dragOperation):
480         (WebCore::DragController::createFragmentFromDragData): Ditto.
481         * page/mac/DragControllerMac.mm:
482         (WebCore::DragController::dragOperation):
483         (WebCore::DragController::createFragmentFromDragData): Ditto.
484         * page/win/DragControllerWin.cpp:
485         (WebCore::DragController::createFragmentFromDragData): Ditto.
486         * platform/DragData.h:
487         * platform/efl/DragDataEfl.cpp:
488         (WebCore::DragData::asPlainText): Remove Frame parameter.
489         (WebCore::DragData::containsURL): Ditto.
490         (WebCore::DragData::asURL): Ditto.
491         (WebCore::DragData::asFragment): Deleted.
492         * platform/gtk/DragDataGtk.cpp:
493         (WebCore::DragData::asPlainText): Remove Frame parameter.
494         (WebCore::DragData::containsCompatibleContent):
495         (WebCore::DragData::containsURL): Ditto.
496         (WebCore::DragData::asURL): Ditto.
497         (WebCore::DragData::asFragment): Deleted.
498         * platform/mac/DragDataMac.mm:
499         (WebCore::DragData::asPlainText): Same implementation as the
500         Editor.
501         (WebCore::DragData::containsURL): Remove Frame parameter.
502         (WebCore::DragData::asURL): Use URLByCanonicalizingURL() instead
503         of using the Editor client.
504         (WebCore::DragData::asFragment): Deleted.
505         * platform/win/DragDataWin.cpp:
506         (WebCore::DragData::containsURL): Remove Frame parameter.
507         (WebCore::DragData::asURL): Ditto.
508         (WebCore::DragData::asPlainText): Ditto.
509         (WebCore::DragData::containsCompatibleContent):
510         (WebCore::DragData::asFragment): Deleted.
511
512 2014-09-16  Chris Dumez  <cdumez@apple.com>
513
514         Rename Node::childNode(index) to traverseToChildAt(index) for clarity
515         https://bugs.webkit.org/show_bug.cgi?id=136825
516
517         Reviewed by Benjamin Poulain.
518
519         Rename Node::childNode(index) to traverseToChildAt(index) to make it
520         clearer that the method is actually traversing the children and thus
521         potentially expensive.
522
523         This patch also avoids calling traverseToChildAt() in a couple of
524         easily avoidable cases.
525
526         No new tests, no behavior change.
527
528         * WebCore.exp.in:
529         * WebCore.order:
530         Remove symbol for ContainerNode::childNode() as it was renamed. It does
531         not seem we need to expose ContainerNode::traverseToChildAt().
532
533         * accessibility/AccessibilityObject.cpp:
534         (WebCore::AccessibilityObject::stringForVisiblePositionRange):
535         (WebCore::AccessibilityObject::lengthForVisiblePositionRange):
536         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
537         (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]):
538         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
539         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]):
540         Mechanical renaming.
541
542         * dom/ContainerNode.cpp:
543         (WebCore::ContainerNode::traverseToChildAt):
544         (WebCore::ContainerNode::childNode): Deleted.
545         * dom/ContainerNode.h:
546         (WebCore::Node::traverseToChildAt):
547         (WebCore::Node::childNode): Deleted.
548         * dom/Node.h:
549         - Rename Node / ContainerNode's childNode(index) to
550           traverseToChildAt(index) to make it clear that it is actually
551           traversing the children and thus potentially expensive.
552         - Clean up the implementation of ContainerNode::traverseToChildAt()
553           to avoid the use of an extra |i| variable.
554
555         * dom/Position.cpp:
556         (WebCore::Position::computeNodeBeforePosition):
557         Avoid calling traverseToChildAt(-1). Relying on the unsigned argument
558         wrapping and the method returning null in this case is a bit obscure
559         and causes unnecessary traversal of all children.
560
561         (WebCore::Position::computeNodeAfterPosition):
562         (WebCore::Position::previous):
563         (WebCore::Position::next):
564         Mechanical renaming and update variable names to stop using
565         abbreviations as per coding style.
566
567         * dom/PositionIterator.h:
568         (WebCore::PositionIterator::PositionIterator):
569         * dom/Range.cpp:
570         (WebCore::Range::insertNode):
571         (WebCore::Range::checkNodeWOffset):
572         (WebCore::Range::firstNode):
573         (WebCore::Range::pastLastNode):
574         * dom/RangeBoundaryPoint.h:
575         (WebCore::RangeBoundaryPoint::set):
576         * editing/BreakBlockquoteCommand.cpp:
577         (WebCore::BreakBlockquoteCommand::doApply):
578         * editing/CompositeEditCommand.cpp:
579         (WebCore::CompositeEditCommand::removeChildrenInRange):
580         * editing/DeleteSelectionCommand.cpp:
581         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
582         * editing/InsertParagraphSeparatorCommand.cpp:
583         (WebCore::InsertParagraphSeparatorCommand::doApply):
584         * editing/TextIterator.cpp:
585         (WebCore::nextInPreOrderCrossingShadowBoundaries):
586         (WebCore::TextIterator::node):
587         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
588         * editing/VisibleUnits.cpp:
589         (WebCore::nextLinePosition):
590         * editing/cocoa/HTMLConverter.mm:
591         (WebCore::editingAttributedStringFromRange):
592         Mechanical renaming.
593
594         * inspector/DOMPatchSupport.cpp:
595         (WebCore::DOMPatchSupport::innerPatchChildren):
596         Iterate over children while incrementing the |i| variable to avoid
597         calling traverseToChildAt(index) repeatedly and thus traversing the
598         children from the beginning every time.
599
600 2014-09-16  Joseph Pecoraro  <pecoraro@apple.com>
601
602         Web Inspector: Reduce a bit of churn setting initial remote inspection state
603         https://bugs.webkit.org/show_bug.cgi?id=136875
604
605         Reviewed by Timothy Hatcher.
606
607         * bindings/js/JSDOMGlobalObject.cpp:
608         (WebCore::JSDOMGlobalObject::finishCreation):
609         We no longer need to toggle this state.
610
611 2014-09-16  Enrica Casucci  <enrica@apple.com>
612
613         Should have an editing behavior specific for IOS.
614         https://bugs.webkit.org/show_bug.cgi?id=136876
615
616         Reviewed by Sam Weinig.
617
618         This patch introduces a new editing behavior type to be able
619         to perform editing tasks that are specific to iOS.
620         All the existing EditingBehavior methods return the same boolean
621         value for for Mac and iOS. A new one has been introduced to support
622         a specific behavior in the DeleteSelectionCommand.
623
624         * editing/DeleteSelectionCommand.cpp:
625         (WebCore::DeleteSelectionCommand::doApply):
626         * editing/EditingBehavior.h:
627         (WebCore::EditingBehavior::shouldConsiderSelectionAsDirectional):
628         (WebCore::EditingBehavior::shouldCenterAlignWhenSelectionIsRevealed):
629         (WebCore::EditingBehavior::shouldToggleStyleBasedOnStartOfSelection):
630         (WebCore::EditingBehavior::shouldAlwaysGrowSelectionWhenExtendingToBoundary):
631         (WebCore::EditingBehavior::shouldSelectOnContextualMenuClick):
632         (WebCore::EditingBehavior::shouldExtendSelectionByWordOrLineAcrossCaret):
633         (WebCore::EditingBehavior::shouldRebalanceWhiteSpacesInSecureField):
634         * editing/EditingBehaviorTypes.h:
635         * editing/FrameSelection.cpp:
636         (WebCore::FrameSelection::positionForPlatform):
637         * page/Settings.cpp:
638         (WebCore::editingBehaviorTypeForPlatform):
639         * testing/InternalSettings.cpp:
640         (WebCore::InternalSettings::setEditingBehavior):
641
642 2014-09-16  Commit Queue  <commit-queue@webkit.org>
643
644         Unreviewed, rolling out r173670.
645         https://bugs.webkit.org/show_bug.cgi?id=136871
646
647         Creates layering violation (Requested by enrica on #webkit).
648
649         Reverted changeset:
650
651         "Move HTMLConverter from editing/cocoa to platform/cocoa."
652         https://bugs.webkit.org/show_bug.cgi?id=136474
653         http://trac.webkit.org/changeset/173670
654
655 2014-09-16  Eric Carlson  <eric.carlson@apple.com>
656
657         [Mac] MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput doesn't work with rotated movies
658         https://bugs.webkit.org/show_bug.cgi?id=136872
659
660         Reviewed by Tim Horton.
661
662         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
663         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator): Add logging.
664         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput): Apply the video track
665             preferred transform.
666
667 2014-09-16  Enrica Casucci  <enrica@apple.com>
668
669         Move HTMLConverter from editing/cocoa to platform/cocoa.
670         https://bugs.webkit.org/show_bug.cgi?id=136474
671
672         Reviewed by Benjamin Poulain.
673
674         This is a platform specific class and it belongs to the platform folder.
675
676         * WebCore.xcodeproj/project.pbxproj:
677         * editing/cocoa: Removed.
678         * editing/cocoa/HTMLConverter.h: Removed.
679         * editing/cocoa/HTMLConverter.mm: Removed.
680         * platform/cocoa/HTMLConverter.h: Copied from editing/cocoa/HTMLConverter.h.
681         * platform/cocoa/HTMLConverter.mm: Copied from editing/cocoa/HTMLConverter.mm.
682
683 2014-09-16  Enrica Casucci  <enrica@apple.com>
684
685         Remove PLATFORM(IOS) from WebCore/editing (Part 3).
686         https://bugs.webkit.org/show_bug.cgi?id=136474
687
688         Reviewed by Benjamin Poulain.
689
690         This is the updated version of the patch that was landed in r173340.
691         This patch removes the use of PLATFORM(IOS) from TextAffinity.h
692         and removes the assumption that EAffinity values match NSSelectionAffinity
693         values. It also removes the includes in TextAffinity.h, creating the need to
694         include explicitly the files when necessary.
695
696         * editing/TextAffinity.h:
697         (kit): Deleted.
698         (core): Deleted.
699         * editing/cocoa/HTMLConverter.mm:
700         * page/mac/WebCoreFrameView.h:
701
702 2014-09-16  Beth Dakin  <bdakin@apple.com>
703
704         overflow:scroll should not leave space for a scroll corner with overlay scrollbars
705         https://bugs.webkit.org/show_bug.cgi?id=136861
706
707         Reviewed by Sam Weinig.
708
709         overflow:scroll should behave like overflow:auto when the scrollbar will render as 
710         an overlay scrollbar.
711
712         Re-name hasAutoVerticalScrollbar()/Horizontal to 
713         hasVerticalScrollbarWithAutoBehavior()/Horizontal, and return true for 
714         overflow:scroll scrollbars that will render as overlay scrollbars.
715         * rendering/RenderBox.cpp:
716         (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior):
717         (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior):
718         * rendering/RenderBox.h:
719         (WebCore::RenderBox::scrollsOverflowX):
720         (WebCore::RenderBox::scrollsOverflowY):
721         (WebCore::RenderBox::hasAutoVerticalScrollbar): Deleted.
722         (WebCore::RenderBox::hasAutoHorizontalScrollbar): Deleted.
723
724         Re-name overflowRequiresScrollbar() to styleRequiresScrollbar() and also re-name 
725         overflowDefinesAutomaticScrollbar() to styleDefinesAutomaticScrollbar(), and make         
726         these functions take into account the fact that overflow:scroll should act like 
727         overflow:auto when the scrollbar will render as an overlay scrollbar.
728         * rendering/RenderLayer.cpp:
729         (WebCore::styleRequiresScrollbar):
730         (WebCore::styleDefinesAutomaticScrollbar):
731         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
732         (WebCore::RenderLayer::calculateClipRects):
733
734 2014-09-16  peavo@outlook.com  <peavo@outlook.com>
735
736         [Curl] Sometimes incomplete or empty content can be loaded from cache.
737         https://bugs.webkit.org/show_bug.cgi?id=136855
738
739         Reviewed by Alex Christensen.
740
741         Sometimes, when two requests with the same url are started at the same time,
742         there is a possibility of loading incomplete or empty content from the cache.
743         This happens because the method CurlCacheEntry::isLoading() is returning the wrong status
744         in the time period between the headers are received, and the content data is received.
745         This can be fixed by using a flag for the load status, instead of checking whether
746         the content file is open. 
747
748         * platform/network/curl/CurlCacheEntry.cpp:
749         (WebCore::CurlCacheEntry::CurlCacheEntry): Initialize loading flag.
750         (WebCore::CurlCacheEntry::isLoading): Return loading flag.
751         (WebCore::CurlCacheEntry::didFail): Call new method to set loading flag.
752         (WebCore::CurlCacheEntry::didFinishLoading): Ditto.
753         (WebCore::CurlCacheEntry::setIsLoading): Added new method to set loading flag.
754         * platform/network/curl/CurlCacheEntry.h: Added loading flag and new method to set it.
755         * platform/network/curl/CurlCacheManager.cpp:
756         (WebCore::CurlCacheManager::didReceiveResponse): Call new method to set loading flag.
757
758 2014-09-16  Chris Dumez  <cdumez@apple.com>
759
760         Rename Node::nodeIndex() to computeNodeIndex() for clarity
761         https://bugs.webkit.org/show_bug.cgi?id=136826
762
763         Reviewed by Benjamin Poulain.
764
765         Rename Node::nodeIndex() to computeNodeIndex() to make it clear that
766         index is being computed and that calling this method is potentially
767         expensive.
768
769         No new tests, no behavior change.
770
771         * WebCore.exp.in:
772         * WebCore.order:
773         Rename exported symbol for Node::nodeIndex() as well.
774
775         * dom/Document.cpp:
776         (WebCore::Document::caretRangeFromPoint):
777         * dom/Node.cpp:
778         (WebCore::Node::computeNodeIndex):
779         (WebCore::Node::nodeIndex): Deleted.
780         * dom/Node.h:
781         * dom/NodeWithIndex.h:
782         (WebCore::NodeWithIndex::index):
783         Clean up implementation to reduce the scope of the Node variable and
784         to follow coding style (variable naming, spacing, star placement).
785
786         * dom/Position.cpp:
787         (WebCore::Position::computeOffsetInContainerNode):
788         (WebCore::Position::previous):
789         (WebCore::Position::next):
790         (WebCore::Position::upstream):
791         (WebCore::Position::downstream):
792         * dom/Position.h:
793         (WebCore::positionInParentBeforeNode):
794         (WebCore::positionInParentAfterNode):
795         * dom/Range.cpp:
796         (WebCore::Range::compareNode):
797         (WebCore::Range::intersectsNode):
798         (WebCore::Range::processContents):
799         (WebCore::Range::insertNode):
800         (WebCore::Range::setStartAfter):
801         (WebCore::Range::setEndBefore):
802         (WebCore::Range::setEndAfter):
803         (WebCore::Range::setStartBefore):
804         * dom/RangeBoundaryPoint.h:
805         (WebCore::RangeBoundaryPoint::ensureOffsetIsValid):
806         * editing/ApplyStyleCommand.cpp:
807         (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
808         (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
809         * editing/DeleteSelectionCommand.cpp:
810         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
811         * editing/Editor.cpp:
812         (WebCore::Editor::avoidIntersectionWithDeleteButtonController):
813         * editing/FrameSelection.cpp:
814         (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected):
815         * editing/ReplaceSelectionCommand.cpp:
816         (WebCore::ReplaceSelectionCommand::doApply):
817         * editing/TextIterator.cpp:
818         (WebCore::TextIterator::range):
819         (WebCore::SimplifiedBackwardsTextIterator::handleReplacedElement):
820         (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode):
821         * editing/htmlediting.cpp:
822         (WebCore::updatePositionForNodeRemoval):
823         * html/HTMLTextFormControlElement.cpp:
824         (WebCore::setContainerAndOffsetForRange):
825         * page/DOMSelection.cpp:
826         (WebCore::DOMSelection::getRangeAt):
827         (WebCore::DOMSelection::containsNode):
828         (WebCore::DOMSelection::shadowAdjustedOffset):
829         * rendering/RenderBlock.cpp:
830         (WebCore::positionForPointRespectingEditingBoundaries):
831         * rendering/RenderTreeAsText.cpp:
832         (WebCore::nodePosition):
833
834 2014-09-16  Jer Noble  <jer.noble@apple.com>
835
836         Videos with controls enabled never receive 'dragstart' events.
837         https://bugs.webkit.org/show_bug.cgi?id=136837
838
839         Reviewed by Eric Carlson.
840
841         Fixes a crash regression introduced by r173631. Node::contains() has an interesting property of returning false
842         if `this` is NULL. Rather than depending on this behavior, explicitly NULL-check state.source and bail early.
843
844         * page/DragController.cpp:
845         (WebCore::DragController::startDrag):
846
847 2014-09-16  Csaba Osztrogon√°c  <ossy@webkit.org>
848
849         URTBF after r173659.
850
851         After r173659 convertToIntLength() is used only inside ENABLE(DASHBOARD_SUPPORT), so it
852         became unused function and caused build failure if ENABLE(DASHBOARD_SUPPORT) is false.
853
854         Source/WebCore/css/StyleResolver.cpp:1471:15: error: 'WebCore::Length WebCore::convertToIntLength(const WebCore::CSSPrimitiveValue*, const WebCore::CSSToLengthConversionData&)'
855         defined but not used [-Werror=unused-function] cc1plus: all warnings being treated as errors
856
857         * css/StyleResolver.cpp: Missing ENABLE(DASHBOARD_SUPPORT) guard added.
858
859 2014-09-14  Darin Adler  <darin@apple.com>
860
861         Scroll snap properties don't handle inherit and initial propertly.
862         https://bugs.webkit.org/show_bug.cgi?id=136643
863
864         Reviewed by Beth Dakin.
865
866         Restructured scroll snap code both to handle inherit and initial, and to reduce the
867         total code size a bit, fixing a few minor bugs along the way. Updated the regression
868         tests to cover the new parts.
869
870         * css/CSSComputedStyleDeclaration.cpp:
871         (WebCore::addValuesForNamedGridLinesAtIndex): Use a modern for loop.
872         (WebCore::scrollSnapDestination): Changed to take a LengthSize. Also streamlined.
873         (WebCore::scrollSnapPoints): Changed to to take a ScrollSnapPoints. Also streamlined and
874         added code to handle the "uses elements" case; serialize that as an identifier, not the
875         string "elements", fixing a minor bug.
876         (WebCore::scrollSnapCoordinates): Changed to take a Vector<LengthSize>. Also streamlined
877         and added code to handle the empty vector case; serialize that as an identifier, not the
878         string "none", fixing a minor bug.
879         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword): Use nullptr.
880         (WebCore::counterToCSSValue): Use nullptr.
881         (WebCore::ComputedStyleExtractor::styledNode): Use nullptr.
882         (WebCore::ComputedStyleExtractor::propertyValue): Use nullptr. Moved CSS_SCROLL_SNAP
883         to a more appropriate section of the switch statement. Made it just call through to
884         the functions above in a more straightforward way.
885         (WebCore::CSSComputedStyleDeclaration::getPropertyValue): Reversed logic to use early
886         return and to call emptyString.
887         (WebCore::CSSComputedStyleDeclaration::item): Use emptyString.
888         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand): Use nullptr.
889         (WebCore::CSSComputedStyleDeclaration::parentRule): Use nullptr.
890         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Use nullptr.
891         (WebCore::CSSComputedStyleDeclaration::getPropertyPriority): Use emptyString.
892         (WebCore::CSSComputedStyleDeclaration::getPropertyShorthand): Use emptyString.
893
894         * css/DeprecatedStyleBuilder.cpp:
895         (WebCore::ApplyPropertyMarqueeIncrement::applyValue): Use the switch statement for the
896         invalid value as well as for the valid values, rather than a separate if statement.
897         Call convertToLength directly rather than through a StyleResolver static member function.
898
899         * css/PropertySetCSSStyleDeclaration.cpp:
900         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue): Fixed a formatting mistake.
901
902         * css/StyleResolver.cpp:
903         (WebCore::convertToIntLength): Made this function local to this file instead of a
904         static member function.
905         (WebCore::convertToFloatLength): Ditto.
906         (WebCore::StyleResolver::parseSnapCoordinate): Added. Used to keep snap point parsing
907         code small.
908         (WebCore::StyleResolver::parseSnapCoordinatePair): Ditto.
909         (WebCore::StyleResolver::parseSnapPoints): Added. Parses an entire snap points property.
910         (WebCore::StyleResolver::applyProperty): Removed various bits of redundant code that
911         were not using the primitiveValue value already in a local variable. Added the
912         HANDLE_INHERIT_AND_INITIAL to all the scroll snap properties and updated since the
913         RenderStyle structure now more closely matches the CSS properties.
914
915         * css/StyleResolver.h: Updated for above changes, and removed a redundant "private:".
916
917         * page/scrolling/AxisScrollSnapOffsets.cpp:
918         (WebCore::appendChildSnapOffsets): Use auto& instead of SnapCoordinate since that type
919         is now gone. Updated since coordinates are now LengthSize.
920         (WebCore::updateFromStyle): Changed to take a reference instead of a pointer and
921         also to fetch the data from RenderStyle in a new way that more closely matches the
922         CSS properties.
923         (WebCore::updateSnapOffsetsForScrollableArea): Ditto. Also moved some memory allocation
924         inside if statements so we don't wastefully allocate and destroy.
925
926         * rendering/style/RenderStyle.cpp: Added an include of StyleScrollSnapPoints.h now
927         that the header doesn't include them. Moved the conditional includes out of the main
928         include paragraph (even though I don't think conditional includes are usually a good
929         idea).
930         (WebCore::RenderStyle::initialScrollSnapPointsX): Added.
931         (WebCore::RenderStyle::initialScrollSnapPointsY): Added.
932         (WebCore::RenderStyle::initialScrollSnapDestination): Added.
933         (WebCore::RenderStyle::initialScrollSnapCoordinates): Added.
934         (WebCore::RenderStyle::scrollSnapPointsX): Added.
935         (WebCore::RenderStyle::scrollSnapPointsY): Added.
936         (WebCore::RenderStyle::scrollSnapDestination): Added.
937         (WebCore::RenderStyle::scrollSnapCoordinates): Added.
938         (WebCore::RenderStyle::setScrollSnapPointsX): Added.
939         (WebCore::RenderStyle::setScrollSnapPointsY): Added.
940         (WebCore::RenderStyle::setScrollSnapDestination): Added.
941         (WebCore::RenderStyle::setScrollSnapCoordinates): Added.
942
943         * rendering/style/RenderStyle.h: Replaced the include of StyleScrollSnapPoints.h with
944         a forward declaration of ScrollSnapPoints. Removed getters and setters for the old
945         style properties and replaced them with new ones that match the CSS properties more
946         closely. Tweaked formatting a bit. Added initial value functions for the the scroll snap
947         properties.
948
949         * rendering/style/StyleRareNonInheritedData.cpp: Added include of StyleScrollSnapPoints.h
950         now that RenderStyle.h doesn't include it.
951         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Updated since
952         m_scrollSnapType is now unsigned instead of ScrollSnapType.
953
954         * rendering/style/StyleRareNonInheritedData.h: Fixed type of m_scrollSnapType to be
955         unsigned instead of ScrollSnapType. This should have been causing problems on Windows,
956         but I think we got lucky and had no detectable problems.
957
958         * rendering/style/StyleScrollSnapPoints.cpp:
959         (WebCore::ScrollSnapPoints::ScrollSnapPoints): Added.
960         (WebCore::operator==): Added overloads for both ScrollSnapPoints and also for
961         StyleScrollSnapPoints; using a free function for both since both have public data.
962         (WebCore::defaultScrollSnapDestination): Added, replaces a static member function.
963         (WebCore::StyleScrollSnapPoints::StyleScrollSnapPoints): Updated both the default
964         constructor and the copy constructor for the new design.
965
966         * rendering/style/StyleScrollSnapPoints.h: Added a ScrollSnapPoints struct for the
967         type of the snap-points-x and snap-points-y CSS properties. Changed the data members
968         of StyleScrollSnapPoints to match the various CSS properties rather than breaking
969         out all the data into separate data members.
970         (WebCore::StyleScrollSnapPoints::defaultRepeatOffset): Deleted. Replaced by the
971         default constructor for ScrollSnapPoints.
972         (WebCore::StyleScrollSnapPoints::defaultDestinationOffset): Deleted. Replaced by
973         a function inside the .cpp file.
974
975 2014-09-16  Youenn Fablet  <youenn.fablet@crf.canon.fr>
976
977         [GStreamer] http/tests/media/video-auth.html is failing
978         https://bugs.webkit.org/show_bug.cgi?id=126619
979
980         Reviewed by Philippe Normand.
981
982         Test: http/tests/media/video-auth-cors.html
983
984         Use stored credentials when retrieving videos following image loading behavior
985         (i.e. stored credentials are always used except when in cors anonymous mode),
986         except that requesting credentials from user remains disabled for cross-origin requests.
987
988         Patch is covered by http/tests/media/video-auth.html.
989
990         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
991         (CachedResourceStreamingClient::CachedResourceStreamingClient): Enable using stored credentials except when using cors anonymous mode.
992
993 2014-09-16  Jinho Bang  <jinho.bang@samsung.com>
994
995         Add version of drawFocusIfNeeded that take a Path2D parameter.
996         https://bugs.webkit.org/show_bug.cgi?id=136846
997
998         Reviewed by Dirk Schulze.
999
1000         Tests: fast/canvas/draw-focus-if-needed-with-path.html
1001
1002         * html/canvas/CanvasRenderingContext2D.cpp:
1003         (WebCore::CanvasRenderingContext2D::drawFocusIfNeeded):
1004         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
1005         * html/canvas/CanvasRenderingContext2D.h:
1006         * html/canvas/CanvasRenderingContext2D.idl:
1007
1008 2014-09-15  Iago Toral  <itoral@igalia.com> and Zan Dobersek  <zdobersek@igalia.com>
1009
1010         [GTK] Add WaylandDisplay
1011         https://bugs.webkit.org/show_bug.cgi?id=136216
1012
1013         Reviewed by Martin Robinson.
1014
1015         Add the WaylandDisplay class. This class is used in the LayerTreeHostGtk,
1016         in the WebProcess, and controls the connection to the nested Wayland
1017         compositor in the UIProcess. Only one instance of the class is used in the
1018         WebProcess, accessible via the static WaylandDisplay::instance() method.
1019
1020         The WaylandDisplay constructor performs the EGL initialization while also
1021         querying the Wayland register, resulting in initializing client-side objects
1022         that can interact with the wl_compositor and wl_webkitgtk interfaces
1023         implemented in the nested Wayland compositor. The single class instance is
1024         only deemed properly initialized if it picked up the Wayland interface objects
1025         and has properly acquired the EGL display and config.
1026
1027         WaylandDisplay::createSurface() is called by the LayerTreeHostGtk during
1028         its own initialization. The method creates a new wl_surface object via the
1029         wl_compositor interface and a new wl_egl_window object that's based on that
1030         surface. For the wl_egl_window object, we fall back to a width or height of 1
1031         in case the passed-in value for either is 0. This avoids problems in Mesa
1032         where widths or heights of 0 are not supported.
1033
1034         We associate the created surface with the passed-in widget ID, as provided
1035         by LayerTreeHostGtk, via the wl_webkitgtk interface. This enables proper
1036         mapping of Wayland surfaces and the GtkWidgets in the UIProcess and makes
1037         it possible for the nested Wayland compositor to correctly determine which
1038         GtkWidget has to be redrawn after some surface has been committed.
1039
1040         WaylandDisplay::createSharingGLContext() creates a new GLContextEGL object
1041         that's to be used as a sharing context. The method creates a new surface
1042         via the wl_compositor interface and uses it to create a dummy native EGL
1043         window that's 1x1px in size. The GLContextEGL object is then created
1044         through the static GLContextEGL::createWindowContext() method.
1045
1046         * PlatformGTK.cmake:
1047         * platform/graphics/wayland/WaylandDisplay.cpp: Added.
1048         (WebCore::WaylandDisplay::globalCallback):
1049         (WebCore::WaylandDisplay::globalRemoveCallback):
1050         (WebCore::WaylandDisplay::instance):
1051         (WebCore::WaylandDisplay::WaylandDisplay):
1052         (WebCore::WaylandDisplay::createSurface):
1053         (WebCore::WaylandDisplay::createSharingGLContext):
1054         * platform/graphics/wayland/WaylandDisplay.h: Added.
1055         (WebCore::WaylandDisplay::nativeDisplay):
1056         (WebCore::WaylandDisplay::eglDisplay):
1057         * platform/graphics/wayland/WaylandSurface.cpp:
1058         (WebCore::WaylandSurface::~WaylandSurface): Assert that the WaylandDisplay
1059         instance is present before going on to destroy the surface resources.
1060
1061 2014-09-15  Chris Dumez  <cdumez@apple.com>
1062
1063         Rename LiveNodeLists / HTMLCollections's nodeMatches() to elementMatches()
1064         https://bugs.webkit.org/show_bug.cgi?id=136844
1065
1066         Reviewed by Sam Weinig.
1067
1068         Rename LiveNodeLists / HTMLCollections's nodeMatches() to elementMatches()
1069         for clarity as the argument is an Element.
1070
1071         No new tests, no behavior change.
1072
1073         * dom/ClassNodeList.h:
1074         (WebCore::ClassNodeList::elementMatches):
1075         (WebCore::ClassNodeList::nodeMatches): Deleted.
1076         * dom/DocumentOrderedMap.cpp:
1077         (WebCore::keyMatchesWindowNamedItem):
1078         (WebCore::keyMatchesDocumentNamedItem):
1079         * dom/Element.cpp:
1080         (WebCore::Element::updateNameForDocument):
1081         (WebCore::Element::updateIdForDocument):
1082         * dom/LiveNodeList.cpp:
1083         (WebCore::LiveNodeList::namedItem):
1084         * dom/LiveNodeList.h:
1085         (WebCore::CachedLiveNodeList<NodeListType>::collectionBegin):
1086         (WebCore::CachedLiveNodeList<NodeListType>::collectionLast):
1087         (WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseForward):
1088         (WebCore::CachedLiveNodeList<NodeListType>::collectionTraverseBackward):
1089         * dom/NameNodeList.h:
1090         (WebCore::NameNodeList::elementMatches):
1091         (WebCore::NameNodeList::nodeMatches): Deleted.
1092         * dom/TagNodeList.h:
1093         (WebCore::TagNodeList::elementMatches):
1094         (WebCore::HTMLTagNodeList::elementMatches):
1095         (WebCore::TagNodeList::nodeMatches): Deleted.
1096         (WebCore::HTMLTagNodeList::nodeMatches): Deleted.
1097         * html/HTMLCollection.cpp:
1098         (WebCore::isMatchingElement):
1099         * html/HTMLNameCollection.cpp:
1100         (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch):
1101         (WebCore::WindowNameCollection::elementMatches):
1102         (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
1103         (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch):
1104         (WebCore::DocumentNameCollection::elementMatches):
1105         (WebCore::WindowNameCollection::nodeMatchesIfNameAttributeMatch): Deleted.
1106         (WebCore::WindowNameCollection::nodeMatches): Deleted.
1107         (WebCore::DocumentNameCollection::nodeMatchesIfIdAttributeMatch): Deleted.
1108         (WebCore::DocumentNameCollection::nodeMatchesIfNameAttributeMatch): Deleted.
1109         (WebCore::DocumentNameCollection::nodeMatches): Deleted.
1110         * html/HTMLNameCollection.h:
1111         * html/LabelsNodeList.cpp:
1112         (WebCore::LabelsNodeList::elementMatches):
1113         (WebCore::LabelsNodeList::nodeMatches): Deleted.
1114         * html/LabelsNodeList.h:
1115         * html/RadioNodeList.cpp:
1116         (WebCore::RadioNodeList::elementMatches):
1117         (WebCore::RadioNodeList::nodeMatches): Deleted.
1118         * html/RadioNodeList.h:
1119
1120 2014-09-15  Chris Dumez  <cdumez@apple.com>
1121
1122         Use an AtomicString as key for caching ClassNodeList objects
1123         https://bugs.webkit.org/show_bug.cgi?id=136830
1124
1125         Reviewed by Benjamin Poulain.
1126
1127         Use an AtomicString as key for caching ClassNodeList objects instead of
1128         a String. ClassNodeList is the only type using a String instead of an
1129         AtomicString as key in the cache HashTable. This brings some
1130         complexity.
1131
1132         I believe this was done to avoid unnecessarily atomizing the String,
1133         for performance reasons. However, at the moment, the String gets
1134         atomized anyway when constructing the ClassNodeList object. This is
1135         because the ClassNodeList::m_classNames member is of SpaceSplitString
1136         type and the SpaceSplitString constructor takes an AtomicString in
1137         argument.
1138
1139         Using an AtomicString to cache ClassNodeLists simplifies the code quite
1140         a bit and decreases the size of NodeListsNodeData as well.
1141
1142         Test: fast/dom/getElementsByClassName/conflict-tag-name.html
1143
1144         * WebCore.order:
1145         Remove symbol corresponding to addCacheWithName() as it was removed.
1146
1147         * dom/ClassNodeList.cpp:
1148         (WebCore::ClassNodeList::~ClassNodeList):
1149         Update the constructor to take an AtomicString in argument instead of
1150         a String, for clarity. The String gets atomized when initializing
1151         m_classNames anyway.
1152
1153         (WebCore::ClassNodeList::ClassNodeList):
1154         Call removeCacheWithAtomicName() instead of removeCacheWithName() now
1155         that m_originalClassNames is an AtomicString.
1156
1157         * dom/ClassNodeList.h:
1158         Use AtomicString instead of String type for classNames, in both the
1159         constructor argument and the m_originalClassNames data member.
1160
1161         * dom/ContainerNode.cpp:
1162         (WebCore::ContainerNode::getElementsByClassName):
1163         Call addCacheWithAtomicName() instead of addCacheWithName() now that
1164         addCacheWithName() has been removed.
1165
1166         * dom/Node.cpp:
1167         (WebCore::NodeListsNodeData::invalidateCaches):
1168         Stop invalidating m_nameCaches as this HashMap no longer exists.
1169
1170         * dom/NodeRareData.h:
1171         (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::hash):
1172         (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::equal):
1173         (WebCore::NodeListsNodeData::isEmpty):
1174         (WebCore::NodeListsNodeData::adoptDocument):
1175         (WebCore::NodeListsNodeData::namedNodeListKey):
1176         (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList):
1177         (WebCore::NodeListsNodeData::addCacheWithName): Deleted.
1178         (WebCore::NodeListsNodeData::removeCacheWithName): Deleted.
1179         - Drop addCacheWithName() / removeCacheWithName() now that no NodeList
1180           uses a String as HashMap key.
1181         - Drop m_nameCaches now that ClassNodeLists are cached in
1182           m_atomicNameCaches instead.
1183         - Remove StringType template parameter and hardcode AtomicString
1184           instead.
1185
1186 2014-09-15  Chris Dumez  <cdumez@apple.com>
1187
1188         Return early in SelectorChecker::checkOne() if selector.isAttributeSelector() is true
1189         https://bugs.webkit.org/show_bug.cgi?id=136838
1190
1191         Reviewed by Benjamin Poulain.
1192
1193         Return early in SelectorChecker::checkOne() if selector.isAttributeSelector()
1194         is true and the selector matched. Previously, we were only returning early if
1195         the selector did not match and we were falling through if it did. This means
1196         that we ended up doing the 2 if() checks below in the method unnecessarily:
1197         - selector.m_match == CSSSelector::PseudoClass
1198         - selector.m_match == CSSSelector::PseudoElement
1199
1200         No new tests, no behavior change.
1201
1202         * css/SelectorChecker.cpp:
1203         (WebCore::SelectorChecker::checkOne):
1204
1205 2014-09-15  Chris Dumez  <cdumez@apple.com>
1206
1207         Un-inline the Node constructor
1208         https://bugs.webkit.org/show_bug.cgi?id=136842
1209
1210         Reviewed by Benjamin Poulain.
1211
1212         Un-inline the Node constructor as it does not seem to impact
1213         performance, based on my testing:
1214         http://dromaeo.com/?id=226992,226998
1215
1216         This reduces the stripped binary size by ~4Kb.
1217
1218         No new tests, no behavior change.
1219
1220         * dom/Document.h:
1221         (WebCore::Node::Node): Deleted.
1222         * dom/Node.cpp:
1223         (WebCore::Node::Node):
1224
1225 2014-09-15  Shivakumar JM  <shiva.jm@samsung.com>
1226
1227         Web Core: Websocket state should be set to closed in didReceiveMessage call back.
1228         https://bugs.webkit.org/show_bug.cgi?id=136219
1229
1230         Reviewed by Alexey Proskuryakov.
1231
1232         Set the Websocket state to closed in didReceiveMessage call back.
1233
1234         Test: http/tests/websocket/tests/hybi/error-event-ready-state.html
1235
1236         * Modules/websockets/WebSocket.cpp:
1237         (WebCore::WebSocket::didReceiveMessageError):
1238
1239 2014-09-15  Jon Honeycutt  <jhoneycutt@apple.com>
1240
1241         Naming clean-up.
1242
1243         Rubber-stamped by Andy Estes.
1244
1245         * html/HTMLFormElement.cpp:
1246         (WebCore::HTMLFormElement::requestAutocomplete):
1247         (WebCore::HTMLFormElement::finishRequestAutocomplete):
1248         Remove superfluous "AutocompleteResult".
1249
1250         * html/HTMLFormElement.h:
1251         Ditto.
1252
1253 2014-09-15  Alexey Proskuryakov  <ap@apple.com>
1254
1255         Crash when logging in to optionshouse.com
1256         https://bugs.webkit.org/show_bug.cgi?id=136834
1257
1258         Reviewed by Anders Carlsson.
1259
1260         No test, because I couldn't make one. I don't have a way to reproduce first-hand.
1261
1262         * platform/network/cf/SocketStreamHandleCFNet.cpp:
1263         (WebCore::SocketStreamHandle::readStreamCallback):
1264         (WebCore::SocketStreamHandle::writeStreamCallback):
1265
1266 2014-09-15  Jer Noble  <jer.noble@apple.com>
1267
1268         Unreviewed build fix for 32-bit builds.
1269
1270         Make casts from unsigned long long -> size_t explicit, rather than implicit. Also
1271         make CARingBuffer be protected by USING_MEDIA_TOOLBOX so ports without that flag
1272         won't try to compile unused code.
1273
1274         * platform/audio/mac/CARingBuffer.cpp:
1275         (WebCore::CARingBuffer::fetch):
1276         * platform/audio/mac/CARingBuffer.h:
1277         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1278         (WebCore::AudioSourceProviderAVFObjC::provideInput):
1279
1280 2014-09-15  Jer Noble  <jer.noble@apple.com>
1281
1282         Unreviewed logic fix from r173631. Logic for includeShadowDOM was reversed.
1283
1284         * page/DragController.cpp:
1285         (WebCore::DragController::startDrag):
1286
1287 2014-09-15  Jer Noble  <jer.noble@apple.com>
1288
1289         Videos with controls enabled never receive 'dragstart' events.
1290         https://bugs.webkit.org/show_bug.cgi?id=136837
1291
1292         Reviewed by Simon Fraser.
1293
1294         When initiating a drag, the DragController checks whether the hit-tested element at a
1295         drag location is a child of the drag source, and bails if early if that is not the case.
1296         For a <video> element with controls, the hit-tested element is an element within the
1297         <video> element's Shadow DOM. Because the DragController uses a method which does not
1298         take Shadow DOM into account when determining a child-parent relationship, this test fails
1299         and all drag operations fail as well.
1300
1301         For <video> elements only, when testing whether the drag source is an ancestor of the
1302         hit-tested element, use containsIncludingShadowDOM() instead of contains(). To ensure that
1303         the controls are still usable when a drag listener is active on a <video> element, mark
1304         the controls as a draggable element, but simply call preventDefault() in the controls'
1305         'dragstart' handler, ensuring the timeline and volume controls are themselves still draggable.
1306
1307         * Modules/mediacontrols/mediaControlsApple.css:
1308         (audio::-webkit-media-controls-panel):
1309         * Modules/mediacontrols/mediaControlsApple.js:
1310         (Controller.prototype.createControls):
1311         (Controller.prototype.handlePanelDragStart):
1312         * page/DragController.cpp:
1313         (WebCore::DragController::startDrag):
1314
1315 2014-09-15  Roger Fong  <roger_fong@apple.com>
1316
1317         Unreviewed. Add an unimplemented case to handle CSSPropertyWebkitInitialLetter so we don't get an assertion failure.
1318
1319         * css/SVGCSSStyleSelector.cpp:
1320         (WebCore::StyleResolver::applySVGProperty):
1321
1322 2014-09-15  Jer Noble  <jer.noble@apple.com>
1323
1324         [Mac] Support audioSourceProvider() in MediaPlayerPrivateAVFoundationObjC
1325         https://bugs.webkit.org/show_bug.cgi?id=135042
1326
1327         Reviewed by Eric Carlson.
1328
1329         Add support for AudioSourceProvider in MediaPlayerPrivateAVFoundationObjC, thereby
1330         supporting MediaElementAudioSourceNode.
1331
1332         Import the CARingBuffer from CoreAudio sample code, making the necessary modifications
1333         for WebKit style and coding conventions. The threading assumptions for this class are
1334         that there will be a single writer thread and a single reader thread.
1335
1336         * platform/audio/mac/CARingBuffer.cpp: Added.
1337         (WebCore::CARingBuffer::create): Create a unique_ptr.
1338         (WebCore::CARingBuffer::CARingBuffer): Simple constructor.
1339         (WebCore::CARingBuffer::~CARingBuffer): Simple destructor.
1340         (WebCore::CARingBuffer::allocate): Initialize the buffers and time bounds structures.
1341         (WebCore::CARingBuffer::deallocate): Destroy same.
1342         (WebCore::ZeroRange): Static utility method.
1343         (WebCore::StoreABL): Ditto.
1344         (WebCore::FetchABL): Ditto.
1345         (WebCore::ZeroABL): Ditto.
1346         (WebCore::CARingBuffer::store): Store the passed in buffer in the ring buffer, wrapping
1347             if necessary.
1348         (WebCore::CARingBuffer::setTimeBounds): Set the new time bounds by incrementing the
1349             bounds index locally, filling in the new values, then atomically incrementing the
1350             reader-visible index.
1351         (WebCore::CARingBuffer::getTimeBounds): Get the new time bounds by masking the time
1352             bounds index, and using it as an offset to the time bounds array. Protect against
1353             CPU starvation on the reading thread by checking the index against the stored
1354             index in the array entry. This check will fail if the writing thread has wrapped
1355             more than the size of the array.
1356         (WebCore::CARingBuffer::clipTimeBounds): Clamp the passed values to the available bounds.
1357         (WebCore::CARingBuffer::startFrame): Simple accessor.
1358         (WebCore::CARingBuffer::endFrame): Ditto.
1359         (WebCore::CARingBuffer::fetch): Read an audio buffer list from the ring buffer, possbily
1360             wrapping around to the start of the ring buffer.
1361         * platform/audio/mac/CARingBuffer.h: Added.
1362         (WebCore::CARingBuffer::numberOfChannels): Simple accessor.
1363         (WebCore::CARingBuffer::frameOffset): Ditto.
1364         (WebCore::CARingBuffer::TimeBounds::TimeBounds): Struct holding the start and end frame values.
1365
1366         Add an implementation of AudioSourceProvider, using AVAudioMix and MTAudioProcessingTap
1367         to tap an AVPlayerItem's audio output and feed it to a MediaElementAudioSourceNode.
1368
1369         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h: Added.
1370         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: Added.
1371         (WebCore::AudioSourceProviderAVFObjC::create): Simple factory.
1372         (WebCore::AudioSourceProviderAVFObjC::AudioSourceProviderAVFObjC): Simple constructor.
1373         (WebCore::AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC): Simple destructor.
1374         (WebCore::AudioSourceProviderAVFObjC::provideInput): Push audio into the ring buffer.
1375         (WebCore::AudioSourceProviderAVFObjC::setClient): Call destroyMix()/createMix() as appropriate.
1376         (WebCore::AudioSourceProviderAVFObjC::setPlayerItem): Ditto.
1377         (WebCore::AudioSourceProviderAVFObjC::destroyMix): Detach and destroy the AVAudioMix and tap.
1378         (WebCore::AudioSourceProviderAVFObjC::createMix): Set up the AVAudioMix and tap and attach to
1379             the AVPlayerItem.
1380         (WebCore::AudioSourceProviderAVFObjC::initCallback): Pass to class method.
1381         (WebCore::AudioSourceProviderAVFObjC::finalizeCallback): Ditto.
1382         (WebCore::AudioSourceProviderAVFObjC::prepareCallback): Ditto.
1383         (WebCore::AudioSourceProviderAVFObjC::unprepareCallback): Ditto.
1384         (WebCore::AudioSourceProviderAVFObjC::processCallback): Ditto.
1385         (WebCore::AudioSourceProviderAVFObjC::init): Set up the storage pointer for the tap.
1386         (WebCore::AudioSourceProviderAVFObjC::finalize): No-op.
1387         (WebCore::operator==): Compare two AudioStreamBasicDescription objects.
1388         (WebCore::operator!=): Ditto.
1389         (WebCore::AudioSourceProviderAVFObjC::prepare): Create an AudioCoverter object if necessary,
1390             create the ring buffer, and notify the client of format changes.
1391         (WebCore::AudioSourceProviderAVFObjC::unprepare): Destroy same.
1392         (WebCore::AudioSourceProviderAVFObjC::process): Copy samples out of the ring buffer,
1393             format converting them if necessary. Mute original audio.
1394
1395         Create the AudioSourceProviderAVFObjC object and notify it when the current AVPlayerItem changes.
1396
1397         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1398         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1399         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
1400         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
1401         (WebCore::MediaPlayerPrivateAVFoundationObjC::audioSourceProvider):
1402
1403         Enable SOFT_LINK_MAY_FAIL on the Mac platform.
1404
1405         * platform/mac/SoftLinking.h:
1406
1407         Add new files to the project.
1408
1409         * WebCore.xcodeproj/project.pbxproj:
1410
1411 2014-09-15  Chris Dumez  <cdumez@apple.com>
1412
1413         Avoid redundant isElementNode() checks in Traversal<HTML*Element> / Traversal<SVG*Element>
1414         https://bugs.webkit.org/show_bug.cgi?id=136719
1415
1416         Reviewed by Darin Adler.
1417
1418         Avoid redundant isElementNode() checks in Traversal<HTML*Element> /
1419         Traversal<SVG*Element>.  We used to iterate through Elements, and then
1420         call isElementOfType<HTML*Element>()  on each Element. This made sense
1421         because hasTagName() used to be defined on Element. However, after
1422         http://trac.webkit.org/changeset/165699, hasTagName() is now defined on
1423         Node for HTMLQualifiedName / SVGQualifiedName arguments.
1424
1425         Node::hasTagName(HTMLQualifiedName) basically does the following check
1426         "isHTMLElement() &&  toHTMLElement(*this).hasTagName(tagName)". As a
1427         consequence, doing an isElementNode() check is now redundant as
1428         isHTMLElement() is defined on Node.
1429
1430         This patch adds a template parameter to isElementOfType() so that it can
1431         take any type in argument (particulaly Node, Element, HTMLElement,
1432         SVGElement, MathMLElement), not just an Element. I had to add an
1433         ElementTypeCastTraits struct to support partial specialization as C++
1434         does not support partial specialization of template functions.
1435         This patch also updates Traversal<ElementType> so that the methods use
1436         NodeTraversal internally instead of Traversal<ElementType>. As a result,
1437         we now iterate over Nodes (not Elements) and call the new
1438         isElementOfType<ElementType>(Node) helpers (which are efficient after
1439         r165699).
1440
1441         Before the patch, the code ended up doing the following checks for
1442         Traversal<HTML*element>:
1443         node.isElementNode() && toElement(node).isHTMLElement()
1444             && toHTMLElement(node).hasTagName(HTMLNames::fooTag)
1445
1446         After the patch, the code only does:
1447         node.isHTMLElement()
1448             && toHTMLElement(node).hasTagName(HTMLNames::fooTag)
1449
1450         No new tests, no behavior change.
1451
1452         * dom/Element.h:
1453         (WebCore::Element>):
1454         (WebCore::isElementOfType):
1455         Add template parameter to isElementOfType() function so that it can
1456         handle any argument type, not just Elements. Also introduce an
1457         ElementTypeCastTraits struct that is called by isElementOfType()
1458         function so that we can so partial template specialization.
1459
1460         * dom/ElementTraversal.h:
1461         (WebCore::Traversal<ElementType>::firstWithinTemplate):
1462         (WebCore::Traversal<ElementType>::lastWithinTemplate):
1463         (WebCore::Traversal<ElementType>::nextTemplate):
1464         (WebCore::Traversal<ElementType>::previousTemplate):
1465         Use NodeTraversal API internally instead of Traversal<Element> to avoid
1466         redundant isElementNode() checks.
1467
1468         (WebCore::Traversal<Element>::lastWithinTemplate): Deleted.
1469         The code is now identical to the generic version.
1470
1471         (WebCore::Traversal<Element>::previousTemplate): Deleted.
1472         The code is now identical to the generic version.
1473
1474         * dom/make_names.pl:
1475         (printTypeHelpers):
1476         - Generate template specializations for ElementTypeCastTraits struct
1477           instead of isElementOfType(). This avoids having to provide overloads
1478           for specific argument types (e.g. Node, Element, HTMLElement, ...).
1479         - Share more code between HTML code path and the other path (for SVG,
1480           MTHML).
1481
1482         * html/HTMLElement.h:
1483         (WebCore::HTMLElement>):
1484         Provide HTMLElement template specialization for ElementTypeCastTraits
1485         struct instead of isElementOfType().
1486
1487         * html/HTMLFormControlElement.h:
1488         (WebCore::HTMLFormControlElement>):
1489         Provide HTMLFormControlElement template specialization for
1490         ElementTypeCastTraits struct instead of isElementOfType().
1491
1492         * html/HTMLFrameElementBase.h:
1493         (WebCore::isHTMLFrameElementBase):
1494         - Remove helper taking an Element in argument as it does not bring any
1495           benefit. Instead, update the overload taking a Node in argument to
1496           remove the unnecessary isElementNode() check as isHTMLFrameElement(Node)
1497           is now efficient.
1498         - Add an overload taking an HTMLElement in argument so that we can bypass
1499           the isHTMLElement() check when we know the input is an HTMLElement.
1500
1501         * html/HTMLMediaElement.h:
1502         (WebCore::HTMLMediaElement>):
1503         Provide HTMLMediaElement template specialization for ElementTypeCastTraits
1504         struct instead of isElementOfType().
1505
1506         * html/HTMLPlugInImageElement.h:
1507         (WebCore::HTMLPlugInImageElement>):
1508         Provide HTMLPlugInImageElement template specialization for
1509         ElementTypeCastTraits struct instead of isElementOfType().
1510
1511         * html/LabelableElement.h:
1512         (WebCore::LabelableElement>):
1513         Provide LabelableElement template specialization for ElementTypeCastTraits
1514         struct instead of isElementOfType().
1515
1516         * mathml/MathMLElement.h:
1517         (WebCore::MathMLElement>):
1518         Provide MathMLElement template specialization for ElementTypeCastTraits
1519         struct for consistency with HTMLElement / SVGElement.
1520
1521         * svg/SVGElement.h:
1522         (WebCore::SVGElement>):
1523         - Provide SVGElement template specialization for ElementTypeCastTraits
1524           struct instead of isElementOfType().
1525         - include SVGElementTypeHelpers.h at the end of the file (similarly to
1526           what is already done in HTMLElement.h because
1527           isElementOfType(const SVGElement&) needs to be defiend because the
1528           include.
1529
1530         * svg/SVGFilterPrimitiveStandardAttributes.h:
1531         (WebCore::SVGFilterPrimitiveStandardAttributes>):
1532         Provide SVGFilterPrimitiveStandardAttributes template specialization for
1533         ElementTypeCastTraits struct instead of isElementOfType().
1534
1535         * svg/animation/SVGSMILElement.h:
1536         (WebCore::SVGSMILElement>):
1537         Provide SVGSMILElement template specialization for ElementTypeCastTraits
1538         struct instead of isElementOfType().
1539
1540
1541 2014-08-07  Sergio Villar Senin  <svillar@igalia.com>
1542
1543         [CSS Grid Layout] Sort items by span when resolving content-based track sizing functions
1544         https://bugs.webkit.org/show_bug.cgi?id=135701
1545
1546         Reviewed by Darin Adler.
1547
1548         Section 10.4 of the specs mentions that we should first treat non
1549         spanning items and then incrementally proceed with items with
1550         greater spans when resolving the track breaths in the Track Sizing
1551         Algorithm.
1552
1553         As a nice side effect we're removing the multiple processing of
1554         spanning grid items caused by GridIterator (it returns the same
1555         item as many times as the number of cells it spans). This adds a
1556         ~4% performance penalty in auto-grid-lots-of-data.html mainly due
1557         to the use of a hash to remove duplicates.
1558
1559         Test: fast/css-grid-layout/grid-item-order-in-content-sized-columns-resolution.html
1560
1561         * rendering/RenderGrid.cpp:
1562         (WebCore::RenderGrid::gridItemSpan):
1563         (WebCore::gridItemWithSpanSorter):
1564         (WebCore::uniquePointerInPair):
1565         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
1566         * rendering/RenderGrid.h:
1567
1568 2014-09-15  Zan Dobersek  <zdobersek@igalia.com>
1569
1570         [GTK][CMake] Build WebCore with Wayland-specific include directories, libraries
1571         https://bugs.webkit.org/show_bug.cgi?id=136815
1572
1573         Reviewed by Philippe Normand.
1574
1575         * PlatformGTK.cmake: Add the platform/graphics/wayland/ directory to the list of
1576         WebCore's include directories. Add include directories of the Wayland dependency
1577         to the list of WebCore's include directories. Same for the Wayland libraries.
1578
1579 2014-09-15  peavo@outlook.com  <peavo@outlook.com>
1580
1581         [WinCairo] Make it easier to enable/disable GStreamer.
1582         https://bugs.webkit.org/show_bug.cgi?id=135766
1583
1584         Reviewed by Brent Fulgham.
1585
1586         Make it possible to enable/disable GStreamer by editing the new user macro ENABLE_GSTREAMER_WINCAIRO.
1587
1588         * WebCore.vcxproj/WebCoreDebugWinCairo.props: Import GStreamer property file.
1589         * WebCore.vcxproj/WebCoreReleaseWinCairo.props: Ditto.
1590
1591 2014-09-12  Sergio Villar Senin  <svillar@igalia.com>
1592
1593         [CSS Grid Layout] Crash at CSSParser::parseGridTemplateRowsAndAreas
1594         https://bugs.webkit.org/show_bug.cgi?id=136778
1595
1596         Reviewed by Darin Adler.
1597
1598         An empty list of grid line names (represented by "()") does not
1599         add anything to the list of parsed values. That's why trying to
1600         concatenate an adjacent list of grid line names was failing,
1601         because we were trying to concatenate a list with the last parsed
1602         CSSValue which was not the expected grid line names list.
1603
1604         * css/CSSParser.cpp:
1605         (WebCore::CSSParser::parseGridTemplateRowsAndAreas):
1606         (WebCore::CSSParser::parseGridLineNames):
1607         * css/CSSParser.h:
1608
1609 2014-09-15  Andres Gomez  <agomez@igalia.com>
1610
1611         [GStreamer] don't send transferMode HTTP header
1612         https://bugs.webkit.org/show_bug.cgi?id=136781
1613
1614         Reviewed by Philippe Normand.
1615
1616         No header at all is better than having the wrong header as DLNA
1617         mandates that a missing header has to be tolerated while a wrong
1618         header is an error.
1619
1620         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1621         (webKitWebSrcStart):
1622         * platform/network/HTTPHeaderNames.in:
1623
1624 2014-09-14  Christophe Dumez  <cdumez@apple.com>
1625
1626         Fix post-mortem nits for r173528 & r173549
1627         https://bugs.webkit.org/show_bug.cgi?id=136808
1628
1629         Reviewed by Darin Adler.
1630
1631         Fix post-mortem nits for r173528 & r173549.
1632
1633         No new tests, no behavior change.
1634
1635         * accessibility/AccessibilityNodeObject.cpp:
1636         (WebCore::AccessibilityNodeObject::alternativeTextForWebArea):
1637         - Use auto* instead of more specific types.
1638         - Use fastGetAttribute() instead of getAttribute() as this is
1639           supported for the "title" attribute.
1640
1641         * editing/FrameSelection.cpp:
1642         (WebCore::FrameSelection::setSelectionFromNone):
1643         Use auto* instead of more specific types.
1644
1645 2014-09-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1646
1647         Introduce FONT_DATA_TYPE_CASTS, and use it
1648         https://bugs.webkit.org/show_bug.cgi?id=136766
1649
1650         Reviewed by Darin Adler.
1651
1652         As a step to use toFoo, this patch introduces FONT_DATA_TYPE_CASTS macro for toFooFontData().
1653         This will help to detect wrong type cast.
1654
1655         * platform/graphics/FontData.h:
1656         * platform/graphics/FontGlyphs.cpp:
1657         (WebCore::FontGlyphs::releaseFontData):
1658         (WebCore::FontGlyphs::determinePitch):
1659         * platform/graphics/GlyphPageTreeNode.cpp:
1660         (WebCore::GlyphPageTreeNode::initializePage):
1661         * platform/graphics/SegmentedFontData.h:
1662         * platform/graphics/SimpleFontData.h:
1663         * platform/graphics/mac/SimpleFontDataMac.mm:
1664         (WebCore::SimpleFontData::getCompositeFontReferenceFontData):
1665
1666 2014-09-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1667
1668         Generate toCSSStyleSheet using STYLE_SHEET_TYPE_CASTS
1669         https://bugs.webkit.org/show_bug.cgi?id=136774
1670
1671         Reviewed by Darin Adler.
1672
1673         As a step to use toFoo, this patch introduces STYLE_SHEET_TYPE_CASTS for toCSSStyleSheet().
1674         This will help to detect wrong type cast. Additonally this patch helps to remove argument type of RefPtr.
1675
1676         No new tests, no behavior changes.
1677
1678         * bindings/gobject/WebKitDOMPrivate.cpp:
1679         (WebKit::wrap):
1680         * css/CSSStyleSheet.h:
1681         * css/StyleSheet.h:
1682         * dom/DocumentStyleSheetCollection.cpp:
1683         (WebCore::filterEnabledNonemptyCSSStyleSheets):
1684         * dom/ProcessingInstruction.cpp:
1685         (WebCore::ProcessingInstruction::parseStyleSheet):
1686         * inspector/InspectorCSSAgent.cpp:
1687         (WebCore::InspectorCSSAgent::getAllStyleSheets):
1688         (WebCore::InspectorCSSAgent::collectStyleSheets):
1689
1690 2014-09-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1691
1692         Generate toFooElementData() using ELEMENT_DATA_TYPE_CASTS
1693         https://bugs.webkit.org/show_bug.cgi?id=136775
1694
1695         Reviewed by Darin Adler.
1696
1697         As a step to use toFoo, this patch introduces ELEMENT_DATA_TYPE_CASTS for toFooElementData().
1698         This will help to detect wrong type cast. Additonally this patch helps to remove argument type of RefPtr.
1699
1700         No new tests, no behavior changes.
1701
1702         * dom/Element.cpp:
1703         (WebCore::Element::cloneAttributesFromElement):
1704         (WebCore::Element::createUniqueElementData):
1705         * dom/ElementData.cpp:
1706         (WebCore::ElementData::destroy):
1707         * dom/ElementData.h:
1708         (WebCore::ElementData::length):
1709         (WebCore::ElementData::attributeBase):
1710         (WebCore::ElementData::presentationAttributeStyle):
1711         (WebCore::ElementData::attributesIterator):
1712         * svg/SVGSVGElement.cpp:
1713         (WebCore::SVGSVGElement::setupInitialView): Remove static_cast<SVGSVGElement*>
1714
1715 2014-09-14  Chris Dumez  <cdumez@apple.com>
1716
1717         Remove unnecessary overloads taking a ContainerNode in Element Traversal
1718         https://bugs.webkit.org/show_bug.cgi?id=136767
1719
1720         Reviewed by Darin Adler.
1721
1722         Remove unnecessary overloads taking a ContainerNode in Element Traversal.
1723         Several of those don't bring any performance improvements as the needed
1724         methods are defined on Node (not ContainerNode).
1725
1726         No new tests, no behavior change.
1727
1728         * dom/ElementTraversal.h:
1729         (WebCore::Traversal<Element>::previous):
1730         NodeTraversal::previous() takes a const Node* in argument so the
1731         ContainerNode overload is not needed.
1732
1733         (WebCore::Traversal<ElementType>::previous):
1734         Unnecessary now that Traversal<Element>::previous() takes a const Node*
1735         in argument.
1736
1737         (WebCore::Traversal<ElementType>::nextSibling):
1738         nextSibling() is defined on Node, not ContainerNode, so the overload
1739         is not needed.
1740
1741         (WebCore::Traversal<ElementType>::previousSibling):
1742         previousSibling() is defined on Node, not ContainerNode, so the overload
1743         is not needed.
1744
1745         (WebCore::Traversal<Element>::previousTemplate): Deleted.
1746         (WebCore::Traversal<ElementType>::previousTemplate): Deleted.
1747         (WebCore::Traversal<ElementType>::nextSiblingTemplate): Deleted.
1748         (WebCore::Traversal<ElementType>::previousSiblingTemplate): Deleted.
1749         No need to have those functions templated anymore.
1750
1751 2014-09-14  Daniel Bates  <dabates@apple.com>
1752
1753         [iOS] Attempt to fix the iOS build after <http://trac.webkit.org/changeset/173606>
1754         (https://bugs.webkit.org/show_bug.cgi?id=136789)
1755
1756         Substitute Node::countChildNodes() for Node::childNodeCount() in more places.
1757
1758         Although I updated a comment in WebCore::lastOffsetForEditing() (defined in file
1759         editing/htmlediting.cpp) to refer to Node::countChildNodes(), I'm unclear what the
1760         comment is trying to explain that isn't otherwise explained by the code or the
1761         comments that precede this function. Specifically, I don't understand the use of
1762         the word "preempt" in the comment. We should look to improve the readability of
1763         this comment.
1764
1765         * editing/htmlediting.cpp:
1766         (WebCore::lastOffsetForEditing):
1767         * page/ios/FrameIOS.mm:
1768         (WebCore::Frame::interpretationsForCurrentRoot):
1769
1770 2014-09-14  Chris Dumez  <cdumez@apple.com>
1771
1772         Drop NodeTraversal::nextSkippingChildren() overload taking a ContainerNode
1773         https://bugs.webkit.org/show_bug.cgi?id=136764
1774
1775         Reviewed by Darin Adler.
1776
1777         Drop NodeTraversal::nextSkippingChildren() overload taking a
1778         ContainerNode argument. This one does not bring any performance
1779         improvement because nextSibling() is defined on Node and
1780         nextAncestorSibling() takes a Node in argument.
1781
1782         Also remove the overload in ElementTraversal as it no longer makes
1783         sense after this change.
1784
1785         No new tests, no behavior change.
1786
1787         * dom/ElementTraversal.h:
1788         (WebCore::Traversal<ElementType>::nextSkippingChildren):
1789         (WebCore::Traversal<ElementType>::nextSkippingChildrenTemplate): Deleted.
1790         * dom/NodeTraversal.h:
1791         (WebCore::NodeTraversal::nextSkippingChildren):
1792         (WebCore::NodeTraversal::next):
1793         (WebCore::NodeTraversal::traverseNextSkippingChildrenTemplate): Deleted.
1794
1795 2014-09-14  Chris Dumez  <cdumez@apple.com>
1796
1797         Rename Node::childNodeCount() to countChildNodes() and avoid inefficient uses
1798         https://bugs.webkit.org/show_bug.cgi?id=136789
1799
1800         Reviewed by Darin Adler.
1801
1802         Rename Node::childNodeCount() to countChildNodes() to make it clearer
1803         that the method actually computes the result rather than returning a
1804         cached value.
1805
1806         This patch also introduces a new Node::hasOneChild() method that is
1807         used to check if a Node has a single child. This is much more efficient
1808         than calling countChildNodes() == 1.
1809
1810         The patch also leverages Node::hasChildNodes() in a lot of places
1811         instead of calling countChildNodes().
1812
1813         Finally, in a couple of places, we now use childrenOfType() to iterate
1814         over children more efficient than using countChildNodes() and
1815         childNode(index).
1816
1817         No new tests, no behavior change.
1818
1819         * WebCore.exp.in:
1820         * WebCore.order:
1821         Update the name of the exposed symbol for countChildNodes().
1822
1823         * dom/ContainerNode.cpp:
1824         (WebCore::ContainerNode::removeChildren):
1825         (WebCore::ContainerNode::countChildNodes):
1826         (WebCore::ContainerNode::childNodeCount): Deleted.
1827         Rename childNodeCount() to countChildNodes() to make it obvious it is
1828         computing the result rather than returning a cached value.
1829
1830         * dom/ContainerNode.h:
1831         (WebCore::ContainerNode::hasOneChild):
1832         Introduce an efficient way to check in a ContainerNode has a single
1833         child as "countChildNodes() == 1" calls were frequent and inefficient.
1834
1835         (WebCore::Node::countChildNodes):
1836         (WebCore::Node::childNodeCount): Deleted.
1837         * dom/Node.h:
1838         Rename childNodeCount() to countChildNodes().
1839
1840         * dom/Position.cpp:
1841         (WebCore::Position::parentAnchoredEquivalent):
1842         * dom/Position.h:
1843         (WebCore::lastOffsetInNode):
1844         * dom/Range.cpp:
1845         Mechanical renaming.
1846
1847         (WebCore::lengthOfContentsInNode):
1848         * editing/ApplyStyleCommand.cpp:
1849         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
1850         (WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun):
1851         (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
1852         (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
1853         (WebCore::ApplyStyleCommand::applyInlineStyleChange):
1854         Call hasChildNodes() rather than countChildNodes() as it is a lot more
1855         efficient.
1856
1857         * editing/Editor.cpp:
1858         (WebCore::Editor::setTextAsChildOfElement):
1859         (WebCore::Editor::rangeOfString):
1860         (WebCore::Editor::countMatchesForText):
1861         * editing/FrameSelection.cpp:
1862         (WebCore::FrameSelection::elementRangeContainingCaretSelection):
1863         Mechanical renaming.
1864
1865         * editing/ReplaceSelectionCommand.cpp:
1866         (WebCore::ReplaceSelectionCommand::insertAsListItems):
1867         Call hasOneChild() instead of countChildNodes() == 1. Also remove
1868         redundant listElement->hasChildNodes() check as hasOneChild() takes
1869         care of this already.
1870
1871         * editing/TextIterator.cpp:
1872         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
1873         * editing/VisibleUnits.cpp:
1874         (WebCore::endOfDocument):
1875         * editing/htmlediting.cpp:
1876         (WebCore::lastOffsetForEditing):
1877         Mechanical renaming.
1878
1879         (WebCore::visiblePositionBeforeNode):
1880         (WebCore::visiblePositionAfterNode):
1881         Call hasChildNodes() instead of converting countChildNodes() to a
1882         boolean.
1883
1884         * editing/markup.cpp:
1885         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
1886         Call !hasChildNodes() instead of !countChildNodes().
1887
1888         (WebCore::isPlainTextMarkup):
1889         - Drop !node->isElementNode() check as !node->hasTagName(divTag) takes
1890           care of discarding non-Element Nodes already.
1891         - Cast the Node to an HTMLDivElement as soon as possible to avoid
1892           calling calling the slower Node APIs in several cases.
1893         - Call hasOneChild() instead of countChildNodes() == 1.
1894
1895         * html/HTMLDivElement.h:
1896         * html/HTMLTagNames.in:
1897         Generate casting helpers as I use them in WebCore::isPlainTextMarkup().
1898
1899         * html/HTMLScriptElement.cpp:
1900         (WebCore::HTMLScriptElement::setText):
1901         * html/HTMLTitleElement.cpp:
1902         (WebCore::HTMLTitleElement::setText):
1903         Call hasOneChild() / hasChildNodes() instead of countChildNodes().
1904
1905         * html/shadow/MediaControlElements.cpp:
1906         (WebCore::MediaControlTimelineContainerElement::setTimeDisplaysHidden):
1907         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
1908         Use childrenOfType<Element>() to iterate of child Elements instead of
1909         slower childNodeCount() + childNode(index) + isElementNode(). Also,
1910         childNodeCount() was not even cached before the loop.
1911
1912         * html/track/VTTRegion.cpp:
1913         (WebCore::VTTRegion::displayLastTextTrackCueBox):
1914         Use childrenOfType<Element>() to iterate of child Elements, thus
1915         avoiding calling childNodeCount() + childNode(index).
1916
1917         * page/DOMSelection.cpp:
1918         (WebCore::DOMSelection::extend):
1919         (WebCore::DOMSelection::selectAllChildren):
1920         * rendering/RenderObject.cpp:
1921         (WebCore::RenderObject::caretMaxOffset):
1922         * rendering/RenderReplaced.cpp:
1923         (WebCore::RenderReplaced::isSelected):
1924         * rendering/RenderView.cpp:
1925         (WebCore::RenderView::splitSelectionBetweenSubtrees):
1926         Mechanical renaming.
1927
1928 2014-09-13  Chris Dumez  <cdumez@apple.com>
1929
1930         Un-inline Element constructor
1931         https://bugs.webkit.org/show_bug.cgi?id=136786
1932
1933         Reviewed by Benjamin Poulain.
1934
1935         Un-inline Element constructor as it is non-trivial and it does not seem
1936         to impact performance based on my testing:
1937         http://dromaeo.com/?id=226865,226869
1938
1939         This reduces the stripped binary size by 8 Kb.
1940
1941         No new tests, no behavior change.
1942
1943         * dom/Element.cpp:
1944         (WebCore::Element::Element):
1945         * dom/Element.h:
1946         (WebCore::Element::Element): Deleted.
1947
1948 2014-09-12  Jon Honeycutt  <jhoneycutt@apple.com>
1949
1950         Build fix with REQUEST_AUTOCOMPLETE enabled
1951
1952         * html/HTMLFormElement.cpp:
1953         (WebCore::HTMLFormElement::requestAutocomplete):
1954         (WebCore::HTMLFormElement::finishRequestAutocomplete):
1955
1956 2014-09-10  Jon Honeycutt  <jhoneycutt@apple.com>
1957
1958         Re-add the request autocomplete feature
1959
1960         <https://bugs.webkit.org/show_bug.cgi?id=136730>
1961
1962         This feature was rolled out in r148731 because it was only used by
1963         Chromium. As we consider supporting this feature, roll it back in, but
1964         leave it disabled.
1965
1966         This rolls out r148731 (which removed the feature) with small changes
1967         needed to make the code build in ToT, to match modern style, to make
1968         the tests run, and to remove unused code.
1969
1970         Reviewed by Andy Estes.
1971
1972         Tests: fast/events/constructors/autocomplete-error-event-constructor.html
1973                fast/forms/form-request-autocomplete.html
1974
1975         * Configurations/FeatureDefines.xcconfig:
1976         * DerivedSources.make:
1977         * WebCore.xcodeproj/project.pbxproj:
1978         * dom/AutocompleteErrorEvent.h: Added.
1979         (WebCore::AutocompleteErrorEvent::create):
1980         (WebCore::AutocompleteErrorEvent::reason):
1981         (WebCore::AutocompleteErrorEvent::AutocompleteErrorEvent):
1982         * dom/AutocompleteErrorEvent.idl: Added.
1983         * dom/EventNames.h:
1984         * dom/EventNames.in:
1985         * html/HTMLAttributeNames.in:
1986         * html/HTMLFormElement.cpp:
1987         (WebCore::HTMLFormElement::HTMLFormElement):
1988         (WebCore::HTMLFormElement::requestAutocomplete):
1989         (WebCore::HTMLFormElement::finishRequestAutocomplete):
1990         (WebCore::HTMLFormElement::requestAutocompleteTimerFired):
1991         (WebCore::HTMLFormElement::parseAttribute):
1992         * html/HTMLFormElement.h:
1993         * html/HTMLFormElement.idl:
1994         * loader/EmptyClients.h:
1995         * loader/FrameLoaderClient.h:
1996         * page/DOMWindow.idl:
1997
1998 2014-09-12  Vivek Galatage  <vivek.vg@samsung.com>
1999
2000         CanvasRenderingContext2D should update the computed style while setting the font
2001         https://bugs.webkit.org/show_bug.cgi?id=136737
2002
2003         Reviewed by Darin Adler.
2004
2005         Before accessing the computed style for populating 'font' property of CanvasRenderingContext2D
2006         make sure to have an up-to-date computed style avoiding any stale reference.
2007
2008         Test: fast/canvas/canvas-set-font-with-updated-style.html
2009
2010         * html/canvas/CanvasRenderingContext2D.cpp:
2011         (WebCore::CanvasRenderingContext2D::setFont):
2012
2013 2014-09-12  Yusuke Suzuki  <utatane.tea@gmail.com>
2014
2015         CSS JIT: Apply CSS JIT to SelectorQuery with multiple selectors
2016         https://bugs.webkit.org/show_bug.cgi?id=135255
2017
2018         Reviewed by Benjamin Poulain.
2019
2020         After dropping SelectorCheckerFastPath, Dromaeo cssquery-jquery test
2021         result becomes significantly worse. 400.26/s to 348.16/s, 13%
2022         performance regression.
2023
2024         Investigated the cause of it and we found that the test results for
2025         querySelector with multiple selectors causes performance regressions.
2026
2027         To solve this, we attempt to JIT compile all selectors in multiple
2028         selectors. And if compiling some selectors is failed, SelectorQuery
2029         fallbacks to the slower implementation.
2030
2031         This change improves the performance. After applying this patch,
2032         cssquery-jquery test result becomes 418.71/s, 4.61% better than the
2033         previous good performance case.
2034
2035         Test: fast/selectors/querySelector-multiple-selectors.html
2036
2037         * dom/SelectorQuery.cpp:
2038         (WebCore::SelectorDataList::SelectorDataList):
2039         (WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData):
2040         (WebCore::SelectorDataList::execute):
2041         * dom/SelectorQuery.h:
2042
2043 2014-09-12  Jer Noble  <jer.noble@apple.com>
2044
2045         [Fullscreen] Taking embedded youtube video full screen takes the whole page full screen
2046         https://bugs.webkit.org/show_bug.cgi?id=136792
2047
2048         Reviewed by Beth Dakin.
2049
2050         Recalculate style after beginning the enter fullscreen animation, but before sending the
2051         "webkitfullscreenchange" event to listeners.
2052
2053         * dom/Document.cpp:
2054         (WebCore::Document::webkitWillEnterFullScreenForElement):
2055
2056 2014-09-12  Commit Queue  <commit-queue@webkit.org>
2057
2058         Unreviewed, rolling out r173575.
2059         https://bugs.webkit.org/show_bug.cgi?id=136790
2060
2061         Failing tests (Requested by enrica on #webkit).
2062
2063         Reverted changeset:
2064
2065         "Remove PLATFORM(IOS) from WebCore/editing (Part 3)."
2066         https://bugs.webkit.org/show_bug.cgi?id=136474
2067         http://trac.webkit.org/changeset/173575
2068
2069 2014-09-12  Enrica Casucci  <enrica@apple.com>
2070
2071         Remove PLATFORM(IOS) from WebCore/editing (Part 3).
2072         https://bugs.webkit.org/show_bug.cgi?id=136474
2073
2074         Reviewed by Benjamin Poulain.
2075
2076         This is the updated version of the patch that was landed in r173340.
2077         I changed the use of IntPoint to FloatPoint since it was causing tests
2078         to fail.
2079         This patch removes the use of PLATFORM(IOS) from TextAffinity.h
2080         and removes the assumption that EAffinity values match NSSelectionAffinity
2081         values. It also removes the includes in TextAffinity.h, creating the need to
2082         include explicitly the files when necessary. It also removes the unnecessary
2083         use of platform specific types, replacing them with WebCore types.
2084
2085         * WebCore.exp.in:
2086         * editing/TextAffinity.h:
2087         (kit): Deleted.
2088         (core): Deleted.
2089         * editing/cocoa/HTMLConverter.mm:
2090         * page/mac/WebCoreFrameView.h:
2091         * platform/ios/ScrollViewIOS.mm:
2092         (WebCore::ScrollView::platformSetScrollPosition):
2093         * platform/ios/wak/WAKScrollView.mm:
2094         (-[WAKScrollView setScrollOrigin:updatePositionAtAll:immediately:]):
2095         (-[WAKScrollView scrollOrigin]):
2096         * platform/mac/ScrollViewMac.mm:
2097         (WebCore::ScrollView::platformSetScrollPosition):
2098
2099 2014-09-12  Dean Jackson  <dino@apple.com>
2100
2101         Unprefix the flexbox CSS properties
2102         https://bugs.webkit.org/show_bug.cgi?id=98420
2103
2104         Unreviewed fix up, that missed the original
2105         commit. Tony Chang made some comments
2106         on the bugzilla.
2107
2108         "justify-self" should not have been unprefixed.
2109
2110         * css/CSSComputedStyleDeclaration.cpp:
2111         (WebCore::ComputedStyleExtractor::propertyValue):
2112         * css/CSSParser.cpp:
2113         (WebCore::isValidKeywordPropertyAndValue):
2114         (WebCore::CSSParser::parseValue):
2115         * css/CSSPropertyNames.in:
2116         * css/StyleResolver.cpp:
2117         (WebCore::StyleResolver::applyProperty):
2118
2119 2014-09-12  Dean Jackson  <dino@apple.com>
2120
2121         Unprefix the flexbox CSS properties
2122         https://bugs.webkit.org/show_bug.cgi?id=98420
2123
2124         Reviewed by Benjamin Poulain.
2125
2126         Remove the need for a "-webkit-" prefix on flexbox
2127         and related properties. This includes:
2128         - align-content
2129         - align-items
2130         - align-self
2131         - flex-basis
2132         - flex-direction
2133         - flex-wrap
2134         - flex-grow
2135         - flex-shrink
2136         - flex
2137         - flex-flow
2138         - justify-content
2139         - order
2140
2141         ... as well as the display keyword values "flex" and
2142         "inline-flex".
2143
2144         * css/CSSComputedStyleDeclaration.cpp:  Change names.
2145         (WebCore::ComputedStyleExtractor::propertyValue):
2146         * css/CSSParser.cpp: Ditto.
2147         (WebCore::isValidKeywordPropertyAndValue):
2148         (WebCore::isKeywordPropertyID):
2149         (WebCore::CSSParser::parseValue):
2150         (WebCore::CSSParser::parseFlex):
2151         * css/CSSPrimitiveValueMappings.h: Since we need to still handle the old
2152         keywords for display, this has added two new keywords.
2153         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2154         (WebCore::CSSPrimitiveValue::operator EDisplay): If the older keywords were used in
2155         content, map them to the new value names.
2156         * css/CSSPropertyNames.in: Add aliases for the prefixed properties.
2157         * css/CSSValueKeywords.in: Add "flex" and "inline-flex".
2158         * css/DeprecatedStyleBuilder.cpp: Change names.
2159         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
2160         * css/StyleProperties.cpp: Change names.
2161         (WebCore::StyleProperties::getPropertyValue):
2162         (WebCore::StyleProperties::asText):
2163         * css/StylePropertyShorthand.cpp: Rename shorthand methods to remove the prefix.
2164         (WebCore::flexFlowShorthand):
2165         (WebCore::flexShorthand):
2166         (WebCore::shorthandForProperty):
2167         (WebCore::matchingShorthandsForLonghand):
2168         (WebCore::webkitFlexFlowShorthand): Deleted.
2169         (WebCore::webkitFlexShorthand): Deleted.
2170         * css/StylePropertyShorthand.h:
2171         * css/StyleResolver.cpp:
2172         (WebCore::equivalentBlockDisplay):
2173         (WebCore::StyleResolver::applyProperty):
2174         * page/animation/CSSPropertyAnimation.cpp: Change names.
2175         (WebCore::PropertyWrapperFlex::PropertyWrapperFlex):
2176         * rendering/RenderElement.cpp:
2177         (WebCore::RenderElement::createFor): Handle the two new display values (the same way as
2178         the old values).
2179         * rendering/style/RenderStyleConstants.h: Add constants for the new display values.
2180
2181 2014-09-12  Yusuke Suzuki  <utatane.tea@gmail.com>
2182
2183         ASSERTION FAILED: e in WebCore::StyleResolver::adjustRenderStyle
2184         https://bugs.webkit.org/show_bug.cgi?id=136366
2185
2186         Reviewed by Benjamin Poulain.
2187
2188         Since element becomes nullptr when resolving styles for pseudo elements,
2189         so don't do `ASSERT(e)` and use pointer for that.
2190
2191         Test: fast/css/appearance-with-pseudo-elements.html
2192
2193         * css/StyleResolver.cpp:
2194         (WebCore::StyleResolver::adjustRenderStyle):
2195         * html/shadow/SliderThumbElement.cpp:
2196         (WebCore::RenderSliderThumb::updateAppearance):
2197         * platform/efl/RenderThemeEfl.cpp:
2198         (WebCore::RenderThemeEfl::adjustSliderTrackStyle):
2199         (WebCore::RenderThemeEfl::adjustSliderThumbStyle):
2200         (WebCore::RenderThemeEfl::adjustSliderThumbSize):
2201         (WebCore::RenderThemeEfl::adjustCheckboxStyle):
2202         (WebCore::RenderThemeEfl::adjustRadioStyle):
2203         (WebCore::RenderThemeEfl::adjustButtonStyle):
2204         (WebCore::RenderThemeEfl::adjustMenuListStyle):
2205         (WebCore::RenderThemeEfl::adjustMenuListButtonStyle):
2206         (WebCore::RenderThemeEfl::adjustTextFieldStyle):
2207         (WebCore::RenderThemeEfl::adjustTextAreaStyle):
2208         (WebCore::RenderThemeEfl::adjustSearchFieldResultsButtonStyle):
2209         (WebCore::RenderThemeEfl::adjustSearchFieldResultsDecorationPartStyle):
2210         (WebCore::RenderThemeEfl::adjustSearchFieldCancelButtonStyle):
2211         (WebCore::RenderThemeEfl::adjustSearchFieldStyle):
2212         (WebCore::RenderThemeEfl::adjustInnerSpinButtonStyle):
2213         (WebCore::RenderThemeEfl::adjustProgressBarStyle):
2214         * platform/efl/RenderThemeEfl.h:
2215         * platform/gtk/RenderThemeGtk.h:
2216         * rendering/RenderTheme.cpp:
2217         (WebCore::RenderTheme::adjustStyle):
2218         (WebCore::RenderTheme::adjustCheckboxStyle):
2219         (WebCore::RenderTheme::adjustRadioStyle):
2220         (WebCore::RenderTheme::adjustButtonStyle):
2221         (WebCore::RenderTheme::adjustInnerSpinButtonStyle):
2222         (WebCore::RenderTheme::adjustTextFieldStyle):
2223         (WebCore::RenderTheme::adjustTextAreaStyle):
2224         (WebCore::RenderTheme::adjustMenuListStyle):
2225         (WebCore::RenderTheme::adjustMeterStyle):
2226         (WebCore::RenderTheme::adjustProgressBarStyle):
2227         (WebCore::RenderTheme::adjustMenuListButtonStyle):
2228         (WebCore::RenderTheme::adjustMediaControlStyle):
2229         (WebCore::RenderTheme::adjustSliderTrackStyle):
2230         (WebCore::RenderTheme::adjustSliderThumbStyle):
2231         (WebCore::RenderTheme::adjustSliderThumbSize):
2232         (WebCore::RenderTheme::adjustSearchFieldStyle):
2233         (WebCore::RenderTheme::adjustSearchFieldCancelButtonStyle):
2234         (WebCore::RenderTheme::adjustSearchFieldDecorationPartStyle):
2235         (WebCore::RenderTheme::adjustSearchFieldResultsDecorationPartStyle):
2236         (WebCore::RenderTheme::adjustSearchFieldResultsButtonStyle):
2237         * rendering/RenderTheme.h:
2238         * rendering/RenderThemeGtk.cpp:
2239         (WebCore::RenderThemeGtk::adjustButtonStyle):
2240         (WebCore::RenderThemeGtk::adjustMenuListStyle):
2241         (WebCore::RenderThemeGtk::adjustMenuListButtonStyle):
2242         (WebCore::RenderThemeGtk::adjustSearchFieldResultsButtonStyle):
2243         (WebCore::RenderThemeGtk::adjustSearchFieldResultsDecorationPartStyle):
2244         (WebCore::RenderThemeGtk::adjustSearchFieldCancelButtonStyle):
2245         (WebCore::RenderThemeGtk::adjustSearchFieldStyle):
2246         (WebCore::RenderThemeGtk::adjustSliderTrackStyle):
2247         (WebCore::RenderThemeGtk::adjustSliderThumbStyle):
2248         (WebCore::RenderThemeGtk::adjustSliderThumbSize):
2249         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
2250         (WebCore::RenderThemeGtk::adjustProgressBarStyle):
2251         * rendering/RenderThemeIOS.h:
2252         * rendering/RenderThemeIOS.mm:
2253         (WebCore::RenderThemeIOS::adjustCheckboxStyle):
2254         (WebCore::RenderThemeIOS::adjustRadioStyle):
2255         (WebCore::RenderThemeIOS::adjustMenuListButtonStyle):
2256         (WebCore::RenderThemeIOS::adjustSliderTrackStyle):
2257         (WebCore::RenderThemeIOS::adjustSliderThumbSize):
2258         (WebCore::RenderThemeIOS::adjustSearchFieldStyle):
2259         (WebCore::RenderThemeIOS::adjustButtonStyle):
2260         * rendering/RenderThemeMac.h:
2261         * rendering/RenderThemeMac.mm:
2262         (WebCore::RenderThemeMac::adjustTextFieldStyle):
2263         (WebCore::RenderThemeMac::adjustTextAreaStyle):
2264         (WebCore::RenderThemeMac::adjustProgressBarStyle):
2265         (WebCore::RenderThemeMac::adjustMenuListStyle):
2266         (WebCore::RenderThemeMac::adjustMenuListButtonStyle):
2267         (WebCore::RenderThemeMac::adjustSliderTrackStyle):
2268         (WebCore::RenderThemeMac::adjustSliderThumbStyle):
2269         (WebCore::RenderThemeMac::adjustSearchFieldStyle):
2270         (WebCore::RenderThemeMac::adjustSearchFieldCancelButtonStyle):
2271         (WebCore::RenderThemeMac::adjustSearchFieldDecorationPartStyle):
2272         (WebCore::RenderThemeMac::adjustSearchFieldResultsDecorationPartStyle):
2273         (WebCore::RenderThemeMac::adjustSearchFieldResultsButtonStyle):
2274         (WebCore::RenderThemeMac::adjustSliderThumbSize):
2275         * rendering/RenderThemeSafari.cpp:
2276         (WebCore::RenderThemeSafari::adjustButtonStyle):
2277         (WebCore::RenderThemeSafari::adjustTextFieldStyle):
2278         (WebCore::RenderThemeSafari::adjustTextAreaStyle):
2279         (WebCore::RenderThemeSafari::adjustMenuListStyle):
2280         (WebCore::RenderThemeSafari::adjustMenuListButtonStyle):
2281         (WebCore::RenderThemeSafari::adjustSliderThumbStyle):
2282         (WebCore::RenderThemeSafari::adjustSliderThumbSize):
2283         (WebCore::RenderThemeSafari::adjustSearchFieldStyle):
2284         (WebCore::RenderThemeSafari::adjustSearchFieldCancelButtonStyle):
2285         (WebCore::RenderThemeSafari::adjustSearchFieldDecorationPartStyle):
2286         (WebCore::RenderThemeSafari::adjustSearchFieldResultsDecorationPartStyle):
2287         (WebCore::RenderThemeSafari::adjustSearchFieldResultsButtonStyle):
2288         (WebCore::RenderThemeSafari::adjustMeterStyle):
2289         * rendering/RenderThemeSafari.h:
2290         * rendering/RenderThemeWin.cpp:
2291         (WebCore::RenderThemeWin::adjustInnerSpinButtonStyle):
2292         (WebCore::RenderThemeWin::adjustMenuListStyle):
2293         (WebCore::RenderThemeWin::adjustMenuListButtonStyle):
2294         (WebCore::RenderThemeWin::adjustSliderThumbSize):
2295         (WebCore::RenderThemeWin::adjustSearchFieldStyle):
2296         (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle):
2297         (WebCore::RenderThemeWin::adjustSearchFieldDecorationPartStyle):
2298         (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle):
2299         (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle):
2300         (WebCore::RenderThemeWin::adjustMeterStyle):
2301         * rendering/RenderThemeWin.h:
2302
2303 2014-09-12  Joseph Pecoraro  <pecoraro@apple.com>
2304
2305         Fix casing in method name - formatNumberForCustomCSSText
2306         https://bugs.webkit.org/show_bug.cgi?id=136758
2307
2308         Reviewed by Benjamin Poulain.
2309
2310         * css/CSSPrimitiveValue.cpp:
2311         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
2312         (WebCore::CSSPrimitiveValue::customCSSText):
2313         (WebCore::CSSPrimitiveValue::formatNumberForcustomCSSText): Deleted.
2314         * css/CSSPrimitiveValue.h:
2315
2316 2014-09-12  Chris Dumez  <cdumez@apple.com>
2317
2318         Make all CSSSelector data members private
2319         https://bugs.webkit.org/show_bug.cgi?id=136784
2320
2321         Reviewed by Benjamin Poulain.
2322
2323         Make all CSSSelector data members private. Previously, some of the data
2324         members such as m_relation / m_match / m_pseudoType were public and
2325         accessed directly from outside the class. The new approach is better
2326         because:
2327         - Those members are bit fields so by using getters, we can hide the
2328           casts inside the getters. The setters can now also check that the
2329           bitfield is big enough to actually store the enum value.
2330         - When using those in switch() statements, the compiler now complains
2331           if we fail to test some of the enum values as the value is now an
2332           enum, and not merely an unsigned integer.
2333         - Some of these members already has getters (e.g. relation()).
2334         - Better encapsulation.
2335
2336         No new tests, no behavior change.
2337
2338         * css/CSSParserValues.cpp:
2339         (WebCore::CSSParserSelector::parsePagePseudoSelector):
2340         (WebCore::CSSParserSelector::parsePseudoElementSelector):
2341         (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
2342         (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector):
2343         (WebCore::CSSParserSelector::setPseudoClassValue):
2344         (WebCore::CSSParserSelector::isSimple):
2345         (WebCore::CSSParserSelector::prependTagSelector):
2346         * css/CSSParserValues.h:
2347         (WebCore::CSSParserSelector::setMatch):
2348         (WebCore::CSSParserSelector::setRelation):
2349         (WebCore::CSSParserSelector::isPseudoElementCueFunction):
2350         * css/CSSSelector.cpp:
2351         (WebCore::CSSSelector::createRareData):
2352         (WebCore::CSSSelector::specificityForOneSelector):
2353         (WebCore::CSSSelector::specificityForPage):
2354         (WebCore::CSSSelector::operator==):
2355         (WebCore::CSSSelector::selectorText):
2356         * css/CSSSelector.h:
2357         (WebCore::CSSSelector::setPseudoElementType):
2358         (WebCore::CSSSelector::setPagePseudoType):
2359         (WebCore::CSSSelector::pseudoClassType):
2360         (WebCore::CSSSelector::setPseudoClassType):
2361         (WebCore::CSSSelector::pseudoElementType):
2362         (WebCore::CSSSelector::pagePseudoClassType):
2363         (WebCore::CSSSelector::setRelation):
2364         (WebCore::CSSSelector::match):
2365         (WebCore::CSSSelector::setMatch):
2366         (WebCore::CSSSelector::matchesPseudoElement):
2367         (WebCore::CSSSelector::isUnknownPseudoElement):
2368         (WebCore::CSSSelector::isCustomPseudoElement):
2369         (WebCore::CSSSelector::isSiblingSelector):
2370         (WebCore::CSSSelector::isAttributeSelector):
2371         (WebCore::CSSSelector::setValue):
2372         (WebCore::CSSSelector::CSSSelector):
2373         (WebCore::CSSSelector::~CSSSelector):
2374         (WebCore::CSSSelector::tagQName):
2375         (WebCore::CSSSelector::value):
2376         * css/CSSSelectorList.cpp:
2377         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
2378         * css/PageRuleCollector.cpp:
2379         (WebCore::checkPageSelectorComponents):
2380         * css/RuleFeature.cpp:
2381         (WebCore::RuleFeatureSet::collectFeaturesFromSelector):
2382         * css/RuleSet.cpp:
2383         (WebCore::isSelectorMatchingHTMLBasedOnRuleHash):
2384         (WebCore::determinePropertyWhitelistType):
2385         (WebCore::RuleSet::addRule):
2386         * css/SelectorChecker.cpp:
2387         (WebCore::SelectorChecker::matchRecursively):
2388         (WebCore::anyAttributeMatches):
2389         (WebCore::canMatchHoverOrActiveInQuirksMode):
2390         (WebCore::SelectorChecker::checkOne):
2391         (WebCore::SelectorChecker::checkScrollbarPseudoClass):
2392         (WebCore::SelectorChecker::determineLinkMatchType):
2393         * css/SelectorChecker.h:
2394         (WebCore::SelectorChecker::isCommonPseudoClassSelector):
2395         * css/SelectorFilter.cpp:
2396         (WebCore::collectDescendantSelectorIdentifierHashes):
2397         * cssjit/SelectorCompiler.cpp:
2398         (WebCore::SelectorCompiler::constructFragments):
2399         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
2400         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueMatching):
2401         * dom/SelectorQuery.cpp:
2402         (WebCore::isSingleTagNameSelector):
2403         (WebCore::isSingleClassNameSelector):
2404         (WebCore::findIdMatchingType):
2405         (WebCore::SelectorDataList::SelectorDataList):
2406         (WebCore::selectorForIdLookup):
2407         (WebCore::filterRootById):
2408
2409 2014-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2410
2411         REGRESSION(r173441): [GTK] All buttons appear insensitive
2412         https://bugs.webkit.org/show_bug.cgi?id=136614
2413
2414         Reviewed by Sergio Villar Senin.
2415
2416         Do not use RenderTheme::isReadOnlyControl() to decide whether to
2417         render non text based forms sensitive or unsensitive, isEnabled()
2418         is enough in those cases.
2419
2420         * rendering/RenderThemeGtk.cpp:
2421         (WebCore::paintToggle):
2422         (WebCore::renderButton):
2423         (WebCore::RenderThemeGtk::paintSliderTrack):
2424         (WebCore::RenderThemeGtk::paintSliderThumb):
2425
2426 2014-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2427
2428         REGRESSION(r173423): CertificateInfo is never sent to the UI process when using shared secondary process model
2429         https://bugs.webkit.org/show_bug.cgi?id=136669
2430
2431         Reviewed by Antti Koivisto.
2432
2433         Add CertificateInfoPolicy option to ResourceLoaderOptions. It's
2434         set to DoNotIncludeCertificateInfo for all loads except the main
2435         resource load.
2436
2437         * loader/DocumentLoader.cpp:
2438         (WebCore::DocumentLoader::startLoadingMainResource): Pass
2439         IncludeCertificateInfo to ResourceLoaderOptions.
2440         * loader/NetscapePlugInStreamLoader.cpp:
2441         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
2442         Pass DoNotIncludeCertificateInfo to ResourceLoaderOptions().
2443         * loader/ResourceLoader.h:
2444         (WebCore::ResourceLoader::shouldIncludeCertificateInfo): Return
2445         true if IncludeCertificateInfo option was given.
2446         * loader/ResourceLoaderOptions.h:
2447         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
2448         (WebCore::ResourceLoaderOptions::certificateInfoPolicy):
2449         (WebCore::ResourceLoaderOptions::setCertificateInfoPolicy):
2450         * loader/SubresourceLoader.cpp:
2451         (WebCore::SubresourceLoader::didReceiveResponse): If
2452         IncludeCertificateInfo option is present, call
2453         includeCertificateInfo() on the response.
2454         * loader/cache/CachedResourceLoader.cpp:
2455         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Pass
2456         DoNotIncludeCertificateInfo to ResourceLoaderOptions().
2457         (WebCore::CachedResourceLoader::defaultCachedResourceOptions): Ditto.
2458         * loader/icon/IconLoader.cpp:
2459         (WebCore::IconLoader::startLoading): Ditto.
2460         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2461         (WebCore::WebCoreAVCFResourceLoader::startLoading): Ditto.
2462         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2463         (WebCore::WebCoreAVFResourceLoader::startLoading): Ditto.
2464         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2465         (CachedResourceStreamingClient::CachedResourceStreamingClient): Ditto.
2466
2467 2014-09-11  Ryuan Choi  <ryuan.choi@gmail.com>
2468
2469         Unreviewed build fix attempt on windows port since r173553.
2470
2471         * WebCore.vcxproj/WebCore.vcxproj:
2472         * WebCore.vcxproj/WebCore.vcxproj.filters:
2473
2474 2014-09-11  Brian J. Burg  <burg@cs.washington.edu>
2475
2476         Web Inspector: disambiguate integral and real number primitive types in the protocol
2477         https://bugs.webkit.org/show_bug.cgi?id=136606
2478
2479         Reviewed by Timothy Hatcher.
2480
2481         Update clients of InspectorValue to disambiguate integer and double primitive types.
2482
2483         No new tests, no behavior changed.
2484
2485         * inspector/InspectorDOMAgent.cpp:
2486         (WebCore::parseColor):
2487         (WebCore::parseQuad):
2488         (WebCore::InspectorDOMAgent::performSearch):
2489         * inspector/InspectorDOMDebuggerAgent.cpp:
2490         (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
2491         * inspector/InspectorIndexedDBAgent.cpp:
2492         * inspector/InspectorOverlay.cpp:
2493         (WebCore::buildObjectForPoint):
2494         (WebCore::buildObjectForRect):
2495         (WebCore::buildObjectForSize):
2496         (WebCore::appendPathCommandAndPoints):
2497         (WebCore::InspectorOverlay::reset):
2498         * inspector/InspectorReplayAgent.cpp:
2499         (WebCore::InspectorReplayAgent::replayToPosition):
2500         * inspector/InspectorStyleSheet.h:
2501         (WebCore::InspectorCSSId::InspectorCSSId):
2502         * inspector/InspectorTimelineAgent.cpp:
2503         (WebCore::InspectorTimelineAgent::didWriteHTML):
2504         (WebCore::InspectorTimelineAgent::didCompleteRecordEntry):
2505         * inspector/TimelineRecordFactory.cpp:
2506         (WebCore::TimelineRecordFactory::createGenericRecord):
2507         (WebCore::TimelineRecordFactory::createBackgroundRecord):
2508         (WebCore::TimelineRecordFactory::createGCEventData):
2509         (WebCore::TimelineRecordFactory::createFunctionCallData):
2510         (WebCore::TimelineRecordFactory::createProbeSampleData):
2511         (WebCore::TimelineRecordFactory::createGenericTimerData):
2512         (WebCore::TimelineRecordFactory::createTimerInstallData):
2513         (WebCore::TimelineRecordFactory::createXHRReadyStateChangeData):
2514         (WebCore::TimelineRecordFactory::createEvaluateScriptData):
2515         (WebCore::TimelineRecordFactory::createResourceReceiveResponseData):
2516         (WebCore::TimelineRecordFactory::createResourceFinishData):
2517         (WebCore::TimelineRecordFactory::createReceiveResourceData):
2518         (WebCore::TimelineRecordFactory::createLayoutData):
2519         (WebCore::TimelineRecordFactory::createParseHTMLData):
2520         (WebCore::TimelineRecordFactory::createAnimationFrameData):
2521         (WebCore::createQuad):
2522         * inspector/TimelineRecordFactory.h:
2523         (WebCore::TimelineRecordFactory::createWebSocketCreateData):
2524         (WebCore::TimelineRecordFactory::createGenericWebSocketData):
2525         * page/ContentSecurityPolicy.cpp:
2526         (WebCore::ContentSecurityPolicy::reportViolation):
2527
2528 2014-09-11  Ryuan Choi  <ryuan.choi@gmail.com>
2529
2530         [EFL][CoordinatedGraphics] Move CoordinatedGraphicsScene and CoordinatedBackingStore to WebKit2
2531         https://bugs.webkit.org/show_bug.cgi?id=136770
2532
2533         Reviewed by Gyuyoung Kim.
2534
2535         CoordinatedGraphicsScene and CoordinatedBackingStore is only for UIProcess.
2536         This patch moved them from WebCore to WebKit2/UIProcess/CoordinatedGraphics/.
2537
2538         No new tests, no behavior change.
2539
2540         * PlatformEfl.cmake:
2541
2542 2014-09-11  Shivakumar JM  <shiva.jm@samsung.com>
2543
2544         The overrideMimeType in XMLHttpRequest should throw the exception.
2545         https://bugs.webkit.org/show_bug.cgi?id=136699
2546
2547         Reviewed by Darin Adler.
2548
2549         No new tests, modifed test http/tests/xmlhttprequest/exceptions.html.
2550
2551         Set XMLHttpRequest::overrideMimeType to throw an "InvalidStateError" exception, if the state is LOADING or DONE.
2552
2553         * xml/XMLHttpRequest.cpp:
2554         (WebCore::XMLHttpRequest::overrideMimeType):
2555         * xml/XMLHttpRequest.h:
2556         * xml/XMLHttpRequest.idl:
2557
2558 2014-09-11  Joseph Pecoraro  <pecoraro@apple.com>
2559
2560         Web Inspector: Occasional ASSERT closing web inspector
2561         https://bugs.webkit.org/show_bug.cgi?id=136762
2562
2563         Reviewed by Timothy Hatcher.
2564
2565         * bindings/js/WorkerScriptDebugServer.h:
2566         * inspector/PageScriptDebugServer.h:
2567
2568 2014-09-11  Chris Dumez  <cdumez@apple.com>
2569
2570         Simplify DOM tree traversal in FrameSelection::setSelectionFromNone()
2571         https://bugs.webkit.org/show_bug.cgi?id=136763
2572
2573         Reviewed by Ryosuke Niwa.
2574
2575         We only need to traverse the direct children of the Document element to
2576         find the body. The previous code was potentially traversing descendants.
2577         The new code is consistent with Document::body() except that we only
2578         look for an HTMLBodyElement (and ignore HTMLFrameSetElement).
2579
2580         Also update the code to use tighter typing for clarity.
2581
2582         No new tests, no behavior change.
2583
2584         * editing/FrameSelection.cpp:
2585         (WebCore::FrameSelection::setSelectionFromNone):
2586
2587 2014-09-11  Chris Fleizach  <cfleizach@apple.com>
2588
2589         AX: Size of web view in Safari as reported by AX changes when adding/removing bars is wrong
2590         https://bugs.webkit.org/show_bug.cgi?id=136756
2591
2592         Reviewed by Beth Dakin.
2593
2594         topContentInset not only seems to push the scroll view's origin down, but it also shrinks its height as well, which
2595         was not accounted for in the original fix.
2596
2597         Modified: platform/mac-wk2/accessibility/content-inset-scrollview-frame.html
2598
2599         * accessibility/AccessibilityScrollView.cpp:
2600         (WebCore::AccessibilityScrollView::elementRect):
2601
2602 2014-09-11  Roger Fong  <roger_fong@apple.com>
2603
2604         [Windows] Unreviewed build fix.
2605
2606         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2607         (WebCore::GraphicsContext3D::checkVaryingsPacking):
2608
2609 2014-09-11  Beth Dakin  <bdakin@apple.com>
2610
2611         WebKit scrollbars flash in non-dominant spaces when entering Mission Control
2612         https://bugs.webkit.org/show_bug.cgi?id=136761
2613         -and corresponding-
2614         rdar://problem/18195616
2615
2616         Reviewed by Tim Horton.
2617
2618         This patch makes our logic about when to call ScrollableArea::contentAreaDidHide/
2619         Show match the logic in AppKit. We only want these notifications when the window 
2620         has become both visible and active (or lost both, in the case of hide).
2621
2622         Re-name setIsVisibleInternal() to setIsVisibleAndActiveInternal(), and call it 
2623         only when both visibility and active-state have changed.
2624         * page/FocusController.cpp:
2625         (WebCore::FocusController::setViewState):
2626         (WebCore::FocusController::setIsVisibleAndActiveInternal):
2627         (WebCore::FocusController::setIsVisibleInternal): Deleted.
2628         * page/FocusController.h:
2629
2630         FocusController::setViewState() is the only place that needs to call 
2631         ScrollableArea::contentAreaDidHide/Show, so remove these callers.
2632         * page/FrameView.cpp:
2633         (WebCore::FrameView::didMoveOnscreen): Deleted.
2634         (WebCore::FrameView::willMoveOffscreen): Deleted.
2635         * page/FrameView.h:
2636         * page/Page.cpp:
2637         (WebCore::Page::setIsVisibleInternal):
2638
2639 2014-09-10  Michael Saboff  <msaboff@apple.com>
2640
2641         Move JSScope out of JSFunction into separate JSCallee class
2642         https://bugs.webkit.org/show_bug.cgi?id=136725
2643
2644         Reviewed by Oliver Hunt.
2645
2646         Created new JSCallee class that contains a JSScope*.  Changed JSFunction to inherit from
2647         JSCallee.
2648
2649         * ForwardingHeaders/runtime/JSCallee.h: New forwarding header.
2650
2651 2014-09-11  Roger Fong  <roger_fong@apple.com>
2652
2653         Unreviewed build fix iOS.
2654
2655         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2656         (WebCore::GraphicsContext3D::checkVaryingsPacking):
2657
2658 2014-09-11  Jer Noble  <jer.noble@apple.com>
2659
2660         Add site-specific quirk for entering fullscreen on YouTube.com.
2661         https://bugs.webkit.org/show_bug.cgi?id=136742
2662
2663         Reviewed by Eric Carlson.
2664
2665         YouTube only resizes its <video> content when entering fullscreen after receiving the "webkitfullscreenchange"
2666         event, which is fired once the animation to enter fullscreen completes. This leaves the apparent <video> content
2667         too small during the animation, especially at the beginning of the animation. Add a site-specific hack for
2668         YouTube sites which fires the "webkitfullscreenchange" event synchronously with the beginning of the enter
2669         fullscreen animation. This will cause YouTube to resize their <video> content during the period of time where we
2670         disable screen updates, and makes the enter fullscreen animation seamless.
2671
2672         Add a static utility method, hostIsYouTube(), for the various pieces of this site-specific hack, and expand it
2673         to match youtube.co.uk, youtube.fr, etc.
2674
2675         * dom/Document.cpp:
2676         (WebCore::hostIsYouTube): Added.
2677         (WebCore::Document::webkitWillEnterFullScreenForElement): Fire fullscreenchange event if hacks are enabled.
2678         (WebCore::Document::webkitDidEnterFullScreenForElement): Don't fire the event if same.
2679         (WebCore::Document::webkitDidExitFullScreenForElement): Use hostIsYouTube().
2680         
2681 2014-09-11  Bear Travis  <betravis@adobe.com>
2682
2683         [CSS Font Loading] Enable CSS Font Loading on Mac
2684         https://bugs.webkit.org/show_bug.cgi?id=135473
2685
2686         Reviewed by Antti Koivisto.
2687
2688         Enable CSS Font Loading in FeatureDefines, and in
2689         RuntimeEnabledFeatures.
2690
2691         Font Loading tests have been toggled back on in the Mac
2692         TestExpectations file.
2693
2694         * Configurations/FeatureDefines.xcconfig:
2695         * bindings/generic/RuntimeEnabledFeatures.cpp:
2696         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
2697
2698 2014-09-11  Chris Dumez  <cdumez@apple.com>
2699
2700         Use tighter typing for Document::ownerElement() return value
2701         https://bugs.webkit.org/show_bug.cgi?id=136746
2702
2703         Reviewed by Ryosuke Niwa.
2704
2705         Use tighter typing for Document::ownerElement() return value at call
2706         sites to increase code readability a bit and allow the compiler to
2707         generate slightly more efficient code in some cases. In particular,
2708         the more efficient HTMLElement::hasTagName(HTMLQualifiedName) is
2709         now called in several cases instead of the one on Node. This bypasses
2710         unnecessary isHTMLElement() checks.
2711
2712         No new tests, no behavior change.
2713
2714         * accessibility/AccessibilityNodeObject.cpp:
2715         (WebCore::AccessibilityNodeObject::alternativeTextForWebArea):
2716         * dom/Document.cpp:
2717         (WebCore::Document::updateLayout):
2718         (WebCore::Document::topDocument):
2719         * html/HTMLBodyElement.cpp:
2720         (WebCore::HTMLBodyElement::insertedInto):
2721         * rendering/RenderBoxModelObject.cpp:
2722         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2723         * rendering/RenderLayer.cpp:
2724         (WebCore::RenderLayer::scrollRectToVisible):
2725         * rendering/RenderView.cpp:
2726         (WebCore::RenderView::paintBoxDecorations):
2727
2728 2014-09-10  Roger Fong  <roger_fong@apple.com>
2729
2730         Check for varying packing restrictions per program instead of per shader.
2731         https://bugs.webkit.org/show_bug.cgi?id=136585.
2732         <rdar://problem/16308409>.
2733
2734         Reviewed by Dean Jackson.
2735
2736         Covered by webgl/1.0.2/conformance/ogles/GL/build/build_009_to_016.html.
2737
2738         * html/canvas/WebGLRenderingContext.cpp:
2739         (WebCore::WebGLRenderingContext::linkProgram): 
2740         Check for varying packing restrictions when linking the program.
2741
2742         * platform/graphics/GraphicsContext3D.h:
2743         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2744         (WebCore::GraphicsContext3D::checkVaryingsPacking): 
2745         Checks varyings shared by both vertex and fragment shaders and makes sure
2746         they satisfy packing restrictions.
2747
2748 2014-09-11  Beth Dakin  <bdakin@apple.com>
2749
2750         Support rubber-banding in sub-frames
2751         https://bugs.webkit.org/show_bug.cgi?id=136726
2752         -and corresponding-
2753         rdar://problem/10011924
2754
2755         Reviewed by Tim Horton.
2756
2757         Set the appropriate scroll elasticity for all frames! As long as its enabled, sub-
2758         frames want an elasticity of ScrollElasticityAutomatic, which will allow for 
2759         latching. 
2760         * page/FrameView.cpp:
2761         (WebCore::FrameView::FrameView):
2762
2763         Account for rubber-banding in sub-frames.
2764         (WebCore::FrameView::isScrollableOrRubberbandable):
2765         (WebCore::FrameView::hasScrollableOrRubberbandableAncestor):
2766
2767         This patch also re-names rubberBandingForOverflowScrollEnabled to 
2768         rubberBandingForSubScrollableRegionsEnabled
2769         * page/Settings.in:
2770         * rendering/RenderLayer.cpp:
2771         (WebCore::RenderLayer::overhangAmount):
2772         (WebCore::RenderLayer::setHasHorizontalScrollbar):
2773         (WebCore::RenderLayer::setHasVerticalScrollbar):
2774
2775 2014-09-11  Myles C. Maxfield <mmaxfield@apple.com>  <litherum@gmail.com>
2776
2777         Initial implementation of SVG to OTF font converter
2778         https://bugs.webkit.org/show_bug.cgi?id=136688
2779
2780         Reviewed by Darin Adler.
2781
2782         This patch creates a new file and new function which turns an SVG font into an OpenType font.
2783         This function is not very full featured, and as such is never called. However, it works with
2784         fonts that only support simple horizontal basic multilingual plane codepoints. It has only
2785         been tested on OS X, and does not have any automated tests. This patch is only jumping off
2786         point, laying the basic groundwork for a more robust font converter.
2787
2788         The goal of this patch is to eventually allow us to delete the codepath with which we draw
2789         text using SVG fonts. Using a native codepath instead will allow for better performance,
2790         security, and code clarity. In my initial benchmarks, using this converter instead of the
2791         SVG codepath is at least a 100x speed improvement (after running for 4 hours I stepped
2792         away from my machine).
2793
2794         No new tests because the function is not ready to be called (yet!)
2795         Initial implementation of SVG to OTF font converter
2796         https://bugs.webkit.org/show_bug.cgi?id=136688
2797
2798         * WebCore.xcodeproj/project.pbxproj: Add new file.
2799         * svg/SVGPathBuilder.h: Single function. Takes a SVGFontElement and returns a byte
2800         * svg/SVGToOTFFontConversion.cpp: Added.
2801         (WebCore::write32): Write a big-endian Int32.
2802         (WebCore::write16): Write a big-endian Int16.
2803         (WebCore::overwrite32): Overwrite an existing Int32 in a vector (instead of appending)
2804         (WebCore::SVGToOTFFontConverter::GlyphData::GlyphData): Internal class to hold state during
2805         function calls.
2806         (WebCore::roundDownToPowerOfTwo):
2807         (WebCore::SVGToOTFFontConverter::appendCMAPTable): See function name.
2808         (WebCore::SVGToOTFFontConverter::appendHEADTable): Ditto.
2809         (WebCore::clampTo): Used to clamp data types to fit into other data types.
2810         (WebCore::SVGToOTFFontConverter::appendHHEATable): See function name.
2811         (WebCore::SVGToOTFFontConverter::appendHMTXTable): Ditto.
2812         (WebCore::SVGToOTFFontConverter::appendMAXPTable): Ditto.
2813         (WebCore::SVGToOTFFontConverter::appendNAMETable): Ditto.
2814         (WebCore::SVGToOTFFontConverter::appendOS2Table): Ditto.
2815         (WebCore::SVGToOTFFontConverter::appendPOSTTable): Ditto.
2816         (WebCore::isValidStringForCFF): The CFF font format only allows strings with particular
2817         characters in them.
2818         (WebCore::appendCFFValidString): Append a string assuming it's valid to append.
2819         (WebCore::SVGToOTFFontConverter::appendCFFTable): See function name.
2820         (WebCore::SVGToOTFFontConverter::appendVORGTable): Ditto.
2821         (WebCore::writeCFFEncodedNumber): CFF has this wacky encoding scheme for encoding and
2822         decoding numbers.
2823         (WebCore::CFFBuilder::CFFBuilder): Subclass of SVGPathBuilder, which is used for building
2824         CFF CharStrings (which are glyph path representations).
2825         (WebCore::CFFBuilder::updateForConstituentPoint): Invoked for every point in a path, does
2826         things like updates glyph bounding box information.
2827         (WebCore::CFFBuilder::boundingBox): Getter.
2828         (WebCore::transcodeGlyphPaths): SVG path data string -> CFF CharString
2829         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Generate internal state ahead of
2830         time before generating any tables.
2831         (WebCore::isFourByteAligned):
2832         (WebCore::calculateChecksum): OTF files have checksums.
2833         (WebCore::SVGToOTFFontConverter::appendTable): Invoked for each entry in the table of
2834         contents of the OTF font.
2835         (WebCore::SVGToOTFFontConverter::convertSVGToOTFFont): Write out the tables.
2836         (WebCore::convertSVGToOTFFont): Entry point.
2837         * svg/SVGToOTFFontConversion.h: Added.
2838
2839 2014-09-11  Jer Noble  <jer.noble@apple.com>
2840
2841         [EME] REGRESSION(??): test media/encrypted-media/encrypted-media-v2-syntax.html is failing
2842         https://bugs.webkit.org/show_bug.cgi?id=136723
2843
2844         Reviewed by Eric Carlson.
2845
2846         Update a comment to point to the implemented Working Draft 18 Feburary 2014 version of the spec.
2847
2848         * Modules/encryptedmedia/MediaKeys.cpp:
2849         (WebCore::MediaKeys::createSession):
2850
2851 2014-09-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2852
2853         [WK2] Authentication dialog is displayed for cross-origin XHR
2854         https://bugs.webkit.org/show_bug.cgi?id=131349
2855
2856         Reviewed by Alexey Proskuryakov.
2857
2858         * WebCore.exp.in: Export of isAllowedToAskUserForCredentials.
2859         * loader/ResourceLoader.cpp:
2860         (WebCore::ResourceLoader::isAllowedToAskUserForCredentials): Replacing clientCredentialPolicy method. Returns true if credentials can be requested to the user.
2861         (WebCore::ResourceLoader::didReceiveAuthenticationChallenge): Updated to use isAllowedToAskUserForCredentials.
2862         * loader/ResourceLoader.h: Removing clientCredentialPolicy method and adding isAllowedToAskUserForCredentials method.
2863
2864 2014-09-11  Chris Fleizach  <cfleizach@apple.com>
2865
2866         AX: Children inside a <legend> are not accessible
2867         https://bugs.webkit.org/show_bug.cgi?id=136735
2868
2869         Reviewed by Mario Sanchez Prada.
2870
2871         The AX children of a <legend> are being hidden currently, which makes it impossible for
2872         VoiceOver to activate control elements inside of a <legend>.
2873         The solution is that legend elements SHOULD be allowed to have children.
2874
2875         Test: accessibility/legend-children-are-visible.html
2876
2877         * accessibility/AccessibilityNodeObject.cpp:
2878         (WebCore::AccessibilityNodeObject::canHaveChildren):
2879
2880 2014-09-11  Brendan Long  <b.long@cablelabs.com>
2881
2882         Fix FIXME's in JSTrackCustom now that AudioTrack and VideoTrack exist.
2883         https://bugs.webkit.org/show_bug.cgi?id=136552
2884
2885         Reviewed by Eric Carlson.
2886
2887         * bindings/js/JSTrackCustom.cpp:
2888         (WebCore::toTrack): Add casts for AudioTrack and VideoTrack.
2889
2890 2014-09-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2891
2892         [GTK] Merge WebKitAuthenticationWidget into WebKitAuthenticationDialog
2893         https://bugs.webkit.org/show_bug.cgi?id=136700
2894
2895         Reviewed by Sergio Villar Senin.
2896
2897         Remove WebKitAuthenticationWidget. The only reason why we had this
2898         widget separated in WebCore was to share it between WebKit1 and
2899         WebKit2, but now it's only used by WebKitAuthenticationDialog in WebKit2.
2900
2901         * PlatformGTK.cmake: Remove files from compilation.
2902         * platform/gtk/WebKitAuthenticationWidget.cpp: Removed.
2903         * platform/gtk/WebKitAuthenticationWidget.h: Removed.
2904
2905 2014-09-10  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2906
2907         Use ASSERT instead of ASSERT_WITH_SECURITY_IMPLICATION
2908         https://bugs.webkit.org/show_bug.cgi?id=136732
2909
2910         Reviewed by Andy Estes.
2911
2912         Since r173458 changed to use static_cast<> with toFoo, ASSERT_WITH_SECURITY_IMPLICATION doesn't
2913         need to be used anymore. ASSERT is enough for it.
2914
2915         * workers/DefaultSharedWorkerRepository.cpp:
2916         (WebCore::SharedWorkerProxy::addToWorkerDocuments):
2917         * workers/WorkerMessagingProxy.cpp:
2918         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
2919         * xml/XMLHttpRequest.cpp:
2920         (WebCore::XMLHttpRequest::document):
2921
2922 2014-09-10  Adenilson Cavalcanti  <cavalcantii@gmail.com>
2923
2924         [SVG] Cleanup iterator code in SMILTimeContainer using range-based loop
2925         https://bugs.webkit.org/show_bug.cgi?id=136720
2926
2927         Reviewed by Filip Pizlo.
2928
2929         No new tests, no change on behavior.
2930
2931         * svg/animation/SMILTimeContainer.cpp:
2932         (WebCore::SMILTimeContainer::setElapsed):
2933         (WebCore::SMILTimeContainer::updateAnimations):
2934
2935 2014-09-10  Timothy Horton  <timothy_horton@apple.com>
2936
2937         Fix the build.
2938
2939         * platform/network/ResourceHandle.h:
2940         * platform/network/mac/ResourceHandleMac.mm:
2941
2942 2014-09-09  Myles C. Maxfield <mmaxfield@apple.com>  <litherum@gmail.com>
2943
2944         Delete class SavedDrawingStateForMask
2945         https://bugs.webkit.org/show_bug.cgi?id=136498
2946
2947         Reviewed by Darin Adler.
2948
2949         This class is left over from when text-decoration-skip: ink used
2950         GraphicsContext masking.
2951
2952         No new tests because there is no behavior change.
2953
2954         * rendering/InlineTextBox.cpp:
2955         (WebCore::InlineTextBox::applyShadowToGraphicsContext):
2956         * rendering/InlineTextBox.h:
2957         * rendering/TextPainter.cpp:
2958         (WebCore::TextPainter::TextPainter):
2959         (WebCore::paintTextWithShadows):
2960         (WebCore::TextPainter::paintText):
2961         * rendering/TextPainter.h:
2962         (WebCore::SavedDrawingStateForMask::SavedDrawingStateForMask): Deleted.
2963         * rendering/svg/SVGInlineTextBox.cpp:
2964         (WebCore::SVGInlineTextBox::paintTextWithShadows):
2965
2966 2014-09-10  Tim Horton  <timothy_horton@apple.com>
2967
2968         Call setCollectsTimingData only once, and before making any {CF,NS}URLConnections
2969         https://bugs.webkit.org/show_bug.cgi?id=136731
2970         <rdar://problem/18252844>
2971
2972         Reviewed by Simon Fraser.
2973
2974         * platform/network/cf/ResourceHandleCFNet.cpp:
2975         (WebCore::ResourceHandle::start):
2976         Move setCollectsTimingData to before createCFURLConnection, so the first connection
2977         has timing data associated with it.
2978
2979         * platform/network/mac/ResourceHandleMac.mm:
2980         (WebCore::ResourceHandle::createNSURLConnection):
2981         Move setCollectsTimingData to before we create our NSURLConnection, so the first connection
2982         has timing data associated with it.
2983         Use setCollectsTimingData instead of the NSURLConnection SPI directly.
2984
2985         (WebCore::ResourceHandle::setCollectsTimingData):
2986         Only call _setCollectsTimingData once.
2987
2988 2014-09-10  Enrica Casucci  <enrica@apple.com>
2989
2990         Remove iOS-only -webkit-composition-fill-color CSS property.
2991         https://bugs.webkit.org/show_bug.cgi?id=136728
2992         rdar://problem/10439154
2993
2994         Reviewed by Tim Horton.
2995
2996         This property is no longer used on iOS.
2997
2998         * css/CSSComputedStyleDeclaration.cpp:
2999         (WebCore::ComputedStyleExtractor::propertyValue):
3000         * css/CSSParser.cpp:
3001         (WebCore::CSSParser::parseValue):
3002         * css/CSSPropertyNames.in:
3003         * css/StyleResolver.cpp:
3004         (WebCore::StyleResolver::applyProperty):
3005         * editing/EditingStyle.cpp:
3006         * platform/graphics/Color.h:
3007         * rendering/InlineTextBox.cpp:
3008         (WebCore::InlineTextBox::paintCompositionBackground):
3009         * rendering/style/RenderStyle.h:
3010         * rendering/style/StyleRareInheritedData.cpp:
3011         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3012         (WebCore::StyleRareInheritedData::operator==):
3013         * rendering/style/StyleRareInheritedData.h:
3014
3015 2014-09-10  Tim Horton  <timothy_horton@apple.com>
3016
3017         Remove ImageSource::ShouldSkipMetadata
3018         https://bugs.webkit.org/show_bug.cgi?id=136713
3019
3020         Reviewed by Pratik Solanki.
3021
3022         * platform/graphics/ImageSource.h:
3023         * platform/graphics/cg/ImageSourceCG.cpp:
3024         (WebCore::createImageSourceOptions):
3025         (WebCore::imageSourceOptions):
3026         (WebCore::ImageSource::frameSizeAtIndex):
3027         (WebCore::ImageSource::createFrameAtIndex):
3028         (WebCore::ImageSource::frameDurationAtIndex):
3029         Remove ShouldSkipMetadata and users. Nobody ever uses DoNotSkipMetadata.
3030
3031 2014-09-10  Beth Dakin  <bdakin@apple.com>
3032
3033         https://bugs.webkit.org/show_bug.cgi?id=136650
3034         Rubber-banding in the DOM view of the WebInspector is really jumpy
3035         -and corresponding-
3036         rdar://problem/18166043
3037
3038         Reviewed by Darin Adler.
3039
3040         This patch implements the ScrollableArea virtual function isRubberBandInProgress() 
3041         for RenderLayer, and then uses that to determine whether to clamp the scroll 
3042         position in updateScrollInfoAfterLayout().
3043         * rendering/RenderLayer.cpp:
3044         (WebCore::RenderLayer::isRubberBandInProgress):
3045         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
3046         * rendering/RenderLayer.h:
3047
3048 2014-09-10  Tim Horton  <timothy_horton@apple.com>
3049
3050         Remove a workaround in frameIsCompleteAtIndex for a problem that was fixed in Lion
3051         https://bugs.webkit.org/show_bug.cgi?id=136652
3052
3053         Reviewed by Dan Bernstein.
3054
3055         * platform/graphics/cg/ImageSourceCG.cpp:
3056         (WebCore::ImageSource::frameIsCompleteAtIndex):
3057         ImageIO returns the right thing now.
3058
3059 2014-09-10  Myles C. Maxfield  <mmaxfield@apple.com>
3060
3061         Laying out a TextRun using an SVG font is O(n^2)
3062         https://bugs.webkit.org/show_bug.cgi?id=136584
3063
3064         Reviewed by Darin Adler.
3065
3066         Addressing post-commit review from Darin.
3067
3068         No new tests.
3069
3070         * platform/graphics/Font.h:
3071         (WebCore::Font::treatAsSpace): Un-inline.
3072         (WebCore::Font::treatAsZeroWidthSpace): Ditto.
3073         (WebCore::Font::treatAsZeroWidthSpaceInComplexScript): Ditto.
3074         * svg/SVGFontData.cpp:
3075         (WebCore::computeNormalizedSpaces): Avoid unnecessary copy.
3076
3077 2014-09-10  peavo@outlook.com  <peavo@outlook.com>
3078
3079         [Curl] Optimization; avoid reallocating string many times.
3080         https://bugs.webkit.org/show_bug.cgi?id=136704
3081
3082         Reviewed by Alex Christensen.
3083
3084         Adding individual characters to a string is inefficient, the string will be reallocated each time.
3085
3086         * platform/network/curl/CookieJarCurl.cpp:
3087         (WebCore::readCurlCookieToken):
3088
3089 2014-09-10  peavo@outlook.com  <peavo@outlook.com>
3090
3091         [Curl] Compile error, CertificateInfo.h is not found.
3092         https://bugs.webkit.org/show_bug.cgi?id=136703
3093
3094         Reviewed by Alex Christensen.
3095
3096         Curl also needs to implement the CertificateInfo class.
3097
3098         * platform/network/curl/CertificateInfo.h: Added.
3099         (WebCore::CertificateInfo::CertificateInfo):
3100
3101 2014-09-10  Simon Fraser  <simon.fraser@apple.com>
3102
3103         Clean up some ENABLE(PICTURE_SIZES) stuff, don't change function signatures inside #ifdefs
3104         https://bugs.webkit.org/show_bug.cgi?id=136654
3105
3106         Reviewed by Darin Adler.
3107
3108         Adding parameters inside an #ifdef makes for unreadable code, so remove some
3109         #if ENABLE(PICTURE_SIZES) related to the preload scanner and always pass the arguments.
3110         Reduced the argument count on some functions by just passing a Document&. 
3111         
3112         Also fix a couple of uses of #if ENABLE_PICTURE_SIZES.
3113
3114         * html/HTMLImageElement.h:
3115         * html/parser/HTMLDocumentParser.cpp:
3116         (WebCore::HTMLDocumentParser::pumpTokenizer):
3117         (WebCore::HTMLDocumentParser::insert):
3118         (WebCore::HTMLDocumentParser::append):
3119         (WebCore::HTMLDocumentParser::appendCurrentInputStreamToPreloadScannerAndScan):
3120         * html/parser/HTMLPreloadScanner.cpp:
3121         (WebCore::TokenPreloadScanner::scan):
3122         (WebCore::HTMLPreloadScanner::scan):
3123         * html/parser/HTMLPreloadScanner.h:
3124         * html/parser/HTMLSrcsetParser.cpp:
3125         (WebCore::pickBestImageCandidate):
3126         (WebCore::bestFitSourceForImageAttributes):
3127         * html/parser/HTMLSrcsetParser.h:
3128
3129 2014-09-10  Chris Fleizach  <cfleizach@apple.com>
3130
3131         AX: aria-labelledby is not honoring sub-node text
3132         https://bugs.webkit.org/show_bug.cgi?id=136689
3133
3134         Reviewed by Mario Sanchez Prada.
3135
3136         Test: accessibility/aria-labelledby-with-descendants.html
3137
3138         When aria-labelledby retrieves the textUnderElements it needs to consider
3139         all sub-children, including focusable content.
3140
3141         * accessibility/AccessibilityNodeObject.cpp:
3142         (WebCore::accessibleNameForNode):
3143
3144 2014-09-10  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3145
3146         Use toDocument instead of static_cast<Document*>
3147         https://bugs.webkit.org/show_bug.cgi?id=136694
3148
3149         Reviewed by Andy Estes.
3150
3151         Clean up static_cast<Document*>.
3152
3153         * Modules/mediasource/SourceBuffer.cpp:
3154         (WebCore::SourceBuffer::document):
3155         * Modules/webaudio/AudioContext.cpp:
3156         (WebCore::AudioContext::document):
3157         * bindings/gobject/WebKitDOMPrivate.cpp:
3158         (WebKit::wrap):
3159         * dom/ScriptExecutionContext.cpp:
3160         (WebCore::ScriptExecutionContext::dispatchErrorEvent): Add a line to remove .get().
3161         * workers/DefaultSharedWorkerRepository.cpp:
3162         (WebCore::SharedWorkerProxy::addToWorkerDocuments):
3163         * workers/WorkerMessagingProxy.cpp:
3164         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
3165         * xml/XMLHttpRequest.cpp:
3166         (WebCore::XMLHttpRequest::document):
3167         (WebCore::XMLHttpRequest::open):
3168
3169 2014-09-10  Yusuke Suzuki  <utatane.tea@gmail.com>
3170
3171         Merge CheckingContexts from SelectorCompiler and SelectorChecker
3172         https://bugs.webkit.org/show_bug.cgi?id=135255
3173
3174         Reviewed by Benjamin Poulain.
3175
3176         In this patch, we merge SelectorChecker::SelectorCheckingContext and SelectorCompiler::CheckingContext.
3177         We expose only SelectorChecker::CheckingContext. That is the same to the old SelectorCompiler::CheckingContext.
3178
3179         In SelectorChecker.cpp, we define SelectorChecker::CheckingContextWithStatus and use it internally.
3180         And we move VisitedMatchType from SelectorChecker.h to SelectorChecker.cpp.
3181
3182         VisitedMatchType is also explicitly used by SelectorCheckerFastPath. However, SelectorCheckerFastPath is now
3183         used only from SelectorQuery (Style resolution algorithm no longer uses it: r171059).
3184         In this patch, we remove SelectorCheckerFastPath since the major cases are covered by CSS JIT.
3185         In `RightMostWithIdMatch`, `Element#matches` and multiple selectors `querySelector('a, b')` cases,
3186         CSS JIT is not used. So dropping fast path affects them. But 1) these cases are rare or 2) the target node
3187         is typically only one since nodes are filtered before matching. So it doesn't have performance regression.
3188
3189         And now since CheckingContextWithStatus is the derived class of CheckingContext, we can use
3190         the same test functions; template parameter is not necessary. It reduces code size.
3191
3192         * CMakeLists.txt:
3193         * WebCore.xcodeproj/project.pbxproj:
3194         * css/CSSAllInOne.cpp:
3195         * css/ElementRuleCollector.cpp:
3196         (WebCore::ElementRuleCollector::ruleMatches):
3197         * css/SelectorChecker.cpp:
3198         (WebCore::SelectorChecker::CheckingContextWithStatus::CheckingContextWithStatus):
3199         (WebCore::SelectorChecker::match):
3200         (WebCore::checkingContextForParent):
3201         (WebCore::SelectorChecker::matchRecursively):
3202         (WebCore::canMatchHoverOrActiveInQuirksMode):
3203         (WebCore::SelectorChecker::checkOne):
3204         (WebCore::SelectorChecker::checkScrollbarPseudoClass):
3205         * css/SelectorChecker.h:
3206         (WebCore::SelectorChecker::CheckingContext::CheckingContext):
3207         (WebCore::SelectorChecker::SelectorCheckingContext::SelectorCheckingContext): Deleted.
3208         * css/SelectorCheckerFastPath.cpp: Removed.
3209         * css/SelectorCheckerFastPath.h: Removed.
3210         * css/SelectorCheckerTestFunctions.h:
3211         (WebCore::scrollbarMatchesEnabledPseudoClass):
3212         (WebCore::scrollbarMatchesDisabledPseudoClass):
3213         (WebCore::scrollbarMatchesHoverPseudoClass):
3214         (WebCore::scrollbarMatchesActivePseudoClass):
3215         (WebCore::scrollbarMatchesHorizontalPseudoClass):
3216         (WebCore::scrollbarMatchesVerticalPseudoClass):
3217         (WebCore::scrollbarMatchesDecrementPseudoClass):
3218         (WebCore::scrollbarMatchesIncrementPseudoClass):
3219         (WebCore::scrollbarMatchesStartPseudoClass):
3220         (WebCore::scrollbarMatchesEndPseudoClass):
3221         (WebCore::scrollbarMatchesDoubleButtonPseudoClass):
3222         (WebCore::scrollbarMatchesSingleButtonPseudoClass):
3223         (WebCore::scrollbarMatchesNoButtonPseudoClass):
3224         (WebCore::scrollbarMatchesCornerPresentPseudoClass):
3225         * css/StyleResolver.h:
3226         (WebCore::checkRegionSelector):
3227         * cssjit/SelectorCompiler.cpp:
3228         (WebCore::SelectorCompiler::SelectorFragment::appendUnoptimizedPseudoClassWithContext):
3229         (WebCore::SelectorCompiler::addScrollbarPseudoClassType):
3230         (WebCore::SelectorCompiler::SelectorCodeGenerator::addFlagsToElementStyleFromContext):
3231         (WebCore::SelectorCompiler::SelectorCodeGenerator::branchOnResolvingModeWithCheckingContext):
3232         (WebCore::SelectorCompiler::elementIsActiveForStyleResolution):
3233         (WebCore::SelectorCompiler::setElementStyleFromContextIsAffectedByEmptyAndUpdateRenderStyleIfNecessary):
3234         (WebCore::SelectorCompiler::elementIsHoveredForStyleResolution):
3235         (WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
3236         (WebCore::SelectorCompiler::makeElementStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
3237         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRequestedPseudoElementEqualsToSelectorPseudoElement):
3238         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsScopeRoot):
3239         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateMarkPseudoStyleForPseudoElement):
3240         * cssjit/SelectorCompiler.h:
3241         (WebCore::SelectorCompiler::CheckingContext::CheckingContext): Deleted.
3242         * dom/SelectorQuery.cpp:
3243         (WebCore::SelectorDataList::SelectorDataList):
3244         (WebCore::SelectorDataList::selectorMatches):
3245         (WebCore::SelectorDataList::executeCompiledSelectorCheckerWithCheckingContext):
3246         (WebCore::isCompiledSelector):
3247         (WebCore::SelectorDataList::compileSelector):
3248         (WebCore::SelectorDataList::execute):
3249         * dom/SelectorQuery.h:
3250         (WebCore::SelectorDataList::SelectorData::SelectorData):
3251
3252 2014-09-09  Jer Noble  <jer.noble@apple.com>
3253
3254         [MSE] http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate.html failing after r173318
3255         https://bugs.webkit.org/show_bug.cgi?id=136676
3256
3257         Reviewed by Eric Carlson.
3258
3259         Revert the inadvertant conditional change introduced in r173318.
3260
3261         * Modules/mediasource/MediaSource.cpp:
3262         (WebCore::MediaSource::setDurationInternal):
3263
3264 2014-09-09  Roger Fong  <roger_fong@apple.com>
3265
3266         Unreviewed build fix for Windows.
3267
3268         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
3269         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3270         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3271
3272 2014-09-09  Dan Bernstein  <mitz@apple.com>
3273
3274         FrameLoader::prepareForHistoryNavigation is unused
3275         https://bugs.webkit.org/show_bug.cgi?id=136683
3276
3277         Reviewed by Tim Horton.
3278
3279         * loader/FrameLoader.cpp:
3280         (WebCore::FrameLoader::prepareForHistoryNavigation): Deleted.
3281         * loader/FrameLoader.h: Removed the declaration.
3282
3283 2014-09-09  Manuel Rego Casasnovas  <rego@igalia.com>
3284
3285         [CSS Grid Layout] Ignore ::first-letter pseudo-element
3286         https://bugs.webkit.org/show_bug.cgi?id=136625
3287
3288         Reviewed by Darin Adler.
3289
3290         According to the spec the ::first-letter pseudo-element do not apply to
3291         grid containers (neither to flexboxes).
3292
3293         Fixed issue in RenderBlock::getFirstLetter() that applies to both grids
3294         and flexboxes. Basically if the grid's or flexbox's container was
3295         defining the ::first-line pseudo-element and the grid or flexbox itself
3296         too, the value from the grid or flexbox was being applied to the items.
3297         Added the proper check to avoid this.
3298
3299         Added two new tests for grid and modified one flexbox test to cover the
3300         issue explained above.
3301
3302         Tests: css3/flexbox/flexbox-ignore-container-firstLetter.html
3303                fast/css-grid-layout/grid-container-ignore-first-letter.html
3304                fast/css-grid-layout/grid-item-first-letter-valid.html
3305
3306         * rendering/RenderBlock.cpp:
3307         (WebCore::isRenderBlockFlowOrRenderButton): New method refactoring
3308         similar calls through the source code.
3309         (WebCore::RenderBlock::firstLineBlock): Use
3310         isRenderBlockFlowOrRenderButton().
3311         (WebCore::findFirstLetterBlock): Modify it to use
3312         isRenderBlockFlowOrRenderButton() in order to include grids and not only
3313         check flexboxes.
3314         (WebCore::RenderBlock::getFirstLetter): Use
3315         isRenderBlockFlowOrRenderButton().
3316         (WebCore::RenderBlock::updateFirstLetter): Early return if
3317         firstLetterContainer is null (in the case of flexboxes or grids).
3318
3319 2014-09-09  Benjamin Poulain  <benjamin@webkit.org>
3320
3321         Add support for :read-write/:read-only matching editable content
3322         https://bugs.webkit.org/show_bug.cgi?id=136668
3323
3324         Reviewed by Antti Koivisto.
3325
3326         This is the second part of the update of :read-write/:read-only to the latest spec
3327         (http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting.html#selectors).
3328
3329         The selectors :read-write/:read-only should match elements that are editable. The exact definition is:
3330         "elements that are editing hosts or editable and are neither input elements nor textarea elements".
3331
3332         Matching that definition is really easy. It was done by updating HTMLElement's matchesReadWritePseudoClass()
3333         to consider both contentEditable and designMode.
3334
3335         The tricky part is making that efficient in all cases. Matching contentEditable is horribly inefficient
3336         compared to the other primitives. We don't want to execute that for every element.
3337
3338         Since matchesReadWritePseudoClass() was used by the theming code, that code was adjusted to
3339         -Avoid calling that on regular HTMLElement, limiting the query to <input> and <textarea> where it is fast.
3340         -Avoid the call entirely when possible.
3341
3342         Tests: fast/css/read-only-read-write-contenteditable-basics.html
3343                fast/css/read-only-read-write-designmode-basics.html
3344                fast/css/read-only-read-write-webkit-user-modify.html
3345                fast/selectors/read-only-read-write-contenteditable-basics.html
3346                fast/selectors/read-only-read-write-contenteditable-svg-foreignObject.html
3347                fast/selectors/read-only-read-write-designmode-basics.html
3348                fast/selectors/read-only-read-write-style-update.html
3349
3350         * html/HTMLElement.cpp:
3351         (WebCore::contentEditableType):
3352         This code is a generalization of the code that was in HTMLElement::contentEditable().
3353         It is used by both matchesReadWritePseudoClass() and contentEditable() to determine
3354         a valid state from the value of contentEditable.
3355
3356         (WebCore::HTMLElement::matchesReadWritePseudoClass):
3357         Per the definition of editable content, we first check if the current element is an editing host,
3358         if not we look for an editing host. If there are none, test for designMode.
3359
3360         (WebCore::HTMLElement::contentEditable):
3361
3362         (WebCore::RenderTheme::isReadOnlyControl):
3363         The old definition would only match <input> and <textarea>. The code was updated to keep the same
3364         behavior after matchesReadWritePseudoClass() is udpated. This avoids the performance problem of calling
3365         matchesReadWritePseudoClass() on regular HTMLElement.
3366
3367         * platform/ControlStates.h:
3368         ReadOnlyState was only used by ThemeMac for convertControlStatesToThemeDrawState().
3369         In turn, convertControlStatesToThemeDrawState() was only used for painting
3370         "-webkit-inner-spin-button". Buttons are not read-write to begin with.
3371         The whole code looks like legacy from styling of input elements and was removed.
3372
3373         Removing ReadOnlyState removes the expensive part of extractControlStatesForRenderer().
3374
3375         * html/HTMLElement.h:
3376         * html/HTMLFormControlElement.cpp:
3377         (WebCore::HTMLFormControlElement::readOnlyAttributeChanged):
3378         * platform/mac/ThemeMac.mm:
3379         (WebCore::convertControlStatesToThemeDrawState):
3380         * rendering/RenderTheme.cpp:
3381         (WebCore::RenderTheme::extractControlStatesForRenderer):
3382
3383 2014-09-09  Jer Noble  <jer.noble@apple.com>
3384
3385         [MSE] media/media-source tests broken after r173318
3386         https://bugs.webkit.org/show_bug.cgi?id=136675
3387
3388         Reviewed by Eric Carlson.
3389
3390         Fixes the following tests:
3391             http/tests/media/media-source/mediasource-play.html
3392             http/tests/media/media-source/mediasource-remove.html
3393             media/media-source/media-source-monitor-source-buffers.html
3394             media/media-source/media-source-overlapping-append-buffered.html   
3395
3396         In r173318, a for loop was converted to a C++11 loop, but in so doing, left
3397         pre-initialized, empty values in the beginning of returned Vector, which caused
3398         the calling algorithm to miscalculate the amount of data buffered by the media
3399         source.
3400
3401         * Modules/mediasource/MediaSource.cpp:
3402         (WebCore::MediaSource::activeRanges):
3403
3404 2014-09-09  Takeshi Kurosawa  <taken.spc@gmail.com>
3405
3406         AX: HTML5 landmark (and related) elements should not be ignored.
3407         https://bugs.webkit.org/show_bug.cgi?id=135116
3408
3409         Reviewed by Chris Fleizach.
3410
3411         Make sure following element should not be ignored in computeAccessibilityIsIgnored
3412         - header, aside, address, main, nav, article, section
3413         - dt, dd
3414
3415         Tests: platform/mac/accessibility/descriptionlist-not-ignored.html
3416                platform/mac/accessibility/landma