377a874ef9b5c5d97a7ee499f7afb936583c4027
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-05-30  Rafael Brandao  <rafael.lobo@openbossa.org>
2
3         Fix double hash lookup in RenderTableSection::paintObject loop
4         https://bugs.webkit.org/show_bug.cgi?id=117055
5
6         Reviewed by Antonio Gomes.
7
8         * rendering/RenderTableSection.cpp:
9         (WebCore::RenderTableSection::paintObject):
10
11 2013-05-30  Rafael Brandao  <rafael.lobo@openbossa.org>
12
13         Fix double hash lookup in WebSocket::connect loop
14         https://bugs.webkit.org/show_bug.cgi?id=117052
15
16         Reviewed by Anders Carlsson.
17
18         * Modules/websockets/WebSocket.cpp:
19         (WebCore::WebSocket::connect):
20
21 2013-05-30  Benjamin Poulain  <bpoulain@apple.com>
22
23         Remove some 16bits conversion.
24         https://bugs.webkit.org/show_bug.cgi?id=116935
25
26         Reviewed by Darin Adler.
27
28         Merge chromium ce35a544d09e6cb907457535340eb0e9984e57b8.
29         https://chromium.googlesource.com/chromium/blink/+/ce35a544d09e6cb907457535340eb0e9984e57b8
30
31         * html/parser/InputStreamPreprocessor.h:
32         * platform/FileSystem.cpp:
33         (WebCore::encodeForFileName):
34
35 2013-05-30  Anders Carlsson  <andersca@apple.com>
36
37         REGRESSION (r119759): Adobe Flash Player "smaller" installer relies on the incorrect firing of a load event and needs an app-specific hack for compatibility
38         https://bugs.webkit.org/show_bug.cgi?id=117042
39         <rdar://problem/13916291>
40
41         Reviewed by Mark Rowe.
42
43         Ignore HTTP errors for scripts requested from within the installer. Instead of just checking for the
44         Adobe Flash installer, we use the "com.solidstatenetworks.awkhost" bundle identifier to determine
45         whether to apply the workaround. This could in theory fix other installers that use the same mechanism.
46
47         * loader/cache/CachedScript.cpp:
48         (WebCore::CachedScript::shouldIgnoreHTTPStatusCodeErrors):
49         * loader/cache/CachedScript.h:
50         * platform/RuntimeApplicationChecks.cpp:
51         (WebCore::applicationIsSolidStateNetworksDownloader):
52         * platform/RuntimeApplicationChecks.h:
53
54 2013-05-30  Sergio Villar Senin  <svillar@igalia.com>
55
56         Allow no space between "background-position:" dimensions
57         https://bugs.webkit.org/show_bug.cgi?id=116870
58
59         Reviewed by Darin Adler.
60
61         From Blink r149314 by <ericwilligers@chromium.org>
62
63         Specs allow no spaces between the dimensions of a
64         "background-position:" like "1px+1px", we should support
65         that.
66
67         Whitespaces are no longer early consumed, dramatically dropping
68         the shift/reduce conflicts to half. The productions unary_term,
69         calc_func_term, calc_func_expr and calc_func_paren_expr no longer
70         consume whitespaces.
71
72         * css/CSSGrammar.y.in:
73         * css/CSSParser.cpp:
74         (WebCore::CSSParser::realLex):
75
76 2013-05-30  Jer Noble  <jer.noble@apple.com>
77
78         HTMLMediaElement will not unthrottle page when playback stops for nreasons other than user-initiated pause.
79         https://bugs.webkit.org/show_bug.cgi?id=117016
80
81         Reviewed by Oliver Hunt.
82
83         Add a new class PageActivityAssertionToken to allow HTMLMediaElement to decouple
84         knowledge of and control over the lifetime of PageThrottler. The new class will
85         have weak references to and from the PageThrottler so that holders of the token
86         will not need to care if the Page or PageThrottler has been destroyed. 
87
88         HTMLMediaElement will create one of these PageActivityAssertionTokens when playback
89         begins and destroy it when playback stops for any reason, or when the element is
90         destroyed.
91
92         * html/HTMLMediaElement.cpp:
93         (WebCore::HTMLMediaElement::~HTMLMediaElement):
94         (WebCore::HTMLMediaElement::playInternal):
95         (WebCore::HTMLMediaElement::pauseInternal):
96         (WebCore::HTMLMediaElement::playbackProgressTimerFired):
97         (WebCore::HTMLMediaElement::updatePlayState):
98         * html/HTMLMediaElement.h:
99         * page/Page.cpp:
100         (WebCore::createActivityToken): Added simple factory method.
101         * page/Page.h:
102         * page/PageActivityAssertionToken.cpp: 
103         (WebCore::PageActivityAssertionToken::PageActivityAssertionToken): Call addActivityToken();
104         (WebCore::PageActivityAssertionToken::~PageActivityAssertionToken): Call removeActivityToken();
105         (WebCore::PageActivityAssertionToken::invalidate): Clear m_throttler.
106         * page/PageActivityAssertionToken.h:
107         * page/PageThrottler.cpp:
108         (WebCore::PageThrottler::~PageThrottler): Invalidate all outstanding tokens.
109         (WebCore::PageThrottler::addActivityToken): Bump the activity count.
110         (WebCore::PageThrottler::removeActivityToken): Lower the activity count.
111         * page/PageThrottler.h:
112
113         Add the new files to the various build systems:
114         * CMakeLists.txt:
115         * GNUmakefile.list.am:
116         * Target.pri:
117         * WebCore.vcproj/WebCore.vcproj:
118         * WebCore.vcxproj/WebCore.vcxproj:
119         * WebCore.vcxproj/WebCore.vcxproj.filters:
120         * WebCore.xcodeproj/project.pbxproj:
121
122 2013-05-29  Jeffrey Pfau  <jpfau@apple.com>
123
124         [Mac] Enable cache partitioning and the public suffix list on 10.8
125         <rdar://problem/13679019>
126
127         Rubber-stamped by David Kilzer.
128
129         * Configurations/FeatureDefines.xcconfig:
130
131 2013-05-30  Andreas Kling  <akling@apple.com>
132
133         Fix double hash lookup in DocumentEventQueue::cancelEvent().
134         <http://webkit.org/b/117031>
135
136         Reviewed by Anders Carlsson.
137
138         * dom/DocumentEventQueue.cpp:
139         (WebCore::DocumentEventQueue::cancelEvent):
140
141 2013-05-30  Andreas Kling  <akling@apple.com>
142
143         Fix double hash lookup in DocumentLoader::removeSubresourceLoader().
144         <http://webkit.org/b/117030>
145
146         Reviewed by Anders Carlsson.
147
148         * loader/DocumentLoader.cpp:
149         (WebCore::DocumentLoader::removeSubresourceLoader):
150
151 2013-05-30  Andreas Kling  <akling@apple.com>
152
153         Fix double hash lookup in RenderView::repaintSelection() loop.
154         <http://webkit.org/b/117029>
155
156         Reviewed by Anders Carlsson.
157
158         * rendering/RenderView.cpp:
159         (WebCore::RenderView::repaintSelection):
160
161 2013-05-30  Peter Gal  <galpeter@inf.u-szeged.hu>
162
163         CURL: Incorrect stripping of query from file URL
164         https://bugs.webkit.org/show_bug.cgi?id=104307
165
166         Reviewed by Darin Adler.
167
168         Clear the query part of the file URL if there is any.
169
170         * platform/network/curl/ResourceHandleManager.cpp:
171         (WebCore::ResourceHandleManager::initializeHandle):
172
173 2013-05-30  Antti Koivisto  <antti@apple.com>
174
175         Separate generic font family settings to a class
176         https://bugs.webkit.org/show_bug.cgi?id=117027
177
178         Reviewed by Andreas Kling.
179
180         The new class is under platform/ and can be accessed by the font code directly without platform violations.
181
182         * WebCore.xcodeproj/project.pbxproj:
183         * page/Settings.cpp:
184         (WebCore::invalidateAfterGenericFamilyChange):
185         (WebCore::Settings::Settings):
186         (WebCore::Settings::~Settings):
187         (WebCore::Settings::create):
188         (WebCore::Settings::standardFontFamily):
189         (WebCore::Settings::setStandardFontFamily):
190         (WebCore::Settings::fixedFontFamily):
191         (WebCore::Settings::setFixedFontFamily):
192         (WebCore::Settings::serifFontFamily):
193         (WebCore::Settings::setSerifFontFamily):
194         (WebCore::Settings::sansSerifFontFamily):
195         (WebCore::Settings::setSansSerifFontFamily):
196         (WebCore::Settings::cursiveFontFamily):
197         (WebCore::Settings::setCursiveFontFamily):
198         (WebCore::Settings::fantasyFontFamily):
199         (WebCore::Settings::setFantasyFontFamily):
200         (WebCore::Settings::pictographFontFamily):
201         (WebCore::Settings::setPictographFontFamily):
202         * page/Settings.h:
203         * platform/graphics/FontGenericFamilies.cpp: Added.
204         (WebCore::setGenericFontFamilyForScript):
205         (WebCore::genericFontFamilyForScript):
206         (WebCore::FontGenericFamilies::FontGenericFamilies):
207         (WebCore::FontGenericFamilies::standardFontFamily):
208         (WebCore::FontGenericFamilies::fixedFontFamily):
209         (WebCore::FontGenericFamilies::serifFontFamily):
210         (WebCore::FontGenericFamilies::sansSerifFontFamily):
211         (WebCore::FontGenericFamilies::cursiveFontFamily):
212         (WebCore::FontGenericFamilies::fantasyFontFamily):
213         (WebCore::FontGenericFamilies::pictographFontFamily):
214         (WebCore::FontGenericFamilies::setStandardFontFamily):
215         (WebCore::FontGenericFamilies::setFixedFontFamily):
216         (WebCore::FontGenericFamilies::setSerifFontFamily):
217         (WebCore::FontGenericFamilies::setSansSerifFontFamily):
218         (WebCore::FontGenericFamilies::setCursiveFontFamily):
219         (WebCore::FontGenericFamilies::setFantasyFontFamily):
220         (WebCore::FontGenericFamilies::setPictographFontFamily):
221         * platform/graphics/FontGenericFamilies.h: Added.
222         (WebCore::UScriptCodeHashTraits::emptyValue):
223         (WebCore::UScriptCodeHashTraits::constructDeletedValue):
224         (WebCore::UScriptCodeHashTraits::isDeletedValue):
225         (WebCore::FontGenericFamilies::create):
226
227 2013-05-30  Andreas Kling  <akling@apple.com>
228
229         Avoid using CSSOM style declarations in HTML editing.
230         <http://webkit.org/b/117019>
231
232         Reviewed by Antti Koivisto.
233
234         Convert the editing code to use ComputedStyleExtractor instead of instantiating CSSOM wrappers.
235
236         * css/CSSComputedStyleDeclaration.h:
237         * css/CSSComputedStyleDeclaration.cpp:
238         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
239         (WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
240         (WebCore::ComputedStyleExtractor::propertyMatches):
241         (WebCore::ComputedStyleExtractor::copyProperties):
242         (WebCore::ComputedStyleExtractor::copyPropertiesInSet):
243
244             Moved here from CSSComputedStyleDeclaration. These methods are used by HTML editing.
245
246         (WebCore::CSSComputedStyleDeclaration::copyProperties):
247
248             Reimplemented to call ComputedStyleExtractor.
249
250         * css/CSSStyleDeclaration.h:
251         * css/PropertySetCSSStyleDeclaration.h:
252         * css/PropertySetCSSStyleDeclaration.cpp:
253         (WebCore::PropertySetCSSStyleDeclaration::copyProperties):
254
255             Removed CSSStyleDeclaration::cssPropertyMatches(), the remaining code lives in
256             ComputedStyleExtractor::propertyMatches() and is only used by HTML editing.
257
258         * css/StylePropertySet.h:
259         * css/StylePropertySet.cpp:
260         (WebCore::MutableStylePropertySet::removeEquivalentProperties):
261
262             Added an overload that takes a ComputedStyleExtractor.
263             This code should move into EditingStyle.cpp, material for a follow-up patch.
264
265         * editing/ApplyStyleCommand.cpp:
266         (WebCore::toIdentifier):
267
268             Add a file-local helper for yanking the identifier value (if any) out of a CSSPrimitiveValue.
269
270         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
271         (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
272         (WebCore::highestEmbeddingAncestor):
273         * editing/EditingStyle.h:
274         * editing/EditingStyle.cpp:
275         (WebCore::editingStyleFromComputedStyle):
276         (WebCore::extractPropertyValue):
277         (WebCore::identifierForStyleProperty):
278         (WebCore::textColorFromStyle):
279         (WebCore::backgroundColorFromStyle):
280         (WebCore::EditingStyle::init):
281         (WebCore::EditingStyle::removeStyleAddedByNode):
282         (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
283         (WebCore::EditingStyle::triStateOfStyle):
284         (WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode):
285         (WebCore::EditingStyle::removeStyleFromRulesAndContext):
286         (WebCore::StyleChange::StyleChange):
287         (WebCore::fontWeightIsBold):
288         (WebCore::extractPropertiesNotIn):
289         (WebCore::getPropertiesNotIn):
290
291             Use ComputedStyleExtractor instead of CSSComputedStyleDeclaration in all of this code.
292             Templatized a bunch of the code so we don't have to repeat ourselves for both StylePropertySet
293             and ComputedStyleExtractor inputs.
294
295 2013-05-30  Roland Takacs  <rtakacs@inf.u-szeged.hu>
296
297         Remove "hidden"=true from Inspector.json
298         https://bugs.webkit.org/show_bug.cgi?id=114116
299
300         Reviewed by Timothy Hatcher.
301
302         Remove "hidden"=true because it's a Chromium concept.
303         Patch created by Timothy Hatcher.
304
305         * inspector/Inspector.json:
306
307 2013-05-30  Kondapally Kalyan  <kalyan.kondapally@intel.com>
308
309         [EFL][EGL] Implement TransportSurface client.
310         https://bugs.webkit.org/show_bug.cgi?id=114122
311
312         Reviewed by Kenneth Rohde Christiansen.
313
314         Covered by existing WebGL tests.
315
316         This patch implements the client support for Transport
317         Surface with EGL backend using GLES2.
318
319         * platform/graphics/surfaces/efl/GLTransportSurface.cpp:
320         (WebCore::GLTransportSurfaceClient::createTransportSurfaceClient):
321         (WebCore::GLTransportSurfaceClient::GLTransportSurfaceClient):
322         * platform/graphics/surfaces/efl/GLTransportSurface.h:
323         (GLTransportSurfaceClient):
324         * platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp:
325         (WebCore::GraphicsSurfacePrivate::initializeClient):
326         * platform/graphics/surfaces/egl/EGLConfigSelector.cpp:
327         (WebCore):
328         (WebCore::EGLConfigSelector::surfaceClientConfig):
329         (WebCore::EGLConfigSelector::findMatchingConfigWithVisualId):
330         * platform/graphics/surfaces/egl/EGLConfigSelector.h:
331         (WebCore):
332         (EGLConfigSelector):
333
334         Support for retrieving valid EGLConfig on client side.
335
336         * platform/graphics/surfaces/egl/EGLHelper.cpp:
337         (WebCore):
338         (WebCore::resolveDisplay):
339         (WebCore::EGLHelper::resolveEGLBindings):
340         (WebCore::EGLHelper::createEGLImage):
341         (WebCore::EGLHelper::destroyEGLImage):
342         (WebCore::EGLHelper::imageTargetTexture2DOES):
343         * platform/graphics/surfaces/egl/EGLHelper.h:
344
345         Helper functions to create and destroy EGLImage.
346
347         * platform/graphics/surfaces/egl/EGLXSurface.cpp:
348         (WebCore::EGLXTransportSurfaceClient::EGLXTransportSurfaceClient):
349         (WebCore):
350         (WebCore::EGLXTransportSurfaceClient::~EGLXTransportSurfaceClient):
351         (WebCore::EGLXTransportSurfaceClient::destroy):
352         (WebCore::EGLXTransportSurfaceClient::prepareTexture):
353         (WebCore::EGLTextureFromPixmap::EGLTextureFromPixmap):
354         (WebCore::EGLTextureFromPixmap::~EGLTextureFromPixmap):
355         (WebCore::EGLTextureFromPixmap::destroy):
356         (WebCore::EGLTextureFromPixmap::isValid):
357         (WebCore::EGLTextureFromPixmap::bindTexImage):
358         (WebCore::EGLTextureFromPixmap::reBindTexImage):
359         * platform/graphics/surfaces/egl/EGLXSurface.h:
360         (EGLXTransportSurfaceClient):
361
362         TransportSurfaceClient implementation.
363
364         (WebCore):
365         * platform/graphics/surfaces/glx/GLXSurface.cpp:
366         (WebCore::GLXTransportSurfaceClient::GLXTransportSurfaceClient):
367         * platform/graphics/surfaces/glx/GLXSurface.h:
368         (GLXTransportSurfaceClient):
369         * platform/graphics/surfaces/glx/X11Helper.cpp:
370         (WebCore::X11Helper::createOffScreenWindow):
371         (WebCore):
372         (WebCore::X11Helper::createPixmap):
373         * platform/graphics/surfaces/glx/X11Helper.h:
374         (X11Helper):
375
376 2013-05-30  Mike West  <mkwst@chromium.org>
377
378         Rename 'KURL::elidedString' and inspector's 'String.prototype.trimMiddle' for clarity.
379         https://bugs.webkit.org/show_bug.cgi?id=111700
380
381         Reviewed by Darin Adler.
382
383         Darin suggested that 'KURL::elidedString' is inaccurately named[1], this
384         patch is an attempt to do better. It additionally brings the Inspector's
385         'String.prototype.trimMiddle' method into line, as the two methods do
386         more or less the same thing.
387
388         After a bit of discussion with Maciej and Daniel Bates on IRC, I've
389         settled on 'KURL::stringCenterEllipsizedToLength(unsigned)' and
390         'String.prototype.centerEllipsizedToLength(number)' respectively.
391
392         No new tests are added, as this patch shouldn't have any visible effect
393         on the web. It's strictly an internal refactoring.
394
395         * Modules/websockets/WebSocket.cpp:
396         (WebCore::WebSocket::connect):
397         (WebCore::WebSocket::send):
398         * Modules/websockets/WebSocketChannel.cpp:
399         (WebCore::WebSocketChannel::send):
400         (WebCore::WebSocketChannel::fail):
401         * bindings/ScriptControllerBase.cpp:
402         (WebCore::ScriptController::canExecuteScripts):
403         * dom/Document.cpp:
404         (WebCore::Document::processHttpEquiv):
405         * dom/ScriptElement.cpp:
406         (WebCore::ScriptElement::executeScript):
407         * html/HTMLMediaElement.cpp:
408         (WebCore::HTMLMediaElement::canPlayType):
409         (WebCore::HTMLMediaElement::isSafeToLoadURL):
410         * loader/FrameLoader.cpp:
411         (WebCore::FrameLoader::submitForm):
412         (WebCore::FrameLoader::loadFrameRequest):
413         (WebCore::FrameLoader::commitProvisionalLoad):
414         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
415         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
416         (WebCore::createWindow):
417         * loader/MainResourceLoader.cpp:
418         (WebCore::MainResourceLoader::willSendRequest):
419         (WebCore::MainResourceLoader::responseReceived):
420         * loader/MixedContentChecker.cpp:
421         (WebCore::MixedContentChecker::logWarning):
422         * loader/appcache/ApplicationCacheGroup.cpp:
423         (WebCore::ApplicationCacheGroup::didReceiveResponse):
424         (WebCore::ApplicationCacheGroup::didFail):
425         * loader/cache/CachedResourceLoader.cpp:
426         (WebCore::CachedResourceLoader::canRequest):
427         (WebCore::CachedResourceLoader::requestResource):
428         (WebCore::CachedResourceLoader::loadResource):
429         (WebCore::CachedResourceLoader::printAccessDeniedMessage):
430         * page/ContentSecurityPolicy.cpp:
431         (WebCore::CSPDirectiveList::checkSourceAndReportViolation):
432         (WebCore::CSPDirectiveList::allowScriptNonce):
433         (WebCore::CSPDirectiveList::allowPluginType):
434         * platform/KURL.cpp:
435         (WebCore::KURL::stringCenterEllipsizedToLength):
436         * platform/KURL.h:
437             Rename 'KURL::elidedString' to 'KURL::stringCenterEllipsizedToLength',
438             and adjust callsites accordingly.
439         * inspector/front-end/CallStackSidebarPane.js:
440         (WebInspector.CallStackSidebarPane.Placard.prototype._update):
441         * inspector/front-end/ElementsTreeOutline.js:
442         (WebInspector.ElementsTreeElement.prototype._buildAttributeDOM):
443         * inspector/front-end/HeapSnapshotGridNodes.js:
444         (WebInspector.HeapSnapshotGenericObjectNode.prototype.shortenWindowURL):
445         * inspector/front-end/Linkifier.js:
446         (WebInspector.Linkifier.DefaultFormatter.prototype.formatLiveAnchor):
447         * inspector/front-end/ResourceUtils.js:
448         (WebInspector.linkifyURLAsNode):
449         * inspector/front-end/TabbedEditorContainer.js:
450         (WebInspector.TabbedEditorContainer.prototype._titleForFile):
451         * inspector/front-end/utilities.js:
452             Rename 'String.prototype.trimMiddle' to 'String.prototype.centerEllipsizedToLength'
453             and adjust callsites accordingly.
454
455 2013-05-30  Antti Koivisto  <antti@apple.com>
456
457         Rename FontFallbackList.cpp/h to FontGlyphs.cpp/h
458         https://bugs.webkit.org/show_bug.cgi?id=117022
459
460         Reviewed by Andreas Kling.
461
462         Rename to match the class name.
463
464         * CMakeLists.txt:
465         * GNUmakefile.list.am:
466         * Target.pri:
467         * WebCore.vcproj/WebCore.vcproj:
468         * WebCore.vcxproj/WebCore.vcxproj:
469         * WebCore.vcxproj/WebCore.vcxproj.filters:
470         * WebCore.xcodeproj/project.pbxproj:
471         * platform/graphics/Font.h:
472         * platform/graphics/FontCache.cpp:
473         * platform/graphics/FontFallbackList.cpp: Removed.
474         * platform/graphics/FontFallbackList.h: Removed.
475         * platform/graphics/FontFastPath.cpp:
476         * platform/graphics/FontGlyphs.cpp: Copied from Source/WebCore/platform/graphics/FontFallbackList.cpp.
477         * platform/graphics/FontGlyphs.h: Copied from Source/WebCore/platform/graphics/FontFallbackList.h.
478         * platform/graphics/mac/FontComplexTextMac.cpp:
479
480 2013-05-30  Ryosuke Niwa  <rniwa@webkit.org>
481
482         Get rid of Position::computedStyle
483         https://bugs.webkit.org/show_bug.cgi?id=117024
484
485         Reviewed by Andreas Kling.
486
487         Removed the function.
488
489         * dom/Position.cpp:
490         * dom/Position.h:
491         * editing/ApplyStyleCommand.cpp:
492         (WebCore::ApplyStyleCommand::positionToComputeInlineStyleChange): We need a position
493         inside the dummy element since we'll get the containing element's style instead
494         if we had the position before the dummy element.
495         * editing/EditingStyle.cpp:
496         (WebCore::StyleChange::StyleChange):
497
498 2013-05-30  Seokju Kwon  <seokju.kwon@gmail.com>
499
500         Remove obsolete forward declaration from InspectorFrontendHost.h
501         https://bugs.webkit.org/show_bug.cgi?id=117017
502
503         Reviewed by Joseph Pecoraro.
504
505         Remove obsolete forward declaration and fix style issue as well.
506
507         No change in behavior, no new tests.
508
509         * inspector/InspectorFrontendHost.h:
510         (WebCore):
511         (InspectorFrontendHost):
512
513 2013-05-29  Tim Horton  <timothy_horton@apple.com>
514
515         Expose incrementalRenderingSuppressionTimeout via WK2
516         https://bugs.webkit.org/show_bug.cgi?id=117015
517         <rdar://problem/13992853>
518
519         Reviewed by Darin Adler.
520
521         * dom/Document.cpp:
522         (WebCore::Document::setVisualUpdatesAllowed):
523         Inform the FrameLoader that we're ready to transition the page, if
524         nothing else already has. This will be forwarded to the FrameLoaderClient,
525         and WebKit2's implementation will go ahead and un-freeze the layer tree,
526         so that the incremental rendering suppression watchdog timer actually works.
527
528         (WebCore::Document::setVisualUpdatesAllowedByClient):
529         Make incremental rendering suppression extension tokens play nice with the
530         watchdog timer; allow setVisualUpdatesAllowedByClient=true to re-enable updates
531         if either the page is in the "completed" state or the watchdog has already fired.
532
533         * loader/FrameLoader.cpp:
534         * loader/FrameLoader.h:
535         (WebCore::FrameLoader::forcePageTransitionIfNeeded): Added.
536         Forward to the client.
537
538         * loader/FrameLoaderClient.h:
539         (WebCore::FrameLoaderClient::forcePageTransitionIfNeeded): Added.
540
541 2013-05-29  Praveen R Jadhav  <praveen.j@samsung.com>
542
543         ProgressEvent should not be cancelable
544         https://bugs.webkit.org/show_bug.cgi?id=114444
545
546         Reviewed by Darin Adler.
547
548         Parameter "cancelable" in ProgressEvent is set to false, by default, as mentioned in the specification. The spec link is given below.
549
550         Spec: http://www.w3.org/TR/2011/CR-progress-events-20110922/#suggested-names-for-events-using-the-progressevent-interface
551
552         No new tests. file-reader-event-listener.html and infoOnProgressEvent-expected.txt are updated.
553
554         * dom/ProgressEvent.cpp:
555         (WebCore::ProgressEvent::ProgressEvent):
556         (WebCore):
557
558 2013-05-29  Simon Fraser  <simon.fraser@apple.com>
559
560         Fix paint-related milestones to not fire when the layer tree is frozen
561         https://bugs.webkit.org/show_bug.cgi?id=117012
562
563         Reviewed by Tim Horton.
564
565         In the previous code, it was possible to paint some layer and schedule
566         the m_paintRelatedMilestonesTimer, but then the layer tree was put into
567         a frozen state because the page redirected. However, the paint-related
568         milestones timer would still fire. This caused woes with header/footer
569         banners.
570         
571         Fix by not firing paint-related milestones if the layer tree is frozen,
572         which we know via a new ChromeClient callback. When unfrozen, we'll
573         paint again, and fire the timer later.
574
575         * page/ChromeClient.h:
576         (WebCore::ChromeClient::layerTreeStateIsFrozen):
577         * rendering/RenderLayerCompositor.cpp:
578         (WebCore::RenderLayerCompositor::paintRelatedMilestonesTimerFired):
579
580 2013-05-29  Ryosuke Niwa  <rniwa@webkit.org>
581
582         Store form control list with RefPtr
583         https://bugs.webkit.org/show_bug.cgi?id=116910
584
585         Reviewed by Kent Tamura.
586
587         Merge https://chromium.googlesource.com/chromium/blink/+/582132773280455ead1d42b0073be37efdeaf989.
588
589         Unfortunately, the Blink change doesn't provide much insight as to what kind of crashes are fixed
590         by this code change but it cleans up the way form elements with state are registered to the form
591         controller so it seems benefitial to merge it anyway.
592
593         * dom/Document.cpp:
594         (WebCore::Document::dispose):
595         * html/FormController.cpp:
596         (WebCore::FormController::createSavedFormStateMap):
597         (WebCore::FormController::registerFormElementWithState):
598         (WebCore::FormController::unregisterFormElementWithState):
599         (WebCore):
600         * html/FormController.h:
601         (FormController):
602         * html/HTMLFormControlElementWithState.cpp:
603         (WebCore::HTMLFormControlElementWithState::HTMLFormControlElementWithState):
604         (WebCore::HTMLFormControlElementWithState::~HTMLFormControlElementWithState):
605         (WebCore::HTMLFormControlElementWithState::insertedInto):
606         (WebCore):
607         (WebCore::HTMLFormControlElementWithState::removedFrom):
608         * html/HTMLFormControlElementWithState.h:
609         (HTMLFormControlElementWithState):
610         * html/HTMLTextFormControlElement.cpp:
611         (WebCore::HTMLTextFormControlElement::insertedInto):
612
613 2013-05-29  Andreas Kling  <akling@apple.com>
614
615         Take ComputedStyleExtractor for a spin.
616         <http://webkit.org/b/116968>
617
618         Reviewed by Antti Koivisto.
619
620         Convert some editing and SVG code to use ComputedStyleExtractor instead of creating full
621         blown CSSComputedStyleDeclaration objects.
622
623         * editing/ApplyStyleCommand.cpp:
624         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
625         (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
626         (WebCore::highestEmbeddingAncestor):
627         (WebCore::ApplyStyleCommand::computedFontSize):
628         * editing/EditingStyle.cpp:
629         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
630         (WebCore::EditingStyle::textDirectionForSelection):
631         (WebCore::getIdentifierValue):
632         (WebCore::backgroundColorInEffect):
633         * editing/EditingStyle.h:
634         * svg/SVGAnimationElement.cpp:
635         (WebCore::SVGAnimationElement::computeCSSPropertyValue):
636
637 2013-05-29  Benjamin Poulain  <bpoulain@apple.com>
638
639         Add a special case for SelectorDataList::execute when there is only one selector
640         https://bugs.webkit.org/show_bug.cgi?id=116891
641
642         Reviewed by Andreas Kling.
643
644         In the vast majority of cases, querySelector is called with a single selector.
645
646         This patch takes that input into account to improve the performance of
647         SelectorDataList::execute(). For the case of a single selector, we avoid three
648         branches executed for every node of the traversal.
649
650         This improves QuerySelector's time by 2.3%.
651
652         * dom/SelectorQuery.cpp:
653         (WebCore::SelectorDataList::execute):
654
655 2013-05-29  Dean Jackson  <dino@apple.com>
656
657         -webkit-text-underline-position should not be inherited
658         https://bugs.webkit.org/show_bug.cgi?id=116363
659
660         Reverting http://trac.webkit.org/changeset/150366
661         It was an incorrect fix referring to an old specification.
662
663         * css/CSSProperty.cpp:
664         (WebCore::CSSProperty::isInheritedProperty):
665         * rendering/style/RenderStyle.h:
666         * rendering/style/StyleRareInheritedData.cpp:
667         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
668         (WebCore::StyleRareInheritedData::operator==):
669         * rendering/style/StyleRareInheritedData.h:
670         (StyleRareInheritedData):
671         * rendering/style/StyleRareNonInheritedData.cpp:
672         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
673         (WebCore::StyleRareNonInheritedData::operator==):
674         * rendering/style/StyleRareNonInheritedData.h:
675         (StyleRareNonInheritedData):
676
677 2013-05-29  Ryuan Choi  <ryuan.choi@samsung.com>
678
679         [CMAKE] cmake errors when CMAKE_BUILD_TYPE is not specified.
680         https://bugs.webkit.org/show_bug.cgi?id=116899
681
682         Reviewed by Laszlo Gombos.
683
684         * CMakeLists.txt: Fixed if statement to escape when find command fails.
685
686 2013-05-28  Oliver Hunt  <oliver@apple.com>
687
688         Add more accurate activity state tracking
689         https://bugs.webkit.org/show_bug.cgi?id=116893
690
691         Reviewed by Gavin Barraclough.
692
693         Add a hysteresis to Page activity throttling.  We do this
694         through a PageThrottler class that now handles entering and
695         exiting throttling state, and adds a hysteresis to we can
696         limit the amount of on/off bouncing on the throttle.
697
698         Media elements now make use of this to disable timer throttling
699         while they are playing, and plugins use it to momentarily bounce
700         from throttled to unthrottled state.
701
702         * CMakeLists.txt:
703         * GNUmakefile.list.am:
704         * Target.pri:
705         * WebCore.exp.in:
706         * WebCore.vcproj/WebCore.vcproj:
707         * WebCore.vcxproj/WebCore.vcxproj:
708         * WebCore.vcxproj/WebCore.vcxproj.filters:
709         * WebCore.xcodeproj/project.pbxproj:
710         * html/HTMLMediaElement.cpp:
711         (WebCore::HTMLMediaElement::~HTMLMediaElement):
712         (WebCore::HTMLMediaElement::pageThrottlerIfPossible):
713         (WebCore):
714         (WebCore::HTMLMediaElement::playInternal):
715         (WebCore::HTMLMediaElement::pauseInternal):
716         * html/HTMLMediaElement.h:
717         (WebCore):
718         * html/MediaController.cpp:
719         (MediaController::unpause):
720         * page/ChromeClient.h:
721         (WebCore::ChromeClient::incrementActivePageCount):
722         (WebCore::ChromeClient::decrementActivePageCount):
723         (ChromeClient):
724         * page/Page.cpp:
725         (WebCore::Page::Page):
726         (WebCore::Page::~Page):
727         (WebCore::Page::setThrottled):
728         * page/Page.h:
729         (WebCore):
730         (Page):
731         (WebCore::Page::pageThrottler):
732         * page/PageThrottleState.h: Added.
733         * page/PageThrottler.cpp: Added.
734         (WebCore):
735         (WebCore::PageThrottler::PageThrottler):
736         (WebCore::PageThrottler::~PageThrottler):
737         (WebCore::PageThrottler::clearPage):
738         (WebCore::PageThrottler::throttlePage):
739         (WebCore::PageThrottler::unthrottlePage):
740         (WebCore::PageThrottler::setThrottled):
741         (WebCore::PageThrottler::preventThrottling):
742         (WebCore::PageThrottler::allowThrottling):
743         (WebCore::PageThrottler::stopThrottleHysteresisTimer):
744         (WebCore::PageThrottler::reportInterestingEvent):
745         (WebCore::PageThrottler::startThrottleHysteresisTimer):
746         (WebCore::PageThrottler::throttleHysteresisTimerFired):
747         * page/PageThrottler.h: Added.
748         (WebCore):
749         (PageThrottler):
750         (WebCore::PageThrottler::create):
751         (WebCore::PageThrottler::shouldThrottleAnimations):
752         (WebCore::PageThrottler::shouldThrottleTimers):
753
754 2013-05-29  Kent Tamura  <tkent@chromium.org>
755
756         Remove leftover files for ENABLE_PAGE_POPUP and ENABLE_CALENDAR_PICKER
757         https://bugs.webkit.org/show_bug.cgi?id=116999
758
759         Reviewed by Anders Carlsson.
760
761         * Resources/pagepopups/colorSuggestionPicker.css: Removed.
762         * Resources/pagepopups/colorSuggestionPicker.js: Removed.
763         * Resources/pagepopups/pickerCommon.css: Removed.
764         * Resources/pagepopups/pickerCommon.js: Removed.
765         * Resources/pagepopups/suggestionPicker.css: Removed.
766         * Resources/pagepopups/suggestionPicker.js: Removed.
767
768 2013-05-29  Jer Noble  <jer.noble@apple.com>
769
770         Unreviewed build fix; remove unintentional semicolon.
771
772         * Modules/webaudio/AudioScheduledSourceNode.cpp:
773         (WebCore::AudioScheduledSourceNode::finish):
774
775 2013-05-29  Anders Carlsson  <andersca@apple.com>
776
777         Merge PODArea::Chunk into PODFreeListArena::FreeListChunk
778         https://bugs.webkit.org/show_bug.cgi?id=117000
779
780         Reviewed by Oliver Hunt.
781
782         * platform/PODArena.h:
783         (WebCore::PODArena::roundUp):
784         * platform/PODFreeListArena.h:
785         (PODFreeListArena):
786         (WebCore::PODFreeListArena::FreeListChunk::FreeListChunk):
787         (FreeListChunk):
788         (WebCore::PODFreeListArena::FreeListChunk::~FreeListChunk):
789         (WebCore::PODFreeListArena::FreeListChunk::allocate):
790
791 2013-05-29  Anders Carlsson  <andersca@apple.com>
792
793         Move some PODArena members to PODFreeListArena
794         https://bugs.webkit.org/show_bug.cgi?id=116993
795
796         Reviewed by Sam Weinig.
797
798         This is more work towards merging the two classes.
799
800         * platform/PODArena.h:
801         (PODArena):
802         * platform/PODFreeListArena.h:
803         (PODFreeListArena):
804         (WebCore::PODFreeListArena::PODFreeListArena):
805
806 2013-05-29  Jer Noble  <jer.noble@apple.com>
807
808         [Mac] Scrubbing long movie files results in timeline snapping back to 0 during scrub.
809         https://bugs.webkit.org/show_bug.cgi?id=116986
810
811         Reviewed by Eric Carlson.
812
813         Keep a count of the number of in-flight seek requests, and only issue a timeupdate
814         (which triggers a "seeked" event) when the final seek completes.
815
816         Test: media/video-seek-multiple.html
817
818         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
819         (WebCore::MediaPlayerPrivateAVFoundation::seek):
820         (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted):
821         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
822         (MediaPlayerPrivateAVFoundation):
823
824 2013-05-29  Anders Carlsson  <andersca@apple.com>
825
826         Remove unused code from PODArena
827         https://bugs.webkit.org/show_bug.cgi?id=116990
828
829         Reviewed by Sam Weinig.
830
831         PODArena is only used as a base class of PODFreeListArena so remove unused member functions and make all
832         members protected to make it impossible to use it without subclassing.
833
834         PODArena is a risky class to use since it doesn't return memory to the system unless the arena object is destroyed.
835         This was the reason why PODFreeListArea was added. An upcoming patch will merge PODArena with PODFreeListArena and
836         this is a small step towards that goal.
837
838         * platform/PODArena.h:
839
840 2013-05-29  Darin Adler  <darin@apple.com>
841
842         Remove custom binding for Clipboard setDragImage function
843         https://bugs.webkit.org/show_bug.cgi?id=116422
844
845         Reviewed by Sam Weinig.
846
847         * bindings/js/JSClipboardCustom.cpp: Removed setDragImage binding.
848
849         * dom/Clipboard.cpp:
850         (WebCore::Clipboard::canSetDragImage): Added a condition that this is a drag
851         and drop clipboard. That used to be checked in the setDragImage binding.
852         (WebCore::Clipboard::setDragImage): Added a version that takes an Element
853         and calls through to the existing functions (in the legacy code path), or handles
854         both the Element and HTMLImageElement not-in-document cases (in the new code path).
855
856         * dom/Clipboard.h: Updated for changes above.
857
858         * dom/Clipboard.idl: Removed [Custom] from setDragImage.
859
860         * page/EventHandler.cpp:
861         (WebCore::EventHandler::handleDrag): Call the new setDragImage instead of the
862         old setDragImageElement.
863
864 2013-05-29  Praveen R Jadhav  <praveen.j@samsung.com>
865
866         Cleanup AudioSourceNode.idl from WebKit build.
867         https://bugs.webkit.org/show_bug.cgi?id=116905.
868
869         Reviewed by Darin Adler.
870
871         AudioSourceNode.idl is not part of WebAudio Specifications anymore.
872         AudioNode is inherited directly in all the audio source nodes.
873
874         No new tests. Current test cases will cover all the scenarios.
875
876         * CMakeLists.txt:
877         * DerivedSources.make:
878         * DerivedSources.pri:
879         * GNUmakefile.list.am:
880         * Modules/webaudio/AudioBufferSourceNode.h:
881         * Modules/webaudio/AudioBufferSourceNode.idl:
882         * Modules/webaudio/AudioScheduledSourceNode.cpp:
883         (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode):
884         * Modules/webaudio/AudioScheduledSourceNode.h:
885         * Modules/webaudio/AudioSourceNode.h: Removed.
886         * Modules/webaudio/AudioSourceNode.idl: Removed.
887         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
888         (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode):
889         * Modules/webaudio/MediaElementAudioSourceNode.h:
890         (MediaElementAudioSourceNode):
891         * Modules/webaudio/MediaElementAudioSourceNode.idl:
892         * Modules/webaudio/MediaStreamAudioDestinationNode.idl:
893         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
894         (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode):
895         * Modules/webaudio/MediaStreamAudioSourceNode.h:
896         (MediaStreamAudioSourceNode):
897         * Modules/webaudio/MediaStreamAudioSourceNode.idl:
898         * Modules/webaudio/OscillatorNode.h:
899         * Modules/webaudio/OscillatorNode.idl:
900         * Target.pri:
901         * WebCore.xcodeproj/project.pbxproj:
902
903 2013-05-29  Adam Barth  <abarth@webkit.org>
904
905         Optimize RenderText::offsetNext for 8 bit strings
906         https://bugs.webkit.org/show_bug.cgi?id=116877
907
908         Reviewed by Darin Adler.
909
910         Previously, this function was always upconverting strings to 16 bits in
911         order to create a cursorMovementIterator. This patch adds a fast path
912         for ASCII and Latin-1 strings, which don't need this complicated cursor
913         movement logic.
914
915         I ran into this code because nextOffset showed up as a memory pig on a
916         memory profile of Mobile Gmail.
917
918         Test: editing/selection/move-by-character-brute-force.html
919
920         * rendering/RenderText.cpp:
921         (WebCore::RenderText::previousOffset):
922         (WebCore::RenderText::nextOffset):
923
924 2013-05-29  Brent Fulgham  <bfulgham@apple.com>
925
926         [Windows] Correct copy command (form versus forms)
927
928         * WebCore.vcproj/copyForwardingHeaders.cmd:
929         * WebCore.vcxproj/copyForwardingHeaders.cmd:
930
931 2013-05-29  Bem Jones-Bey  <bjonesbe@adobe.com>
932
933         [CSS Shapes] Fix style issues in BasicShapes
934         https://bugs.webkit.org/show_bug.cgi?id=116734
935
936         Reviewed by Alexandru Chiculita.
937
938         Fix indentation in BasicShapes.cpp, and change enums to respect the
939         style rules CamelCase instead of HAVING_UNDERSCORES.
940
941         No new tests, only style changes.
942
943         * css/BasicShapeFunctions.cpp:
944         (WebCore::valueForBasicShape):
945         (WebCore::basicShapeForValue):
946         * css/CSSBasicShapes.cpp:
947         (WebCore::buildRectangleString):
948         (WebCore::CSSBasicShapeRectangle::equals):
949         (WebCore::CSSBasicShapeCircle::equals):
950         (WebCore::CSSBasicShapeEllipse::equals):
951         (WebCore::CSSBasicShapePolygon::equals):
952         (WebCore::CSSBasicShapeInsetRectangle::equals):
953         * css/CSSBasicShapes.h:
954         (WebCore::CSSBasicShapeRectangle::type):
955         (WebCore::CSSBasicShapeInsetRectangle::type):
956         (WebCore::CSSBasicShapeCircle::type):
957         (WebCore::CSSBasicShapeEllipse::type):
958         (WebCore::CSSBasicShapePolygon::type):
959         * rendering/ExclusionShape.cpp:
960         (WebCore::ExclusionShape::createExclusionShape):
961         * rendering/ExclusionShapeInsideInfo.cpp:
962         (WebCore::ExclusionShapeInsideInfo::isEnabledFor):
963         * rendering/ExclusionShapeOutsideInfo.cpp:
964         (WebCore::ExclusionShapeOutsideInfo::isEnabledFor):
965         * rendering/style/BasicShapes.cpp:
966         (WebCore::BasicShape::canBlend):
967         (WebCore::BasicShapeRectangle::path):
968         (WebCore::BasicShapeCircle::path):
969         (WebCore::BasicShapeEllipse::path):
970         (WebCore::BasicShapeInsetRectangle::path):
971         * rendering/style/BasicShapes.h:
972         (WebCore::BasicShapeRectangle::type):
973         (WebCore::BasicShapeCircle::type):
974         (WebCore::BasicShapeEllipse::type):
975         (WebCore::BasicShapePolygon::type):
976         (WebCore::BasicShapeInsetRectangle::type):
977
978 2013-05-29  Otto Derek Cheung  <otcheung@rim.com>
979
980         [BlackBerry] Handle Host-Only cookies
981         https://bugs.webkit.org/show_bug.cgi?id=116969
982
983         PR 338809
984         Reviewed by Rob Buis.
985         Internally Reviewed by Joe Mason.
986
987         Adding support for host-only cookies (cookies with no
988         specified domains). These cookies should only be returned
989         when the host matches the cookie domain exactly.
990
991         Tested using Opera and Browser cookie test suite. Tested
992         that host cookies are being stored in it's own map using
993         Web Inspector.
994
995         * platform/blackberry/CookieManager.cpp:
996         (WebCore::CookieManager::getRawCookies):
997         (WebCore::CookieManager::checkAndTreatCookie):
998         (WebCore::CookieManager::findOrCreateCookieMap):
999         * platform/blackberry/CookieParser.cpp:
1000         (WebCore::CookieParser::CookieParser):
1001         (WebCore::CookieParser::parseOneCookie):
1002         * platform/blackberry/ParsedCookie.h:
1003         (WebCore::ParsedCookie::isHostOnly):
1004         (ParsedCookie):
1005
1006 2013-05-29  Ryosuke Niwa  <rniwa@webkit.org>
1007
1008         Remove the size of DataVector in HTMLToken
1009         https://bugs.webkit.org/show_bug.cgi?id=116931
1010
1011         Reviewed by Sam Weinig.
1012
1013         Merge https://chromium.googlesource.com/chromium/blink/+/7977721e62c471bfa17b84d82cd5d8243a4eb9a9.
1014
1015         Shink HTMLToken by 1.5 kB
1016
1017         HTMLToken has an inline vector for buffering characters during tokenization. We
1018         originally picked the inline capacity of this buffer somewhat arbitrarily. This
1019         CL tunes the number based on a somewhat non-scientific browse of a number of
1020         popular web sites.
1021
1022         I (abarth) instrumented content_shell to log the length of each complete DataVector. I
1023         then browsed around a variety of web sites to collect data. The 99% percentile
1024         of DataVector lengths was just shy of 250 characters. I rounded that up to 256
1025         because powers of two are pretty. That means we'll malloc an external buffer
1026         less than 1% of the time, which seems fine.
1027
1028         * html/parser/HTMLToken.h:
1029         (HTMLToken):
1030
1031 2013-05-29  Brent Fulgham  <bfulgham@apple.com>
1032
1033         [Windows] Build correction after r150837
1034
1035         New 'forms' sub-folder of html needs to be included in
1036         copy operations.
1037
1038         * WebCore.vcproj/copyForwardingHeaders.cmd: copy html/forms.
1039         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Use correct
1040         'obj32' folder for build output.
1041         * WebCore.vcxproj/copyForwardingHeaders.cmd: copy html/forms.
1042
1043 2013-05-29  Tiancheng Jiang  <tijiang@rim.com>
1044
1045         [BlackBerry] Radio Button UX updates.
1046         https://bugs.webkit.org/show_bug.cgi?id=116881
1047
1048         Reviewed by Rob Buis.
1049
1050         BlackBerry PR 342322.
1051         Internally Reviewed by Jeff Rogers.
1052         Change images.
1053
1054         * platform/blackberry/RenderThemeBlackBerry.cpp:
1055         (WebCore::RenderThemeBlackBerry::paintRadio):
1056
1057 2013-05-29  Tiancheng Jiang  <tijiang@rim.com>
1058
1059         [BlackBerry] Datetime string is not centred in form controls.
1060         https://bugs.webkit.org/show_bug.cgi?id=100760
1061
1062         Reviewed by Rob Buis.
1063
1064         BlackBerry PR 343512
1065         Internally Reviewed by Jeff Rogers.
1066
1067         Adjust margin for inner text node of datetime form controls.
1068
1069         * css/themeBlackBerry.css:
1070         (input::-webkit-date-and-time-value):
1071
1072 2013-05-29  Brent Fulgham  <bfulgham@apple.com>
1073
1074         [Windows] Build correction after r150876
1075
1076         A clean build will now fail because the BaseMultipleFieldsDateAndTimeInputType sources have
1077         been removed, but are still referenced in the project file.
1078
1079         * WebCore.vcxproj/WebCore.vcxproj: Remove reference to BaseMultipleFieldsDateAndTimeInputType
1080         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto
1081
1082 2013-05-28  Jer Noble  <jer.noble@apple.com>
1083
1084         Support the 'onended' EventListener property for AudioBufferSourceNode and OscillatorNode.
1085         https://bugs.webkit.org/show_bug.cgi?id=116798
1086
1087         Reviewed by Eric Carlson.
1088
1089         Tests: webaudio/audiobuffersource-ended.html
1090                webaudio/oscillator-ended.html
1091
1092         * Modules/webaudio/AudioScheduledSourceNode.cpp:
1093         (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode):
1094         (WebCore::AudioScheduledSourceNode::setOnended): Set m_hasEndedListener.
1095         (WebCore::AudioScheduledSourceNode::finish): Call notifyEndedDispatch on the main thread.
1096         (WebCore::AudioScheduledSourceNode::notifyEndedDispatch): Call notifyEnded().
1097         (WebCore::AudioScheduledSourceNode::notifyEnded): Call the onended event listener.
1098         * Modules/webaudio/AudioScheduledSourceNode.h:
1099         (WebCore::AudioScheduledSourceNode::onended): Added boilerplate.
1100         * Modules/webaudio/AudioBufferSourceNode.idl: Added the onerror attribute.
1101         * Modules/webaudio/OscillatorNode.idl: Ditto.
1102
1103 2013-05-29  Bem Jones-Bey  <bjonesbe@adobe.com>
1104
1105         [CSS Shapes] Support parsing inset-rectangle shapes
1106         https://bugs.webkit.org/show_bug.cgi?id=116638
1107
1108         Reviewed by Dean Jackson.
1109
1110         Add parsing for inset-rectangle. It's very similar to parsing for
1111         rectangle.
1112
1113         No new tests, updated existing tests to cover this.
1114
1115         * css/BasicShapeFunctions.cpp:
1116         (WebCore::valueForBasicShape): Add support for inset rectangles.
1117         (WebCore::basicShapeForValue): Add support for inset rectangles.
1118         * css/CSSBasicShapes.cpp:
1119         (WebCore::buildInsetRectangleString): Create an inset-rectangle css
1120             string.
1121         (WebCore::CSSBasicShapeInsetRectangle::cssText): Convert inset
1122             rectangle shape to a CSS string.
1123         (WebCore::CSSBasicShapeInsetRectangle::equals): Compare two inset
1124             rectangles.
1125         (WebCore::CSSBasicShapeInsetRectangle::serializeResolvingVariables):
1126             Create an inset rectangle string, with CSS variables resolved.
1127         (WebCore::CSSBasicShapeInsetRectangle::hasVariableReference):
1128             Determine if this inset rectangle has any CSS Variable references.
1129         * css/CSSBasicShapes.h:
1130         (CSSBasicShapeInsetRectangle): Add inset rectangle class. This is a
1131             direct representation of the CSS property. All the methods below
1132             are just simple getters and setters, along with a construtor and a
1133             factory method.
1134         (WebCore::CSSBasicShapeInsetRectangle::create): 
1135         (WebCore::CSSBasicShapeInsetRectangle::top): 
1136         (WebCore::CSSBasicShapeInsetRectangle::right):
1137         (WebCore::CSSBasicShapeInsetRectangle::bottom):
1138         (WebCore::CSSBasicShapeInsetRectangle::left):
1139         (WebCore::CSSBasicShapeInsetRectangle::radiusX):
1140         (WebCore::CSSBasicShapeInsetRectangle::radiusY):
1141         (WebCore::CSSBasicShapeInsetRectangle::setTop):
1142         (WebCore::CSSBasicShapeInsetRectangle::setRight):
1143         (WebCore::CSSBasicShapeInsetRectangle::setBottom):
1144         (WebCore::CSSBasicShapeInsetRectangle::setLeft):
1145         (WebCore::CSSBasicShapeInsetRectangle::setRadiusX):
1146         (WebCore::CSSBasicShapeInsetRectangle::setRadiusY):
1147         (WebCore::CSSBasicShapeInsetRectangle::type):
1148         (WebCore::CSSBasicShapeInsetRectangle::CSSBasicShapeInsetRectangle):
1149         (WebCore):
1150         * css/CSSParser.cpp:
1151         (WebCore::CSSParser::parseBasicShapeInsetRectangle): Parse the
1152             inset-rectangle CSS property and create a
1153             CSSBasicShapeInsetRectangle.
1154         (WebCore::CSSParser::parseBasicShape): Add a call to parse
1155             inset-rectangle.
1156         * rendering/ExclusionShapeInsideInfo.cpp:
1157         (WebCore::ExclusionShapeInsideInfo::isEnabledFor): Disable
1158             inset-rectangles, since only the parsing has been implemented so
1159             far.
1160         * rendering/ExclusionShapeOutsideInfo.cpp:
1161         (WebCore::ExclusionShapeOutsideInfo::isEnabledFor): Disable
1162             inset-rectangles, since only the parsing has been implemented so
1163             far.
1164         * rendering/style/BasicShapes.cpp:
1165         (WebCore::BasicShapeInsetRectangle::path): Calculate the Path for an
1166             inset-rectangle.
1167         (WebCore::BasicShapeInsetRectangle::blend): Blend two inset rectangles
1168             together at a point depending on the "progress" and return the
1169             blended rectangle.
1170         * rendering/style/BasicShapes.h:
1171         (BasicShapeInsetRectangle): Add higher level inset rectangle class.
1172             This is used outside of the CSS representation. The methods below
1173             are just simple getters and setters, along with a constructor and
1174             a factory method.
1175         (WebCore::BasicShapeInsetRectangle::create):
1176         (WebCore::BasicShapeInsetRectangle::top):
1177         (WebCore::BasicShapeInsetRectangle::right):
1178         (WebCore::BasicShapeInsetRectangle::bottom):
1179         (WebCore::BasicShapeInsetRectangle::left):
1180         (WebCore::BasicShapeInsetRectangle::cornerRadiusX):
1181         (WebCore::BasicShapeInsetRectangle::cornerRadiusY):
1182         (WebCore::BasicShapeInsetRectangle::setTop):
1183         (WebCore::BasicShapeInsetRectangle::setRight):
1184         (WebCore::BasicShapeInsetRectangle::setBottom):
1185         (WebCore::BasicShapeInsetRectangle::setLeft):
1186         (WebCore::BasicShapeInsetRectangle::setCornerRadiusX):
1187         (WebCore::BasicShapeInsetRectangle::setCornerRadiusY):
1188         (WebCore::BasicShapeInsetRectangle::type):
1189         (WebCore::BasicShapeInsetRectangle::BasicShapeInsetRectangle):
1190
1191 2013-05-29  Andreas Kling  <akling@apple.com>
1192
1193         Move computed style extraction out of CSSComputedStyleDeclaration.
1194         <http://webkit.org/b/116965>
1195
1196         Reviewed by Antti Koivisto.
1197
1198         Make it possible to get computed CSSValues from a Node without creating a CSSOM
1199         style declaration object.
1200
1201         The bulk of the logic moves to a new class; ComputedStyleExtractor, which can be created
1202         on the stack, and takes the same setup variables as CSSComputedStyleDeclaration.
1203
1204         This is prep to enable futuristic optimizations in editing and elsewhere.
1205
1206         * css/CSSComputedStyleDeclaration.h:
1207         * css/CSSComputedStyleDeclaration.cpp:
1208         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1209
1210             Create a ComputedStyleExtractor to do the work!
1211
1212         (WebCore::ComputedStyleExtractor::currentColorOrValidColor):
1213         (WebCore::ComputedStyleExtractor::valueForFilter):
1214         (WebCore::ComputedStyleExtractor::ComputedStyleExtractor):
1215         (WebCore::ComputedStyleExtractor::valueForShadow):
1216         (WebCore::ComputedStyleExtractor::styledNode):
1217         (WebCore::ComputedStyleExtractor::propertyValue):
1218         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
1219         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand):
1220         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
1221         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
1222         * css/SVGCSSComputedStyleDeclaration.cpp:
1223         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor):
1224         (WebCore::ComputedStyleExtractor::svgPropertyValue):
1225
1226             Moved all of these from CSSComputedStyleDeclaration to the new class.
1227
1228         * rendering/style/RenderStyle.h:
1229         * svg/SVGPaint.h:
1230
1231             Have these two befriend ComputedStyleExtractor.
1232
1233 2013-05-29  Antti Koivisto  <antti@apple.com>
1234
1235         Another attempt to fix windows build.
1236         
1237         Not reviewed.
1238
1239         * css/CSSFontSelector.h:
1240
1241 2013-05-29  Antti Koivisto  <antti@apple.com>
1242
1243         Try to fix window build.
1244         
1245         Not reviewed.
1246
1247         * platform/graphics/FontCache.h:
1248         (WebCore::FontDescriptionFontDataCacheKey::computeHash):
1249
1250 2013-05-29  Simon Fraser  <simon.fraser@apple.com>
1251
1252         Fix the firing of m_paintRelatedMilestonesTimer
1253         https://bugs.webkit.org/show_bug.cgi?id=116919
1254
1255         Reviewed by Tim Horton.
1256
1257         r150671 intended to change things so that paint-related milestones
1258         only fire when painting has actually happened, so that WebKit clients
1259         are notified when we actually have bits to present.
1260         
1261         However, it made an incorrect assumption that painting would happen
1262         inside of flushCompositingState(). This is not the case; flushCompositingState()
1263         will just dirty CALayers, and later on Core Animation will ask us to paint them.
1264         
1265         This incorrect assumption meant that we would never start the
1266         m_paintRelatedMilestonesTimer, so never fire the milestones.
1267         
1268         Fix by starting the m_paintRelatedMilestonesTimer via the RenderLayerBacking
1269         paintContents call back. At this time we know we're painting, so we can both
1270         set the FrameView's last paint time, and start up the timer. We also only
1271         want to start the timer if there are pending milestones.
1272
1273         * rendering/RenderLayerBacking.cpp:
1274         (WebCore::RenderLayerBacking::paintIntoLayer):
1275         (WebCore::RenderLayerBacking::paintContents):
1276         * rendering/RenderLayerCompositor.cpp:
1277         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1278         (WebCore::RenderLayerCompositor::didPaintBacking):
1279         * rendering/RenderLayerCompositor.h:
1280         (RenderLayerCompositor):
1281
1282 2013-05-29  Antti Koivisto  <antti@apple.com>
1283
1284         Share FontGlyphs
1285         https://bugs.webkit.org/show_bug.cgi?id=116863
1286
1287         Reviewed by Anreas Kling.
1288
1289         Style system generates many Font objects that are identical or similar enough to have identical FontGlyphs. 
1290         We can figure out that the FontGlyphs are going to be the same and share them. This reduces memory usage.
1291         It also improves performance as the glyph cache and the width cache hang from FontGlyphs and their hit rate
1292         increases.
1293         
1294         On PLT3 this takes the number of live FontGlyphs at the end from 40k+ to <1k. Width cache hit rate improves
1295         from ~42% to ~55%.
1296
1297         * css/CSSFontSelector.cpp:
1298         (WebCore::CSSFontSelector::CSSFontSelector):
1299         
1300             Add unique id we can use in cache key.
1301
1302         (WebCore::CSSFontSelector::dispatchInvalidationCallbacks):
1303         
1304             Bump the version number on invalidation so we don't reuse cache entries after web font is loaded.
1305
1306         (WebCore::CSSFontSelector::resolvesFamilyFor):
1307         
1308             Test if FontSelector is needed for resolving a particular FontDescription.
1309
1310         * css/CSSFontSelector.h:
1311         * page/Settings.cpp:
1312         (WebCore::setGenericFontFamilyMap):
1313         
1314             Invalidate the cache if standard font settings change.
1315
1316         * platform/graphics/Font.cpp:
1317         (FontGlyphsCacheKey):
1318         (FontGlyphsCacheEntry):
1319         (WebCore::operator==):
1320         (WebCore::fontGlyphsCache):
1321         (WebCore::invalidateFontGlyphsCache):
1322         (WebCore::makeFontSelectorFlags):
1323         (WebCore::makeFontGlyphsCacheKey):
1324         
1325             The cache key consists of
1326             
1327             - all families.
1328             - shared key with the lower level FontData cache (FontCache), guaranteeing FontDatas would be identical.
1329             - font selector specific keys.
1330
1331             These guarantee the FontData will be identical.
1332
1333         (WebCore::computeFontGlyphsCacheHash):
1334         (WebCore::pruneUnreferencedFromFontGlyphsCache):
1335         
1336             Don't accumulate unused entries.
1337
1338         (WebCore::retrieveOrAddCachedFontGlyphs):
1339         (WebCore::Font::update):
1340         * platform/graphics/Font.h:
1341         * platform/graphics/FontCache.cpp:
1342         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
1343         (WebCore::FontPlatformDataCacheKey::isHashTableDeletedValue):
1344         (WebCore::FontPlatformDataCacheKey::operator==):
1345         (FontPlatformDataCacheKey):
1346         (WebCore::computeHash):
1347         (WebCore::FontCache::getCachedFontPlatformData):
1348         (WebCore::FontCache::purgeInactiveFontData):
1349         (WebCore::FontCache::invalidate):
1350         * platform/graphics/FontCache.h:
1351         (WebCore::FontDescriptionFontDataCacheKey::FontDescriptionFontDataCacheKey):
1352         (WebCore::FontDescriptionFontDataCacheKey::makeFlagKey):
1353         (WebCore::FontDescriptionFontDataCacheKey::operator==):
1354         (WebCore::FontDescriptionFontDataCacheKey::operator!=):
1355         (WebCore::FontDescriptionFontDataCacheKey::computeHash):
1356         
1357             Separate part of the key for sharing.
1358
1359         (FontDescriptionFontDataCacheKey):
1360         * platform/graphics/FontFallbackList.cpp:
1361         (WebCore::FontGlyphs::FontGlyphs):
1362         (WebCore::FontGlyphs::releaseFontData):
1363         * platform/graphics/FontFallbackList.h:
1364         (WebCore::FontGlyphs::create):
1365         (WebCore::FontGlyphs::~FontGlyphs):
1366         
1367             Remove invalidate(). If FontGlyphs needs invalidation it is reconstructed.
1368
1369         * platform/graphics/FontSelector.h:
1370
1371 2013-05-29  Nico Weber  <thakis@chromium.org>
1372
1373         Remove unused file PlatformGestureEvent.cpp
1374         https://bugs.webkit.org/show_bug.cgi?id=116894
1375
1376         Reviewed by Darin Adler.
1377
1378         This was added in https://bugs.webkit.org/show_bug.cgi?id=49345 but
1379         not removed in https://bugs.webkit.org/show_bug.cgi?id=77492 which
1380         removed most of that code again.
1381         
1382         * platform/PlatformGestureRecognizer.cpp: Removed.
1383
1384 2013-05-29  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
1385
1386         [texmap][GStreamer][GTK] Composited Video support
1387         https://bugs.webkit.org/show_bug.cgi?id=86410
1388
1389         Reviewed by Noam Rosenthal.
1390
1391         Enable the video accelerated compositing using the WebKit's
1392         TextureMapper.
1393
1394         This patch does not use hardware accelerated video decoding. It
1395         provides a generic path for system memory buffers.
1396
1397         This new functionality is only available when the coordinated graphics
1398         system is not used.
1399
1400         No new tests, already covered by existing tests.
1401
1402         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1403         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
1404         (WebCore):
1405         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): update the
1406         texture content with the new received video buffer.
1407         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): choose to
1408         use the accelerated compositing or the normal code path
1409         (WebCore::MediaPlayerPrivateGStreamerBase::paint): if accelerated
1410         compositing is used this method is halted.
1411         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper): get
1412         a texture from the pool and draws it if it is already available.
1413         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1414         (MediaPlayerPrivateGStreamerBase):
1415         (WebCore::MediaPlayerPrivateGStreamerBase::platformLayer): returns itself
1416         (WebCore::MediaPlayerPrivateGStreamerBase::supportsAcceleratedRendering):
1417         returns true
1418
1419 2013-05-29  Peter Gal  <galpeter@inf.u-szeged.hu>
1420
1421         [Qt] Missing files from build after r150853
1422         https://bugs.webkit.org/show_bug.cgi?id=116932
1423
1424         Reviewed by Csaba Osztrogonác.
1425
1426         * Target.pri: Added missing include path.
1427
1428 2013-05-29  Mihai Maerean  <mmaerean@adobe.com>
1429
1430         [CSS Regions] Content that has overflow: scroll cannot be scrolled by dragging the scroll thumbs with the mouse
1431         https://bugs.webkit.org/show_bug.cgi?id=113703
1432
1433         Reviewed by Darin Adler.
1434
1435         The point inside a box that's inside a region has its coordinates relative to the region, not the FlowThread
1436         that is its container in the RenderObject tree.
1437
1438         Previously, the coordinates were computed relatively to the FlowThread which doesn't really have a location in
1439         the page.
1440
1441         Tests: fast/regions/drag-scrollbars-of-content.html
1442                fast/regions/hover-in-second-region.html
1443
1444         * rendering/RenderBox.cpp:
1445         (WebCore::RenderBox::offsetFromContainer):
1446         * rendering/RenderBoxModelObject.cpp:
1447         (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint):
1448
1449 2013-05-29  Andreas Kling  <akling@apple.com>
1450
1451         Fix dumb typo in r150879.
1452
1453         * editing/htmlediting.cpp:
1454         (WebCore::nextLeafNode):
1455
1456 2013-05-29  Andreas Kling  <akling@apple.com>
1457
1458         Move leaf Node traversal helpers to htmlediting.cpp
1459         <http://webkit.org/b/116940>
1460
1461         Reviewed by Antti Koivisto.
1462
1463         Move Node::previousLeafNode() and Node::nextLeafNode() to htmlediting.cpp along with their helpers.
1464         Fixes an 8-year old FIXME. \o/
1465
1466         * dom/Node.h:
1467         * dom/Node.cpp:
1468         * dom/Position.cpp:
1469         (WebCore::nextRenderedEditable):
1470         (WebCore::previousRenderedEditable):
1471         * editing/VisibleUnits.cpp:
1472         (WebCore::previousLeafWithSameEditability):
1473         (WebCore::nextLeafWithSameEditability):
1474         * editing/htmlediting.h:
1475         * editing/htmlediting.cpp:
1476         (WebCore::previousNodeConsideringAtomicNodes):
1477         (WebCore::nextNodeConsideringAtomicNodes):
1478         (WebCore::previousLeafNode):
1479         (WebCore::nextLeafNode):
1480
1481 2013-05-29  Peter Gal  <galpeter@inf.u-szeged.hu>
1482
1483         [Qt] Missing files from build after r150853
1484         https://bugs.webkit.org/show_bug.cgi?id=116932
1485
1486         Reviewed by Csaba Osztrogonác.
1487
1488         * Target.pri: Added the CFURLExtras.{cpp,h} files to the projectfile.
1489
1490 2013-05-29  Ryosuke Niwa  <rniwa@webkit.org>
1491
1492         PresentationAttributeCacheCleaner::m_hitCount is never initialized
1493         https://bugs.webkit.org/show_bug.cgi?id=116946
1494
1495         Reviewed by Andreas Kling.
1496
1497         Merge https://chromium.googlesource.com/chromium/blink/+/70be7ddc41141ef6dec7795d37842c27dab2e194.
1498
1499         * dom/StyledElement.cpp:
1500         (WebCore::PresentationAttributeCacheCleaner::PresentationAttributeCacheCleaner):
1501
1502 2013-05-29  Kent Tamura  <tkent@chromium.org>
1503
1504         Remove ENABLE_INPUT_MULTIPLE_FIELDS_UI.
1505         https://bugs.webkit.org/show_bug.cgi?id=116796
1506
1507         Reviewed by Ryosuke Niwa.
1508
1509         This feature was used only by Chromium port.
1510
1511         * CMakeLists.txt:
1512         * GNUmakefile.list.am:
1513         * Target.pri:
1514         * WebCore.vcproj/WebCore.vcproj:
1515         * WebCore.vcxproj/WebCore.vcxproj:
1516         * WebCore.vcxproj/WebCore.vcxproj.filters:
1517         * WebCore.xcodeproj/project.pbxproj:
1518         * css/html.css:
1519         (input::-webkit-date-and-time-value):
1520         * dom/Element.cpp:
1521         * dom/Element.h:
1522         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
1523         * html/BaseChooserOnlyDateAndTimeInputType.h:
1524         * html/BaseMultipleFieldsDateAndTimeInputType.cpp: Removed.
1525         * html/BaseMultipleFieldsDateAndTimeInputType.h: Removed.
1526         * html/DateInputType.cpp:
1527         * html/DateInputType.h:
1528         (DateInputType):
1529         * html/DateTimeFieldsState.cpp: Removed.
1530         * html/DateTimeFieldsState.h: Removed.
1531         * html/DateTimeInputType.cpp:
1532         * html/DateTimeInputType.h:
1533         (DateTimeInputType):
1534         * html/DateTimeLocalInputType.cpp:
1535         * html/DateTimeLocalInputType.h:
1536         (DateTimeLocalInputType):
1537         * html/HTMLInputElement.cpp:
1538         (WebCore::HTMLInputElement::HTMLInputElement):
1539         (WebCore):
1540         * html/HTMLInputElement.h:
1541         (HTMLInputElement):
1542         * html/InputType.cpp:
1543         * html/InputType.h:
1544         (InputType):
1545         * html/MonthInputType.cpp:
1546         * html/MonthInputType.h:
1547         (MonthInputType):
1548         * html/TimeInputType.cpp:
1549         * html/TimeInputType.h:
1550         (TimeInputType):
1551         * html/WeekInputType.cpp:
1552         * html/WeekInputType.h:
1553         (WeekInputType):
1554         * html/shadow/ClearButtonElement.cpp: Removed.
1555         * html/shadow/ClearButtonElement.h: Removed.
1556         * html/shadow/DateTimeEditElement.cpp: Removed.
1557         * html/shadow/DateTimeEditElement.h: Removed.
1558         * html/shadow/DateTimeFieldElement.cpp: Removed.
1559         * html/shadow/DateTimeFieldElement.h: Removed.
1560         * html/shadow/DateTimeFieldElements.cpp: Removed.
1561         * html/shadow/DateTimeFieldElements.h: Removed.
1562         * html/shadow/DateTimeNumericFieldElement.cpp: Removed.
1563         * html/shadow/DateTimeNumericFieldElement.h: Removed.
1564         * html/shadow/DateTimeSymbolicFieldElement.cpp: Removed.
1565         * html/shadow/DateTimeSymbolicFieldElement.h: Removed.
1566         * html/shadow/PickerIndicatorElement.cpp: Removed.
1567         * html/shadow/PickerIndicatorElement.h: Removed.
1568         * page/ChromeClient.h:
1569         (ChromeClient):
1570         * platform/LocalizedStrings.h:
1571         (WebCore):
1572         * platform/text/PlatformLocale.cpp:
1573         * platform/text/PlatformLocale.h:
1574         (Locale):
1575         * rendering/RenderDetailsMarker.cpp:
1576         * rendering/RenderDetailsMarker.h:
1577         * rendering/RenderObject.h:
1578         (RenderObject):
1579
1580 2013-05-29  Ryosuke Niwa  <rniwa@webkit.org>
1581
1582         Remove setFullScreenRendererSize and setFullScreenRendererBackgroundColor
1583         https://bugs.webkit.org/show_bug.cgi?id=116914
1584
1585         Reviewed by Benjamin Poulain.
1586
1587         Merge https://chromium.googlesource.com/chromium/blink/+/508eb21a07f69ed38b9be9ff92fe75dcb907861f
1588
1589         * dom/Document.cpp:
1590         * dom/Document.h:
1591
1592 2013-05-29  Ryosuke Niwa  <rniwa@webkit.org>
1593
1594         Make WidgetHierarchyUpdatesSuspensionScope use swap instead of copy
1595         https://bugs.webkit.org/show_bug.cgi?id=116927
1596
1597         Reviewed by Andreas Kling.
1598
1599         Merge https://chromium.googlesource.com/chromium/blink/+/1d577e1fd5c5716a06e4007e04fc3d9d0a88f5e4
1600
1601         This is equivalent behavior code that is unambiguously better performance. swap is O(1) time and memory,
1602         copying a hash table is at least linear with the number of elements.
1603
1604         * rendering/RenderWidget.cpp:
1605         (WebCore::WidgetHierarchyUpdatesSuspensionScope::moveWidgets):
1606
1607 2013-05-29  Andreas Kling  <akling@apple.com>
1608
1609         Remove Document::nodeAbsIndex() and Document::nodeWithAbsIndex().
1610
1611         Rubber-stamped by Antti "Lucky" Koivisto.
1612
1613         * dom/Document.h:
1614         * dom/Document.cpp:
1615
1616 2013-05-28  Andreas Kling  <akling@apple.com>
1617
1618         FocusController should operate on Elements internally.
1619         <http://webkit.org/b/116781>
1620
1621         Reviewed by Antti Koivisto.
1622
1623         Switch from Node* to Element* as much as possible inside FocusController.
1624         Mostly mechanical, gets rid of some unnecessary isElementNode() checks and casts.
1625
1626         * page/FocusController.h:
1627         * page/FocusController.cpp:
1628         (WebCore::dispatchEventsOnWindowAndFocusedElement):
1629         (WebCore::isNonFocusableShadowHost):
1630         (WebCore::adjustedTabIndex):
1631         (WebCore::shouldVisit):
1632         (WebCore::FocusController::setFocused):
1633         (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
1634         (WebCore::FocusController::advanceFocusInDocumentOrder):
1635         (WebCore::FocusController::findFocusableElementAcrossFocusScope):
1636         (WebCore::FocusController::findFocusableElementRecursively):
1637         (WebCore::FocusController::findFocusableElement):
1638         (WebCore::FocusController::nextFocusableElement):
1639         (WebCore::FocusController::previousFocusableElement):
1640         (WebCore::FocusController::setActive):
1641
1642 2013-05-29  Radu Stavila  <stavila@adobe.com>
1643
1644         [CSS Regions] Mouse over an element does not trigger :hover state for parent when the element is flowed in a region
1645         https://bugs.webkit.org/show_bug.cgi?id=111749
1646
1647         Reviewed by Antti Koivisto.
1648
1649         When searching for the hover ancestor and encountering a named flow thread,
1650         the search will continue with the DOM ancestor of the top-most element
1651         in the named flow thread.
1652
1653         Tests: fast/regions/hover-in-region-grandparent.html
1654                fast/regions/hover-in-region-parent-skip.html
1655                fast/regions/hover-in-region-parent-skip-inlines-anonymous.html
1656                fast/regions/hover-on-child-in-region.html
1657                fast/regions/hover-on-child-in-region-in-region.html
1658
1659         * rendering/RenderObject.cpp:
1660         (WebCore::RenderObject::hoverAncestor):
1661         * rendering/RenderObject.h:
1662
1663 2013-05-28  Nate Chapin  <japhet@chromium.org>
1664
1665         Crash in WebCore::SubresourceLoader::releaseResources when connection fails
1666         https://bugs.webkit.org/show_bug.cgi?id=87743
1667
1668         Don't do anything complicated in SubresourceLoader::releaseResources(),
1669         just clear variables. With this patch, releaseResources() will still
1670         assert in debug builds if it is called twice, but it will safely execute
1671         in release.
1672
1673         Reviewed by Darin Adler.
1674
1675         * loader/ResourceLoader.cpp:
1676         (WebCore::ResourceLoader::cleanupForError): Pull shared cleanup code out of didFail()
1677             and cancel() into a helper.
1678         (WebCore::ResourceLoader::cancel): Merge a couple variables into an enum, check for
1679             reentrancy from within didCancel().
1680         * loader/ResourceLoader.h: Replace m_calledWillCancel and m_cancelled with an enum.
1681         * loader/SubresourceLoader.cpp:
1682         (WebCore::SubresourceLoader::didFinishLoading): Don't call ResourceLoader::didFinishLoading(),
1683             put finish() in the middle of the process.
1684         (WebCore::SubresourceLoader::didFail): Don't call ResourceLoader::didFail(), put finish()
1685             in the middle of the process.
1686         (WebCore::SubresourceLoader::didCancel):
1687         (WebCore::SubresourceLoader::notifyDone): Do the non-trivial work previous done in releaseResources(),
1688             most importantly calling loadDone().
1689         (WebCore::SubresourceLoader::releaseResources): Only do simple variable clearing here.
1690         * loader/SubresourceLoader.h:
1691         (SubresourceLoader):
1692         * loader/cache/CachedResource.cpp: Split stopLoading() into cancelLoad() (which notifies clients)
1693             and clearLoader() (which just nulls m_loader).
1694         * loader/cache/CachedResource.h:
1695         * loader/chromium/ResourceLoaderChromium.cpp:
1696
1697 2013-05-28  Seokju Kwon  <seokju.kwon@gmail.com>
1698
1699         [GTK] Build fix after r150837
1700         https://bugs.webkit.org/show_bug.cgi?id=116904
1701
1702         Unreviewed build fix.
1703
1704         * GNUmakefile.am:
1705
1706 2013-05-28  Andy Estes  <aestes@apple.com>
1707
1708         REGRESSION (r150169): Images from file: URLs display after a delay even though they were preloaded by JavaScript
1709         https://bugs.webkit.org/show_bug.cgi?id=116906
1710         <rdar://problem/13991927>
1711
1712         Reviewed by Andreas Kling.
1713
1714         Writing a test for this is blocked on https://webkit.org/b/116199.
1715
1716         Some WebKit clients use JavaScript to preload images from disk so that
1717         subsequent loads will display immediately from the memory cache. By not
1718         caching non-HTTP sub-resources in memory, we break this common pattern.
1719         This change restricts r150169 to only apply to cached main resources.
1720         Sub-resources will again be cached indefinitely as they were prior to
1721         r150169.
1722
1723         * loader/cache/CachedResource.cpp:
1724         (WebCore::CachedResource::freshnessLifetime): If this is a non-HTTP
1725         main resource from a scheme that should not be cached indefinitely,
1726         return 0 for the freshness lifetime. For other non-HTTP cached
1727         resources, return an indefinite freshness lifetime.
1728
1729 2013-05-28  Dean Jackson  <dino@apple.com>
1730
1731         Animations do not restart after exiting page cache
1732         https://bugs.webkit.org/show_bug.cgi?id=116900
1733
1734         Reviewed by Tim Horton.
1735
1736         Animations are suspended as they enter the page cache, but
1737         were not getting correctly resumed when exiting. The cause
1738         was an error in r149576 which was checking a global flag for suspension
1739         on the AnimationController and thus not trying to resume anything.
1740
1741         Test: animations/resume-after-page-cache.html
1742
1743         * page/animation/AnimationController.cpp:
1744         (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument):
1745         (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument):
1746
1747 2013-05-28  Chris Rogers  <crogers@google.com>
1748
1749         Support multiple HRTFDatabases for different sample-rates
1750         https://bugs.webkit.org/show_bug.cgi?id=116183
1751
1752         Reviewed by Kenneth Russell.
1753
1754         Adapted from Blink:
1755         https://codereview.chromium.org/14636011/
1756
1757         This removes the limitation which required OfflineAudioContexts to be created at native sample-rate
1758
1759         * Modules/webaudio/AudioContext.h:
1760         (WebCore::AudioContext::hrtfDatabaseLoader):
1761         (AudioContext):
1762         * Modules/webaudio/OfflineAudioContext.cpp:
1763         (WebCore::OfflineAudioContext::create):
1764         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
1765         (WebCore::OfflineAudioDestinationNode::offlineRender):
1766         * Modules/webaudio/PannerNode.cpp:
1767         (WebCore::PannerNode::initialize):
1768         (WebCore::PannerNode::setPanningModel):
1769         * platform/audio/HRTFDatabaseLoader.cpp:
1770         (WebCore):
1771         (WebCore::HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary):
1772         (WebCore::HRTFDatabaseLoader::~HRTFDatabaseLoader):
1773         * platform/audio/HRTFDatabaseLoader.h:
1774         (HRTFDatabaseLoader):
1775         (WebCore::HRTFDatabaseLoader::loaderMap):
1776         * platform/audio/HRTFPanner.cpp:
1777         (WebCore::HRTFPanner::HRTFPanner):
1778         (WebCore::HRTFPanner::calculateDesiredAzimuthIndexAndBlend):
1779         (WebCore::HRTFPanner::pan):
1780         * platform/audio/HRTFPanner.h:
1781         (HRTFPanner):
1782         * platform/audio/Panner.cpp:
1783         (WebCore::Panner::create):
1784         * platform/audio/Panner.h:
1785         (WebCore):
1786
1787 2013-05-28  Alexey Proskuryakov  <ap@apple.com>
1788
1789         Windows build fix.
1790
1791         * platform/cf/KURLCFNet.cpp:
1792         (WebCore::KURL::createCFURL):
1793
1794 2013-05-28  Alexey Proskuryakov  <ap@apple.com>
1795
1796         Freeze when loading a particular page on washingtonpost.com with NetworkProcess enabled
1797         https://bugs.webkit.org/show_bug.cgi?id=116887
1798         <rdar://problem/12965959>
1799
1800         Reviewed by Darin Adler.
1801
1802         Test: http/tests/uri/curly-braces-escaping.html
1803
1804         The issue was that WebKit used an incorrect accessor to get a string out of CFURL,
1805         unlike WebCore.
1806
1807         Centralized code for converting between CFURLs and strings in a place that WebKit
1808         can use directly.
1809
1810         * WebCore.exp.in:
1811         * WebCore.vcproj/WebCore.vcproj:
1812         * WebCore.vcxproj/WebCore.vcxproj:
1813         * WebCore.vcxproj/WebCore.vcxproj.filters:
1814         * WebCore.xcodeproj/project.pbxproj:
1815         Keeping things building.
1816
1817         * platform/KURL.cpp: (WebCore::KURL::copyToBuffer):
1818         * platform/KURL.h:
1819         Updated for a new typedef name. The code was using Vector<char, 512> and CharBuffer
1820         inconsistently, and now URLs use URLCharBuffer.
1821
1822         * platform/cf/CFURLExtras.cpp: Added.
1823         (WebCore::createCFURLFromBuffer):
1824         (WebCore::getURLBytes):
1825         * platform/cf/CFURLExtras.h: Added.
1826         * platform/cf/KURLCFNet.cpp:
1827         (WebCore::KURL::KURL):
1828         (WebCore::KURL::createCFURL):
1829         Extracted code for CFURL string manipulation that is not logcally part of KURL.
1830
1831         * platform/mac/KURLMac.mm:
1832         (WebCore::KURL::KURL): Use the new getURLBytes function.
1833         (WebCore::KURL::operator NSURL *): Added a comment.
1834         (WebCore::KURL::createCFURL): Added a comment, and updated for new names and
1835         signatures.
1836
1837         * platform/network/cf/ResourceErrorCF.cpp: (WebCore::ResourceError::platformLazyInit):
1838         Added a FIXME. We are still using CFURLGetString here. The difficulty is getting
1839         encodings right.
1840
1841 2013-05-28  Anders Carlsson  <andersca@apple.com>
1842
1843         Create a html/forms subdirectory and move FileIconLoader there
1844         https://bugs.webkit.org/show_bug.cgi?id=116880
1845
1846         Reviewed by Jessie Berlin.
1847
1848         A lot (if not the majority) of files in html/ are forms related, so it makes sense to begin splitting
1849         them out into a separate subdirectory, html/forms.
1850
1851         Begin my moving FileIconLoader from platform to html/forms. It is related to HTML forms (it's only used by
1852         the file upload element), and is not really a platform abstraction so it doesn't belong in platform.
1853
1854         * CMakeLists.txt:
1855         * GNUmakefile.list.am:
1856         * Target.pri:
1857         * WebCore.vcproj/WebCore.vcproj:
1858         * WebCore.vcxproj/WebCore.vcxproj:
1859         * WebCore.vcxproj/WebCore.vcxproj.filters:
1860         * WebCore.xcodeproj/project.pbxproj:
1861         * html/forms/FileIconLoader.cpp: Renamed from Source/WebCore/platform/FileIconLoader.cpp.
1862         * html/forms/FileIconLoader.h: Renamed from Source/WebCore/platform/FileIconLoader.h.
1863
1864 2013-05-28  Chris Fleizach  <cfleizach@apple.com>
1865
1866         AX: WKView is unable to set AXFocused to YES and does not handle keyboard events as expected
1867         https://bugs.webkit.org/show_bug.cgi?id=116756
1868
1869         Reviewed by Tim Horton.
1870
1871         If AXFocused is set to true, but the WebView is not the first responder, then the call will
1872         not do anything. This change asks the Chrome to make the WebView the first responder before
1873         trying to set focus within the page.
1874
1875         Was not able to make a test, it requires on interplay between areas outside the web view.
1876
1877         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1878         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
1879
1880 2013-05-28  Jer Noble  <jer.noble@apple.com>
1881
1882         Crash in DumpRenderTree at com.apple.WebCore: WebCore::RenderTextTrackCue::repositionGenericCue + 154
1883         https://bugs.webkit.org/show_bug.cgi?id=116882
1884
1885         Reviewed by Eric Carlson.
1886
1887         Remove an inappropriate assert. No cues coming through repositionGenericCue will be WebVTT ones.
1888
1889         * rendering/RenderTextTrackCue.cpp:
1890         (WebCore::RenderTextTrackCue::repositionGenericCue):
1891
1892 2013-05-28  Alberto Garcia  <agarcia@igalia.com>
1893
1894         [BlackBerry] GraphicsContext: add missing definitions.
1895         https://bugs.webkit.org/show_bug.cgi?id=115515
1896
1897         Reviewed by Rob Buis.
1898
1899         * platform/graphics/GraphicsContext.h:
1900         (Graphics):
1901         Add definition for PlatformGraphicsContext.
1902         * platform/graphics/blackberry/GraphicsContextBlackBerry.cpp:
1903         Include RoundedRect.h
1904
1905 2013-05-28  Arvid Nilsson  <anilsson@rim.com>
1906
1907         [BlackBerry] Fix style issues in BlackBerry accelerated compositing backend
1908         https://bugs.webkit.org/show_bug.cgi?id=116604
1909
1910         Reviewed by Carlos Garcia Campos.
1911
1912         PR 273550, 99638
1913
1914         Remove the "get" prefix from getters in the WebKit- and compositing-
1915         thread layer classes, as well as LayerRendererSurface. Clarify which
1916         geometry-related getters return normalized device coordinates by adding
1917         a comment.
1918
1919         Also remove dead code related to LayerData::m_holePunchClipRect, which
1920         was part of an eventually disabled fix for video clipping in iframes,
1921         PR 99638. Since we now use AC layers for iframes, the bug is no longer
1922         reproducible, and the dead code will never need to be enabled again.
1923
1924         No change in behavior, no new tests.
1925
1926         * platform/graphics/blackberry/EGLImageLayerCompositingThreadClient.cpp:
1927         (WebCore::EGLImageLayerCompositingThreadClient::drawTextures):
1928         * platform/graphics/blackberry/LayerCompositingThread.cpp:
1929         (WebCore::LayerCompositingThread::setDrawTransform):
1930         (WebCore::LayerCompositingThread::transformedHolePunchRect):
1931         (WebCore::LayerCompositingThread::drawTextures):
1932         (WebCore::LayerCompositingThread::drawSurface):
1933         * platform/graphics/blackberry/LayerCompositingThread.h:
1934         (WebCore::LayerCompositingThread::sublayers): Removed "get" prefix
1935         (LayerCompositingThread):
1936         (WebCore::LayerCompositingThread::boundingBox): Renamed from "getDrawRect"
1937         (WebCore::LayerCompositingThread::transformedBounds): Removed "get" prefix
1938         (WebCore::LayerCompositingThread::transformedHolePunchRect): Removed "get" prefix
1939         * platform/graphics/blackberry/LayerData.h:
1940         (LayerData): Removed unused data member "m_holePunchClipRect"
1941         * platform/graphics/blackberry/LayerFilterRenderer.cpp:
1942         (WebCore::LayerFilterRenderer::applyActions):
1943         * platform/graphics/blackberry/LayerRenderer.cpp:
1944         (WebCore::LayerRenderer::compositeLayers):
1945         (WebCore::LayerRenderer::drawDebugBorder):
1946         (WebCore::LayerRenderer::drawHolePunchRect):
1947         (WebCore::LayerRenderer::prepareFrameRecursive):
1948         (WebCore::LayerRenderer::updateLayersRecursive):
1949         (WebCore::collect3DPreservingLayers):
1950         (WebCore::LayerRenderer::compositeLayersRecursive):
1951         * platform/graphics/blackberry/LayerRendererSurface.cpp:
1952         (WebCore::LayerRendererSurface::boundingBox):
1953         * platform/graphics/blackberry/LayerRendererSurface.h:
1954         (WebCore::LayerRendererSurface::boundingBox): Renamed from "drawRect" because that sounds like a verb, and this is a getter
1955         * platform/graphics/blackberry/LayerWebKitThread.h:
1956         (WebCore::LayerWebKitThread::sublayers): Removed "get" prefix
1957         * platform/graphics/blackberry/VideoLayerWebKitThread.cpp:
1958         (WebCore::VideoLayerWebKitThread::setHolePunchRect):
1959         (WebCore::VideoLayerWebKitThread::boundsChanged):
1960
1961 2013-05-28  Jer Noble  <jer.noble@apple.com>
1962
1963         Made AudioNode an EventTarget
1964         https://bugs.webkit.org/show_bug.cgi?id=116871
1965
1966         Merge: https://chromium.googlesource.com/chromium/blink/+/ef37484162ddb95d677dcfdcdd778ec60590928b
1967
1968         Reviewed by Darin Adler.
1969
1970         Tests: webaudio/audionode-expected.txt:
1971                webaudio/audionode.html:
1972
1973         Add the requisite boilerplate to allow AudioNode to become an EventTarget. Remove
1974         all that same boilerplate from ScriptProcessorNode now that it's base class
1975         is an EventTarget.
1976
1977         * Modules/webaudio/AudioNode.cpp:
1978         (WebCore::AudioNode::interfaceName): Added boilerplate.
1979         (WebCore::AudioNode::scriptExecutionContext): Return the AudioContext's context.
1980         (WebCore::AudioNode::processIfNecessary): Whitespace.
1981         * Modules/webaudio/AudioNode.h:
1982         * Modules/webaudio/AudioNode.idl: Make AudioNode an EventTarget.
1983         * Modules/webaudio/ScriptProcessorNode.cpp: Remove EventTarget boilerplate.
1984         * Modules/webaudio/ScriptProcessorNode.h: Ditto.
1985         * Modules/webaudio/ScriptProcessorNode.idl: Ditto.
1986         * dom/EventTarget.h: Mark AudioNode as an EventTarget.
1987         * dom/EventTargetFactory.in: Ditto.
1988
1989 2013-05-28  Arvid Nilsson  <anilsson@rim.com>
1990
1991         [BlackBerry] backface-visibility: hidden doesn't work properly with masks and filters
1992         https://bugs.webkit.org/show_bug.cgi?id=116616
1993
1994         Reviewed by Carlos Garcia Campos.
1995
1996         The BlackBerry::Platform::Graphics::GraphicsContext generates geometry
1997         with a different winding order than the accelerated compositing backend
1998         of the BlackBerry port. So, when we switched from Skia to this new
1999         rendering engine, we switched from glFrontFace(GL_CCW) to
2000         glFrontFace(GL_CW), and all was well when drawing display lists.
2001         However, we forgot to update the winding order of geometry generated
2002         within the accelerated compositing backend, which is used for masks and
2003         filters, so they were getting erroneously culled out when
2004         backface-visibility: hidden was applied to them. Fixed by switching the
2005         winding order of all geometry generated up here, which has the added
2006         benefit of enabling us to use TransformationMatrix::mapQuad instead of
2007         transforming point-by-point.
2008
2009         To further complicate matters, a right-side up transform is used when
2010         drawing layers into surfaces, reversing the winding order and requiring
2011         us to switch back to glFrontFace(GL_CCW) temporarily, when drawing
2012         layers to surfaces, or the layers will get culled out inside the
2013         surface.
2014
2015         Also fix spelling error, "drawed" should be "drawn".
2016
2017         No new tests, this is only detectable by pixel tests, which the
2018         BlackBerry port currently doesn't support.
2019
2020         PR 341945.
2021
2022         * platform/graphics/blackberry/EGLImageLayerCompositingThreadClient.cpp:
2023         (WebCore::EGLImageLayerCompositingThreadClient::drawTextures):
2024         * platform/graphics/blackberry/LayerCompositingThread.cpp:
2025         (WebCore::LayerCompositingThread::setDrawTransform):
2026         (WebCore::getTransformedRect):
2027         (WebCore::LayerCompositingThread::drawTextures):
2028         (WebCore::LayerCompositingThread::drawSurface):
2029         * platform/graphics/blackberry/LayerCompositingThread.h:
2030         (LayerCompositingThread):
2031         (WebCore::LayerCompositingThread::origin):
2032         * platform/graphics/blackberry/LayerFilterRenderer.cpp:
2033         (WebCore):
2034         * platform/graphics/blackberry/LayerRenderer.cpp:
2035         (WebCore::LayerRenderer::compositeLayers):
2036         (WebCore):
2037         (WebCore::LayerRenderer::drawLayersOnSurfaces):
2038         * platform/graphics/blackberry/LayerRendererSurface.cpp:
2039         (WebCore::LayerRendererSurface::drawRect):
2040         (WebCore::LayerRendererSurface::transformedBounds):
2041         * platform/graphics/blackberry/LayerRendererSurface.h:
2042         (WebCore::LayerRendererSurface::origin):
2043         (LayerRendererSurface):
2044         * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
2045         (WebCore):
2046         (WebCore::loadBufferingImageData):
2047         (WebCore::MediaPlayerPrivate::drawBufferingAnimation):
2048
2049 2013-05-28  Andreas Kling  <akling@apple.com>
2050
2051         Move Node::dispatchChangeEvent() to HTMLFormControlElement.
2052         <http://webkit.org/b/116866>
2053
2054         Reviewed by Anders Carlsson.
2055
2056         ...and devirtualize it, since it had no overrides.
2057
2058         * dom/Node.h:
2059         * dom/Node.cpp:
2060         * html/HTMLFormControlElement.h:
2061         * html/HTMLFormControlElement.cpp:
2062         (WebCore::HTMLFormControlElement::dispatchChangeEvent):
2063         (WebCore::HTMLFormControlElement::dispatchFormControlChangeEvent):
2064         * html/FileInputType.cpp:
2065         (WebCore::FileInputType::setFiles):
2066         * html/HTMLTextFormControlElement.cpp:
2067         (WebCore::HTMLTextFormControlElement::dispatchFormControlChangeEvent):
2068
2069 2013-05-28  Sergio Villar Senin  <svillar@igalia.com>
2070
2071         Refactoring CSS grammar
2072         https://bugs.webkit.org/show_bug.cgi?id=116679
2073
2074         Reviewed by Andreas Kling.
2075
2076         From Blink r149948 by <serya@chromium.org>
2077
2078         Added "closing_parenthesis:" and "error_recovery:" to avoid code
2079         duplication in a couple of error recovery rules. Some other rules
2080         were also refactored which allows to reduce the the number of
2081         shift/reduce conflicts by 2.
2082
2083         No new tests required as this is just a refactoring, no new
2084         functionality added.
2085
2086         * css/CSSGrammar.y.in:
2087
2088 2013-05-28  Sergio Villar Senin  <svillar@igalia.com>
2089
2090         Invalid block doesn't make declaration invalid
2091         https://bugs.webkit.org/show_bug.cgi?id=115709
2092
2093         Reviewed by Andreas Kling.
2094
2095         From Blink r149446 by <serya@chromium.org>
2096
2097         Added a new rule "declaration_recovery:" which covers any kind of
2098         "invalid_block_list maybe_space" sequence. By appending this new
2099         rule to every rule reductable to "declaration:" we can remove some
2100         redundant rules and improve error recovery of some others that
2101         were only accepting exactly one error.
2102
2103         One of the rules being removed was preventing invalid blocks in a
2104         declaration to invalidate the whole declaration. The rule was
2105         reporting the syntax error but at the same time accepting the
2106         invalid block as part of a valid declaration.
2107
2108         * css/CSSGrammar.y.in:
2109
2110 2013-05-28  Andreas Kling  <akling@apple.com>
2111
2112         Move dispatching of focus-related events from Node to Element.
2113         <http://webkit.org/b/116864>
2114
2115         Reviewed by Antti Koivisto.
2116
2117         ...and pass around pointers to Element instead of Node.
2118
2119         * dom/Node.cpp:
2120         * dom/Node.h:
2121         * dom/Element.h:
2122         * dom/Element.cpp:
2123         (WebCore::Element::dispatchFocusInEvent):
2124         (WebCore::Element::dispatchFocusOutEvent):
2125         (WebCore::Element::dispatchFocusEvent):
2126         (WebCore::Element::dispatchBlurEvent):
2127
2128             Moved here from Node.
2129
2130         * html/HTMLFormControlElement.h:
2131         * html/HTMLFormControlElement.cpp:
2132         (WebCore::HTMLFormControlElement::dispatchBlurEvent):
2133         * html/HTMLSelectElement.h:
2134         * html/HTMLSelectElement.cpp:
2135         (WebCore::HTMLSelectElement::dispatchFocusEvent):
2136         (WebCore::HTMLSelectElement::dispatchBlurEvent):
2137         * html/HTMLTextFormControlElement.h:
2138         * html/HTMLTextFormControlElement.cpp:
2139         (WebCore::HTMLTextFormControlElement::dispatchFocusEvent):
2140         (WebCore::HTMLTextFormControlElement::dispatchBlurEvent):
2141
2142             Update subclass overrides and sprinkle OVERRIDE/FINAL.
2143
2144 2013-05-28  Zan Dobersek  <zdobersek@igalia.com>
2145
2146         Remove CachedResourceRequest::initiatorElement
2147         https://bugs.webkit.org/show_bug.cgi?id=116862
2148
2149         Reviewed by Andreas Kling.
2150
2151         The CachedResourceRequest::initiatorElement method is not used anywhere and should be removed.
2152
2153         * loader/cache/CachedResourceRequest.cpp: Remove the initiatorElement method definition.
2154         * loader/cache/CachedResourceRequest.h:
2155         (CachedResourceRequest): Remove the initiatorElement method declaration.
2156
2157 2013-05-28  Andreas Kling  <akling@apple.com>
2158
2159         Document::setFocusedNode() should be setFocusedElement().
2160         <http://webkit.org/b/116857>
2161
2162         Reviewed by Antti Koivisto.
2163
2164         Only Elements can be focused, so tighten Document's idea of what's focused.
2165
2166         Most of this patch is just updating call sites for the new names and removing
2167         now-unnecessary isElementNode() checks and casts.
2168
2169         * WebCore.exp.in:
2170         * accessibility/AXObjectCache.cpp:
2171         (WebCore::AXObjectCache::focusedUIElementForPage):
2172         * accessibility/AccessibilityNodeObject.cpp:
2173         (WebCore::AccessibilityNodeObject::canSetFocusAttribute):
2174         * accessibility/AccessibilityRenderObject.cpp:
2175         (WebCore::AccessibilityRenderObject::isFocused):
2176         (WebCore::AccessibilityRenderObject::setFocused):
2177         (WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
2178         * bindings/objc/DOM.mm:
2179         (-[DOMElement isFocused]):
2180         * dom/Document.cpp:
2181         (WebCore::Document::dispose):
2182         (WebCore::Document::detach):
2183         (WebCore::Document::focusedNodeRemoved):
2184         (WebCore::Document::removeFocusedNodeOfSubtree):
2185         (WebCore::Document::setFocusedElement):
2186         (WebCore::Document::updateFocusAppearanceTimerFired):
2187         (WebCore::eventTargetNodeForDocument):
2188         * dom/Document.h:
2189         (Document):
2190         (WebCore::Document::focusedElement):
2191         * dom/Element.cpp:
2192         (WebCore::Element::attach):
2193         (WebCore::Element::focus):
2194         (WebCore::Element::blur):
2195         (WebCore::Element::cancelFocusAppearanceUpdate):
2196         * dom/Node.cpp:
2197         (WebCore::Node::rendererIsEditable):
2198         * dom/TreeScope.cpp:
2199         (WebCore::TreeScope::focusedElement):
2200         * dom/UserTypingGestureIndicator.cpp:
2201         (WebCore::UserTypingGestureIndicator::UserTypingGestureIndicator):
2202         * editing/Editor.cpp:
2203         (WebCore::Editor::setBaseWritingDirection):
2204         (WebCore::Editor::setComposition):
2205         (WebCore::Editor::guessesForMisspelledOrUngrammatical):
2206         * editing/EditorCommand.cpp:
2207         (WebCore::verticalScrollDistance):
2208         * editing/FrameSelection.cpp:
2209         (WebCore::FrameSelection::selectAll):
2210         (WebCore::FrameSelection::focusedOrActiveStateChanged):
2211         (WebCore::FrameSelection::setFocusedElementIfNeeded):
2212         (WebCore::FrameSelection::currentForm):
2213         * history/CachedPage.cpp:
2214         (WebCore::CachedPage::restore):
2215         * html/HTMLInputElement.cpp:
2216         (WebCore::HTMLInputElement::updateType):
2217         (WebCore::HTMLInputElement::attach):
2218         * html/HTMLTextAreaElement.cpp:
2219         (WebCore::HTMLTextAreaElement::setValueCommon):
2220         * html/HTMLTextFormControlElement.cpp:
2221         (WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible):
2222         (WebCore::HTMLTextFormControlElement::selectionStart):
2223         (WebCore::HTMLTextFormControlElement::selectionEnd):
2224         (WebCore::HTMLTextFormControlElement::selectionDirection):
2225         * html/RadioInputType.cpp:
2226         (WebCore::RadioInputType::handleKeydownEvent):
2227         (WebCore::RadioInputType::isKeyboardFocusable):
2228         * html/shadow/DateTimeEditElement.cpp:
2229         (WebCore::DateTimeEditElement::focusedFieldIndex):
2230         * loader/FrameLoader.cpp:
2231         (WebCore::FrameLoader::stopLoading):
2232         * page/DOMWindow.cpp:
2233         (WebCore::DOMWindow::focus):
2234         * page/EventHandler.cpp:
2235         (WebCore::EventHandler::scrollOverflow):
2236         (WebCore::EventHandler::logicalScrollOverflow):
2237         (WebCore::EventHandler::dispatchMouseEvent):
2238         (WebCore::EventHandler::sendContextMenuEventForKey):
2239         (WebCore::EventHandler::capsLockStateMayHaveChanged):
2240         * page/FocusController.cpp:
2241         (WebCore::dispatchEventsOnWindowAndFocusedNode):
2242         (WebCore::FocusController::advanceFocusInDocumentOrder):
2243         (WebCore::FocusController::setFocusedElement):
2244         (WebCore::FocusController::findFocusCandidateInContainer):
2245         (WebCore::FocusController::advanceFocusDirectionallyInContainer):
2246         (WebCore::FocusController::advanceFocusDirectionally):
2247         * page/FrameView.cpp:
2248         (WebCore::FrameView::scrollToAnchor):
2249         * plugins/PluginView.cpp:
2250         (WebCore::PluginView::focusPluginElement):
2251         * plugins/efl/PluginViewEfl.cpp:
2252         (WebCore::PluginView::setFocus):
2253         * plugins/mac/PluginViewMac.mm:
2254         (WebCore::PluginView::platformStart):
2255         * rendering/RenderImage.cpp:
2256         (WebCore::RenderImage::paintAreaElementFocusRing):
2257         * rendering/RenderListBox.cpp:
2258         (WebCore::RenderListBox::paintItemForeground):
2259         (WebCore::RenderListBox::paintItemBackground):
2260         * rendering/RenderTextControlSingleLine.cpp:
2261         (WebCore::RenderTextControlSingleLine::capsLockStateMayHaveChanged):
2262         (WebCore::RenderTextControlSingleLine::textShouldBeTruncated):
2263         * rendering/RenderTheme.cpp:
2264         (WebCore::RenderTheme::isFocused):
2265
2266 2013-05-28  Sergio Villar Senin  <svillar@igalia.com>
2267
2268         Web Inspector: Enable CSS logging
2269         https://bugs.webkit.org/show_bug.cgi?id=113401
2270
2271         Reviewed by Benjamin Poulain.
2272
2273         From Blink r149265 by <serya@chromium.org>
2274
2275         CSS logging was disabled in r147028 to prevent message overflow in
2276         the inspector console. This change restores it by modifying the
2277         CSS grammar in order to reduce as much consecutive errors as
2278         possible in 'declaration_list' and 'decl_list' rules.
2279
2280         This way, for rules like 'x { color: ### }' only the first '#'
2281         will be reported as error (instead of 3 identical errors).
2282
2283         The rule 'declaration' still produces multiple errors, because it
2284         does not eat as much errors as possible. So in order not to create
2285         a complex risky patch we just disable logging in the parser for
2286         that rule.
2287
2288         * css/CSSGrammar.y.in:
2289         * css/CSSParser.cpp:
2290         (WebCore::CSSParser::CSSParser):
2291         (WebCore::CSSParser::parseSheet):
2292         (WebCore::CSSParser::syntaxError):
2293         (WebCore::CSSParser::isLoggingErrors):
2294         (WebCore::CSSParser::rewriteSpecifiers):
2295         * css/CSSParser.h:
2296         (CSSParser):
2297
2298 2013-05-27  Patrick Gansterer  <paroga@webkit.org>
2299
2300         Build fix for WinCE after r150730.
2301
2302         * platform/graphics/FontFallbackList.cpp:
2303         (WebCore::FontGlyphs::glyphDataAndPageForCharacter):
2304
2305 2013-05-27  Patrick Gansterer  <paroga@webkit.org>
2306
2307         Build fix for WinCE after r150772.
2308
2309         * platform/win/ClipboardWin.cpp:
2310         (WebCore):
2311         * platform/win/PasteboardWin.cpp:
2312         (WebCore::Pasteboard::readFilenames):
2313         (WebCore):
2314
2315 2013-05-27  Darin Adler  <darin@apple.com>
2316
2317         Fix build.
2318
2319         * html/HTMLAnchorElement.cpp:
2320         (WebCore::hasNonEmptyBox): Fix typo.
2321
2322 2013-05-27  Darin Adler  <darin@apple.com>
2323
2324         Move hasNonEmptyBoundingBox from Node to HTMLAnchorElement
2325         https://bugs.webkit.org/show_bug.cgi?id=116842
2326
2327         Reviewed by Antti Koivisto.
2328
2329         * dom/Node.cpp: Removed hasNonEmptyBoundingBox.
2330         * dom/Node.h: Ditto.
2331
2332         * html/HTMLAnchorElement.cpp:
2333         (WebCore::HTMLAnchorElement::isMouseFocusable): Fixed #if to be more readable and
2334         added more-explicit clearer comments. No behavior change.
2335         (WebCore::hasNonEmptyBox): Added.  Has the same code that was in
2336         Node::hasNonEmptyBoundingBox with some additional comments.
2337         (WebCore::HTMLAnchorElement::isKeyboardFocusable): Call hasNonEmptyBox.
2338
2339 2013-05-27  Darin Adler  <darin@apple.com>
2340
2341         Move isBlockFlowElement and related functions out of the Node class into editing code
2342         https://bugs.webkit.org/show_bug.cgi?id=116846
2343
2344         Reviewed by Antti Koivisto.
2345
2346         * dom/Node.cpp: Removed isBlockFlowElement, enclosingBlockFlowElement, and
2347         inSameContainingBlockFlowElement. These are all editing functions that don't
2348         belong in the Node class, and mostly-deprecated ones to boot.
2349         * dom/Node.h: Ditto.
2350
2351         * dom/Position.cpp:
2352         (WebCore::inSameEnclosingBlockFlowElement): Added. This editing-specific function
2353         is used only here, so put it here.
2354         (WebCore::Position::rendersInDifferentPosition): Updated to call new function above.
2355         (WebCore::Position::leadingWhitespacePosition): Ditto.
2356
2357         * editing/InsertLineBreakCommand.cpp:
2358         (WebCore::InsertLineBreakCommand::insertNodeAfterPosition): Use
2359         deprecatedEnclosingBlockFlowElement at its new location.
2360         (WebCore::InsertLineBreakCommand::insertNodeBeforePosition): Ditto.
2361
2362         * editing/InsertListCommand.cpp:
2363         (WebCore::InsertListCommand::doApplyForSingleParagraph): use
2364         isBlockFlowElement at its new location.
2365         * editing/ReplaceSelectionCommand.cpp:
2366         (WebCore::enclosingInline): Ditto.
2367
2368         * editing/VisiblePosition.cpp:
2369         (WebCore::VisiblePosition::canonicalPosition): Use deprecatedEnclosingBlockFlowElement
2370         at its new location.
2371         (WebCore::enclosingBlockFlowElement): Ditto. Also added FIXME.
2372         * editing/VisibleSelection.cpp:
2373         (WebCore::makeSearchRange): Ditto.
2374
2375         * editing/htmlediting.cpp:
2376         (WebCore::isBlockFlowElement): Added. Same as the Node::isBlockFlowElement
2377         function, but here because this is an editing function, not suitable as a Node member.
2378         (WebCore::deprecatedEnclosingBlockFlowElement): Ditto. Added "deprecated" to the name
2379         since the Node member function had a comment saying it was deprecated. Also changed so
2380         it tolerates a 0 for an argument, which made it easier for one caller.
2381
2382         * editing/htmlediting.h: Added the two new functions.
2383
2384 2013-05-27  Seokju Kwon  <seokju.kwon@gmail.com>
2385
2386         Add guard around paintForFixedRootBackground
2387         https://bugs.webkit.org/show_bug.cgi?id=116754
2388
2389         Reviewed by Simon Fraser.
2390
2391         paintForFixedRootBackground is only used when ACCELERATED_COMPOSITING is enabled.
2392
2393         No new tests, no behavior change.
2394
2395         * rendering/RenderLayer.cpp:
2396         (WebCore):
2397
2398 2013-05-27  Seokju Kwon  <seokju.kwon@gmail.com>
2399
2400         Remove a leftover Pagepoup from PickerIndicatorElement.h
2401         https://bugs.webkit.org/show_bug.cgi?id=116801
2402
2403         Reviewed by Anders Carlsson.
2404
2405         No new tests, no behavior change.
2406
2407         * html/shadow/PickerIndicatorElement.h:
2408         (WebCore):
2409
2410 2013-05-27  Claudio Saavedra  <csaavedra@igalia.com>
2411
2412         [CSS] -webkit-var prefix is case-sensitive
2413         https://bugs.webkit.org/show_bug.cgi?id=116829
2414
2415         Reviewed by Darin Adler.
2416
2417         Tests: Added case to fast/css/variables/case-sensitive.html
2418
2419         * css/CSSParser.cpp:
2420         (WebCore::isEqualToCSSCaseSensitiveIdentifier): Add variant to
2421         IsEqualToCSSIdentifier that respects case-sensitivity.
2422         (WebCore::CSSParser::realLex): Use the above method for CSS
2423         variable declarations.
2424
2425 2013-05-27  Zalan Bujtas  <zalan@apple.com>
2426
2427         drop-shadow filter with overflow:hidden child misbehaves.
2428         https://bugs.webkit.org/show_bug.cgi?id=109783
2429
2430         Reviewed by Simon Fraser.
2431
2432         Applying CSS filters only to the scrollbar rect leaves rendering
2433         artefacts. Filters should skip such partial repaints.
2434
2435         Tests: Test framework uses mock theme for scrollbars. Such scrollbars do not
2436         initiate partial repaints.
2437
2438         * rendering/RenderLayer.cpp:
2439         (WebCore::RenderLayer::setupFilters):
2440         (WebCore::RenderLayer::paintLayerContents):
2441         * rendering/RenderLayer.h:
2442         (RenderLayer):
2443
2444 2013-05-27  Xueqing Huang  <huangxueqing@baidu.com>
2445
2446         Move Windows port off legacy clipboard.
2447         https://bugs.webkit.org/show_bug.cgi?id=116258
2448
2449         Reviewed by Darin Adler.
2450
2451         Clipboard refactor, no new tests.
2452
2453         * dom/Clipboard.h:
2454         * page/win/EventHandlerWin.cpp:
2455         (WebCore::EventHandler::createDraggingClipboard): Create Clipboard instead of ClipboardWin.
2456         * platform/Pasteboard.h:
2457         (WebCore::Pasteboard::dataObject): Get IDataObject by Clipborad.
2458         (WebCore::Pasteboard::writableDataObject): Get WCDataObject by Clipborad.
2459         * platform/win/ClipboardWin.cpp:
2460         (WebCore::Clipboard::createDragImage): Change parameter name loc to dragLocation.
2461         (WebCore::Clipboard::declareAndWriteDragImage): Implement declareAndWriteDragImage use WCDataObject exposed by Pasteboard.
2462         * platform/win/ClipboardWin.h: Removed.
2463         * platform/win/EditorWin.cpp:
2464         (WebCore::Editor::newGeneralClipboard): Create Clipboard instead of ClipboardWin.
2465         * platform/win/PasteboardWin.cpp:
2466         (WebCore::Pasteboard::createForCopyAndPaste): Create a Pasteboard.
2467         (WebCore::Pasteboard::createPrivate): Ditto.
2468         (WebCore::Pasteboard::createForDragAndDrop): Ditto.
2469         (WebCore::Pasteboard::finishCreatingPasteboard): Create Pasteboard use Windows API.
2470         (WebCore::Pasteboard::Pasteboard):
2471         (WebCore::clipboardTypeFromMIMEType): Copied from ClipboardWin.cpp.
2472         (WebCore::Pasteboard::clear): Ditto.
2473         (WebCore::Pasteboard::hasData): Ditto.
2474         (WebCore::addMimeTypesForFormat): Ditto.
2475         (WebCore::Pasteboard::types): Ditto.
2476         (WebCore::Pasteboard::readString): Ditto.
2477         (WebCore::Pasteboard::readFilenames): Ditto.
2478         (WebCore::writeURL): Ditto.
2479         (WebCore::Pasteboard::writeString): Ditto.
2480         (WebCore::Pasteboard::setDragImage): Ditto.
2481         (WebCore::Pasteboard::writeRangeToDataObject): Write range to WCDataObject.
2482         (WebCore::Pasteboard::writeSelection):
2483         (WebCore::Pasteboard::writePlainTextToDataObject): Write PlainText to WCDataObject.
2484         (WebCore::Pasteboard::writePlainText):
2485         (WebCore::pathRemoveBadFSCharacters): Copied from ClipboardWin.cpp.
2486         (WebCore::filesystemPathFromUrlOrTitle): Ditto.
2487         (WebCore::writeFileToDataObject): Ditto.
2488         (WebCore::Pasteboard::writeURLToDataObject): Write URL to WCDataObject.
2489         (WebCore::Pasteboard::writeURL): Copied from ClipboardWin.cpp.
2490         (WebCore::Pasteboard::writePasteboard): Copied from Pasteboard::writeClipboard.
2491         (WebCore::Pasteboard::documentFragment): Copied from ClipboardWin.cpp.
2492         (WebCore::Pasteboard::setExternalDataObject): Clipboard can set new IDataObject.
2493         (WebCore::getCachedImage): Copied from ClipboardWin.cpp.
2494         (WebCore::createGlobalImageFileDescriptor): Ditto.
2495         (WebCore::createGlobalImageFileContent): Ditto.
2496         (WebCore::createGlobalHDropContent): Ditto.
2497         (WebCore::Pasteboard::writeImageToDataObject): Expose to make Clipboard implement declareAndWriteDragImage.
2498         (WebCore::Pasteboard::writeURLToWritableDataObject): Ditto.
2499
2500 2013-05-27  Tim Horton  <timothy_horton@apple.com>
2501
2502         PDFPlugin: Main-frame PDFPlugin Accessibility
2503         https://bugs.webkit.org/show_bug.cgi?id=116563
2504         <rdar://problem/13458534>
2505
2506         Reviewed by Sam Weinig.
2507
2508         * WebCore.exp.in: Export AffineTransform::mapRect.
2509
2510 2013-05-27  Tiancheng Jiang  <tijiang@rim.com>
2511
2512         Checkbox UX update.
2513         https://bugs.webkit.org/show_bug.cgi?id=116838.
2514
2515         Reviewed by Rob Buis.
2516
2517         BlackBerry PR 342302.
2518         Internally Reviewed by Jeff Rogers.
2519         Remove old background and change pressed checkmark image.
2520
2521         * platform/blackberry/RenderThemeBlackBerry.cpp:
2522         (WebCore::RenderThemeBlackBerry::paintCheckbox):
2523
2524 2013-05-27  Sam Weinig  <sam@webkit.org>
2525
2526         When the background is completely transparent we should be conservative and use the default scrollbar style, not the light one
2527         https://bugs.webkit.org/show_bug.cgi?id=116836
2528         <rdar://problem/13949905>
2529
2530         Reviewed by Simon Fraser.
2531
2532         * page/FrameView.cpp:
2533         (WebCore::FrameView::recalculateScrollbarOverlayStyle):
2534         Don't use the light style when the background is completely transparent.
2535
2536 2013-05-27  Patrick Gansterer  <paroga@webkit.org>
2537
2538         Use ICU_INCLUDE_DIRS in BlackBerry CMake files
2539         https://bugs.webkit.org/show_bug.cgi?id=116210
2540
2541         Reviewed by Rob Buis.
2542
2543         Set and use the ICU_INCLUDE_DIRS variable to avoid
2544         duplicated adding of the ICU include directory.
2545
2546         * PlatformBlackBerry.cmake:
2547
2548 2013-05-27  Antti Koivisto  <antti@apple.com>
2549
2550         Tighten FontGlyphs::glyphDataAndPageForCharacter to take FontDescription
2551         https://bugs.webkit.org/show_bug.cgi?id=116823
2552
2553         Reviewed by Andreas Kling.
2554
2555         FontGlyphs does not need to know about Font anymore.
2556
2557         * platform/graphics/Font.cpp:
2558         (WebCore::Font::Font):
2559         (WebCore::Font::operator=):
2560         * platform/graphics/Font.h:
2561         (WebCore::Font::isPlatformFont):
2562         (WebCore::Font::glyphDataAndPageForCharacter):
2563         (Font):
2564         * platform/graphics/FontCache.h:
2565         * platform/graphics/FontFallbackList.cpp:
2566         (WebCore::FontGlyphs::FontGlyphs):
2567         (WebCore::FontGlyphs::glyphDataAndPageForCharacter):
2568         * platform/graphics/FontFallbackList.h:
2569         (WebCore):
2570         (WebCore::FontGlyphs::createForPlatformFont):
2571         
2572             Tweaked the name.
2573
2574         (WebCore::FontGlyphs::isForPlatformFont):
2575         
2576             Move knowledge about platform font to FontGlyphs as it is needed for resolving system fallback on Mac.
2577
2578         * platform/graphics/blackberry/FontCacheBlackBerry.cpp:
2579         (WebCore::FontCache::systemFallbackForCharacters):
2580         * platform/graphics/freetype/FontCacheFreeType.cpp:
2581         (WebCore::FontCache::systemFallbackForCharacters):
2582         * platform/graphics/mac/FontCacheMac.mm:
2583         (WebCore::FontCache::systemFallbackForCharacters):
2584         * platform/graphics/qt/FontCacheQt.cpp:
2585         (WebCore::FontCache::systemFallbackForCharacters):
2586         * platform/graphics/win/FontCacheWin.cpp:
2587         (WebCore::FontCache::systemFallbackForCharacters):
2588         * platform/graphics/wince/FontCacheWinCE.cpp:
2589         (WebCore::FontCache::systemFallbackForCharacters):
2590         
2591             More descriptive name and tighter interface.
2592
2593 2013-05-27  Mihnea Ovidenie  <mihnea@adobe.com>
2594
2595         [CSSRegions] Prevent unnecessary copy of LayoutRect objects
2596         https://bugs.webkit.org/show_bug.cgi?id=116828
2597
2598         Reviewed by Andreas Kling.
2599
2600         Use const references for parameter passing.
2601         No functional change, no new tests.
2602
2603         * rendering/RenderFlowThread.cpp:
2604         (WebCore::RenderFlowThread::paintFlowThreadPortionInRegion):
2605         (WebCore::RenderFlowThread::hitTestFlowThreadPortionInRegion):
2606         * rendering/RenderFlowThread.h:
2607         * rendering/RenderRegion.cpp:
2608         (WebCore::RenderRegion::overflowRectForFlowThreadPortion):
2609         * rendering/RenderRegion.h:
2610
2611 2013-05-27  Leo Yang  <leoyang@rim.com>
2612
2613         [BlackBerry] Reveal HTTP error code for XHR even if there is no response body
2614         https://bugs.webkit.org/show_bug.cgi?id=116543
2615
2616         Reviewed by Rob Buis.
2617         Reviewed internally by Joe Mason.
2618
2619         It's a regression introduced by r132556.
2620         BlackBerry is doing friendly HTTP error handling: if there is no response body
2621         for an HTTP error it will display an error message made by the port. But for a
2622         XHR request, which usually does not result in displaying error messages to the
2623         end user, HTTP error code should be revealed to let the JavaScript know what
2624         the actual server error code is.
2625
2626         Covered by existing tests:
2627         ManualTests/blackberry/head-xhr-nonexistant-file.html
2628         LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-check-head-readystate-for-404.html
2629         LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-check-get-readystate-for-404-without-body.html
2630
2631         * platform/network/blackberry/NetworkJob.cpp:
2632         (WebCore::NetworkJob::shouldNotifyClientFailed):
2633
2634 2013-05-27  Tiancheng Jiang  <tijiang@rim.com>
2635
2636         Adjust date input width.
2637         https://bugs.webkit.org/show_bug.cgi?id=100760.
2638
2639         Reviewed by Rob Buis.
2640
2641         BlackBerry PR 343497.
2642         Internally Reviewed by Jeff Rogers.
2643
2644         Set width to auto to fit the string length.
2645
2646         * css/themeBlackBerry.css:
2647         (input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="time"], input[type="month"]):
2648
2649 2013-05-27  Andreas Kling  <akling@apple.com>
2650
2651         Document::setHoveredNode() should be setHoveredElement().
2652         <http://webkit.org/b/116819>
2653
2654         Reviewed by Antti Koivisto.
2655
2656         Only Elements can be hovered, teach Document about this.
2657
2658         * dom/Document.h:
2659         * dom/Document.cpp:
2660         (WebCore::Document::dispose):
2661         (WebCore::Document::detach):
2662
2663             m_hoverNode => m_hoveredElement.
2664             Removed hoverNode() and setHoverNode() since those were only used internally.
2665
2666         (WebCore::Document::updateHoverActiveState):
2667
2668             Updated for hovered things always being Elements.
2669
2670         (WebCore::Document::hoveredElementDidDetach):
2671         * dom/Element.cpp:
2672         (WebCore::Element::detach):
2673
2674             Renamed Document::hoveredNodeDetached() to hoveredElementDidDetach() and fix it up
2675             following the same pattern as elementInActiveChainDidDetach().
2676
2677 2013-05-27  Allan Sandfeld Jensen  <allan.jensen@digia.com>
2678
2679         [Qt] REGRESSION(r150716): It made 15 inspector and 1 mozilla test to assert
2680         https://bugs.webkit.org/show_bug.cgi?id=116822
2681
2682         Reviewed by Andreas Kling.
2683
2684         The input fontDescription may have more than one family defined.
2685
2686         * platform/qt/RenderThemeQStyle.cpp:
2687         (WebCore::RenderThemeQStyle::adjustButtonStyle):
2688
2689 2013-05-27  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
2690
2691         [Qt][Win] Input events aren't mapped properly with windowless plugins.
2692         https://bugs.webkit.org/show_bug.cgi?id=116094
2693
2694         Reviewed by Tor Arne Vestbø.
2695
2696         The events are first sent properly but Flash then immediately repaints
2697         and this causes flickering painting.
2698         The issue is that Flash seems to be doing some input event tracking of
2699         its own internally, using the HWND returned through NPN_GetValue(NPNVnetscapeWindow).
2700
2701         We are currently using two coordinate systems for windowless plugins on Windows with Qt:
2702         - FrameView coordinates: Used for input events and ajusted with the WM_WINDOWPOSCHANGED message
2703         - Drawable coordinates: Used by WM_PAINT and adjusted with NPP_SetWindow
2704
2705         This patch fixes the bug by mapping input events to the native window returned
2706         as NPNVnetscapeWindow instead of the FrameView to ensure that those coordinates will match
2707         the ones used by Flash internally.
2708         With this we shouldn't be using FrameView coordinates anywhere for windowless plugins
2709         on Windows with Qt.
2710
2711         * platform/qt/QWebPageClient.h:
2712         (QWebPageClient):
2713           Added mapToOwnerWindow to the interface, mapping from the FrameView up to the wrapping nativeParentWidget.
2714         * plugins/win/PluginViewWin.cpp:
2715         (WebCore::contentsToNativeWindow):
2716         (WebCore::PluginView::paintIntoTransformedContext):
2717         (WebCore::PluginView::handleMouseEvent):
2718
2719 2013-05-27  Antti Koivisto  <antti@apple.com>
2720
2721         Tighten FontGlyphs interfaces to take FontDescription instead of Font
2722         https://bugs.webkit.org/show_bug.cgi?id=116818
2723
2724         Reviewed by Andreas Kling.
2725
2726         This gives better understanding of what the actual inputs are.
2727
2728         * WebCore.exp.in:
2729         * platform/graphics/Font.h:
2730         (WebCore::Font::primaryFont):
2731         (WebCore::Font::fontDataAt):
2732         (WebCore::Font::isFixedPitch):
2733         * platform/graphics/FontCache.cpp:
2734         (WebCore::FontCache::getFontData):
2735         * platform/graphics/FontCache.h:
2736         * platform/graphics/FontFallbackList.cpp:
2737         (WebCore::FontGlyphs::determinePitch):
2738         (WebCore::FontGlyphs::realizeFontDataAt):
2739         (WebCore::FontGlyphs::glyphDataAndPageForCharacter):
2740         * platform/graphics/FontFallbackList.h:
2741         (WebCore::FontGlyphs::primaryFontData):
2742         (WebCore::FontGlyphs::isFixedPitch):
2743         (WebCore::FontGlyphs::primarySimpleFontData):
2744         * platform/graphics/blackberry/FontCacheBlackBerry.cpp:
2745         * platform/graphics/freetype/FontCacheFreeType.cpp:
2746         * platform/graphics/mac/FontCacheMac.mm:
2747         (WebCore::FontCache::similarFontPlatformData):
2748         
2749             Drop get* naming and make this Mac only as no other platform has it.
2750
2751         * platform/graphics/qt/FontCacheQt.cpp:
2752         * platform/graphics/win/FontCacheWin.cpp:
2753         * platform/graphics/wince/FontCacheWinCE.cpp:
2754         (WebCore):
2755
2756 2013-05-27  Andreas Kling  <akling@apple.com>
2757
2758         Strengthen typing of detaching an Element from Document's :active chain.
2759         <http://webkit.org/b/116815>
2760
2761         Reviewed by Antti Koivisto.
2762
2763         Tiny cleanup now that the :active chain can only contain elements.
2764         Rename Document::activeChainNodeDetached() to elementInActiveChainDidDetach().
2765
2766         * dom/Element.cpp:
2767         (WebCore::Element::detach):
2768         * dom/Document.h:
2769         * dom/Document.cpp:
2770         (WebCore::Document::elementInActiveChainDidDetach):
2771
2772             Rename, take Element*, remove silly condition that was always true.
2773
2774 2013-05-27  Andrei Bucur  <abucur@adobe.com>
2775
2776         [CSS Regions] Remove the offsetFromLogicalTopOfFirstPage parameter from layout functions
2777         https://bugs.webkit.org/show_bug.cgi?id=116441
2778
2779         Reviewed by David Hyatt.
2780
2781         The patch changes the following things:
2782         - exposes offsetFromLogicalTopOfFirstPage() to all the RenderBoxes;
2783         - offsetFromLogicalTopOfFirstPage() is now safe to call from any box inside a flow thread, not only the
2784         currently being laid out;
2785         - removes the offsetFromLogicalTopOfFirstPage parameter from all the layout functions
2786         that didn't actually required it; when the value is necessary, the offsetFromLogicalTopOfFirstPage
2787         function is called instead;
2788         - RenderFlowThread now handles its own logic for obtaining the offset from logical top of the first
2789         region for a box, based on the layout states pushed on RenderView; it provides a better caching mechanism
2790         that can be used for all the ancestor containing blocks of the current box being laid out.
2791
2792         The RenderBoxRegionInfo structures are cached only based on the box and the region. This means that
2793         passing around a value for offsetFromLogicalTopOfFirstPage different in some cases than others was
2794         risky. If there is a possibility of having a different box info result for a different offset
2795         then the cache is not working correctly.
2796
2797         Tests: No function change, no tests.
2798
2799         * rendering/RenderBlock.cpp:
2800         (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
2801         (WebCore::RenderBlock::logicalLeftOffsetForContent):
2802         (WebCore::RenderBlock::logicalRightOffsetForContent):
2803         (WebCore::RenderBlock::getClearDelta):
2804         (WebCore::RenderBlock::lineWidthForPaginatedLineChanged):
2805         (WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage):
2806         (WebCore::RenderBlock::logicalWidthChangedInRegions):
2807         * rendering/RenderBlock.h:
2808         (WebCore::RenderBlock::availableLogicalWidthForLine):
2809         (WebCore::RenderBlock::logicalRightOffsetForLine):
2810         (WebCore::RenderBlock::logicalLeftOffsetForLine):
2811         (WebCore::RenderBlock::startOffsetForLine):
2812         (WebCore::RenderBlock::endOffsetForLine):
2813         (WebCore::RenderBlock::availableLogicalWidthForContent):
2814         (WebCore::RenderBlock::startOffsetForContent):
2815         (WebCore::RenderBlock::endOffsetForContent):
2816         (WebCore::RenderBlock::logicalLeftOffsetForContent):
2817         (WebCore::RenderBlock::logicalRightOffsetForContent):
2818         * rendering/RenderBox.cpp:
2819         (WebCore::RenderBox::borderBoxRectInRegion):
2820         (WebCore::RenderBox::constrainLogicalWidthInRegionByMinMax):
2821         (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
2822         (WebCore::RenderBox::containingBlockLogicalWidthForContentInRegion):
2823         (WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):
2824         (WebCore::RenderBox::computeLogicalWidthInRegion):
2825         (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
2826         (WebCore::RenderBox::renderBoxRegionInfo):
2827         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
2828         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
2829         (WebCore::computeInlineStaticDistance):
2830         (WebCore::RenderBox::computePositionedLogicalWidth):
2831         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
2832         (WebCore::RenderBox::computePositionedLogicalHeight):
2833         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
2834         (WebCore::RenderBox::computePositionedLogicalWidthReplaced):
2835         (WebCore::RenderBox::computePositionedLogicalHeightReplaced):
2836         (WebCore::RenderBox::offsetFromLogicalTopOfFirstPage):
2837         * rendering/RenderBox.h:
2838         * rendering/RenderFlexibleBox.cpp:
2839         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
2840         * rendering/RenderFlowThread.cpp:
2841         (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
2842         (WebCore::RenderFlowThread::hasCachedOffsetFromLogicalTopOfFirstRegion):
2843         (WebCore::RenderFlowThread::cachedOffsetFromLogicalTopOfFirstRegion):
2844         (WebCore::RenderFlowThread::setOffsetFromLogicalTopOfFirstRegion):
2845         (WebCore::RenderFlowThread::clearOffsetFromLogicalTopOfFirstRegion):
2846         (WebCore::RenderFlowThread::currentActiveRenderBox):
2847         (WebCore::RenderFlowThread::pushFlowThreadLayoutState):
2848         (WebCore::RenderFlowThread::popFlowThreadLayoutState):
2849         (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion):
2850         (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent):
2851         * rendering/RenderFlowThread.h:
2852         * rendering/RenderTable.cpp:
2853         (WebCore::RenderTable::updateLogicalWidth):
2854         * rendering/RenderView.cpp:
2855         (WebCore::RenderView::pushLayoutState):
2856         (WebCore::RenderView::pushLayoutStateForCurrentFlowThread):
2857         (WebCore::RenderView::popLayoutStateForCurrentFlowThread):
2858         * rendering/RenderView.h:
2859         (WebCore::RenderView::pushLayoutState):
2860         (WebCore::RenderView::popLayoutState):
2861
2862 2013-05-27  Allan Sandfeld Jensen  <allan.jensen@digia.com>
2863
2864         Active DOM objects stopped twice
2865         https://bugs.webkit.org/show_bug.cgi?id=116524
2866
2867         Reviewed by Alexey Proskuryakov.
2868
2869         Only iterate over all active DOM object to stop them once.
2870
2871         To ensure later created active DOM objects are stopped,
2872         suspendActiveDOMObjectIfNeeded now also stops active DOM objects
2873         if needed. This also fixes an existing bug when active DOM
2874         objects were created after stopActiveDOMObjects had been called.
2875
2876         Two existing tests creates new active DOM objects after stopActiveDOMObjects
2877         has been called:
2878             fast/dom/xmlhttprequest-constructor-in-detached-document.html
2879             fast/dom/Window/timer-null-script-execution-context.html
2880
2881         * dom/ScriptExecutionContext.cpp:
2882         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
2883         (WebCore::ScriptExecutionContext::suspendActiveDOMObjectIfNeeded):
2884
2885 2013-05-27  Charles Wei  <charles.wei@torchmobile.com.cn>
2886
2887         Remove redundant CachedRawResource::loader()
2888         https://bugs.webkit.org/show_bug.cgi?id=116805
2889
2890         Reviewed by Andreas Kling.
2891
2892         Just remove redundant code, no test case needed.
2893
2894         * loader/cache/CachedRawResource.cpp:
2895         * loader/cache/CachedRawResource.h:
2896
2897 2013-05-27  Andreas Kling  <akling@apple.com>
2898
2899         WinCE build TLC: Node::active() moved to Element.
2900
2901         * rendering/RenderThemeWinCE.cpp:
2902         (WebCore::RenderThemeWinCE::paintSearchFieldCancelButton):
2903
2904 2013-05-26  Jaehun Lim  <ljaehun.lim@samsung.com>
2905
2906         CSSParser::parseImageResolution doesn't need a parameter.
2907         https://bugs.webkit.org/show_bug.cgi?id=116755
2908
2909         Reviewed by Darin Adler.
2910
2911         parseImageResolution() can get CSSPraserValueList from m_valueList directly.
2912
2913         No new tests, no behavior change.
2914
2915         * css/CSSParser.cpp:
2916         (WebCore::CSSParser::parseImageResolution):
2917         * css/CSSParser.h:
2918
2919 2013-05-26  Andreas Kling  <akling@apple.com>
2920
2921         Turn TreeScope::focusedNode() into focusedElement().
2922         <http://webkit.org/b/116802>
2923
2924         Reviewed by Darin Adler.
2925
2926         For the hundredth time, only Elements can be focused!
2927
2928         This change mostly reverts r121079 since that made things unnecessarily complicated
2929         just to tweak the behavior of ShadowRoot.activeElement, an API that we don't expose.
2930         Finding a TreeScope's focused element now does a simple walk up the parent chain instead
2931         of running the full Shadow DOM re-targeting algorithm.
2932
2933         (WebCore::TreeScope::focusedElement):
2934
2935             Simplify and return Element* instead of Node*.
2936
2937         * dom/TreeScope.h:
2938         * dom/TreeScope.cpp:
2939         (WebCore::focusedFrameOwnerElement):
2940
2941             Make this return Element* as the name already suggested.
2942
2943         * dom/Document.cpp:
2944         (WebCore::Document::removeFocusedNodeOfSubtree):
2945         * dom/Element.cpp:
2946         (WebCore::Element::blur):
2947         * dom/ShadowRoot.h:
2948         (WebCore::ShadowRoot::activeElement):
2949         * html/HTMLDocument.cpp:
2950         (WebCore::HTMLDocument::activeElement):
2951
2952             Simplified call sites that were paranoid about getting a non-Element focused node.
2953
2954 2013-05-26  Dean Jackson  <dino@apple.com>
2955
2956         Plugins with no src but valid type should not snapshot
2957         https://bugs.webkit.org/show_bug.cgi?id=116799
2958         <rdar://problem/13695911>
2959
2960         Reviewed by Simon Fraser.
2961
2962         There are a few plug-ins around that don't take any source content
2963         via the src attribute, but rather just load the binary based on the
2964         mime-type. In those cases we shouldn't snapshot until we have a
2965         mechanism to do so.
2966
2967         * html/HTMLPlugInImageElement.cpp:
2968         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
2969             Add MIMEType logging, and detect the case of no src but valid type.
2970         * html/HTMLPlugInImageElement.h: Add another SnapshotReason enum for
2971             this special case.
2972
2973 2013-05-26  Antti Koivisto  <antti@apple.com>
2974
2975         Encapsulate FontGlyphs
2976         https://bugs.webkit.org/show_bug.cgi?id=116803
2977
2978         Reviewed by Andreas Kling.
2979
2980         FontGlyphs is unfriending Font. Give it a real class interface and some actual code.
2981
2982         * platform/graphics/Font.cpp:
2983         (WebCore::Font::Font):
2984         * platform/graphics/Font.h:
2985         (WebCore::Font::glyphDataForCharacter):
2986         (WebCore::Font::glyphDataAndPageForCharacter):
2987         * platform/graphics/FontFallbackList.cpp:
2988         (WebCore::FontGlyphs::FontGlyphs):
2989         (WebCore::isInRange):
2990         (WebCore::shouldIgnoreRotation):
2991         (WebCore::glyphDataAndPageForNonCJKCharacterWithGlyphOrientation):
2992         
2993             Helpers from FontFastPath.cpp.
2994
2995         (WebCore::FontGlyphs::glyphDataAndPageForCharacter):
2996         
2997             This is the primary interface. The code moves here from FontFastPath.cpp.
2998
2999         * platform/graphics/FontFallbackList.h:
3000         (WebCore::FontGlyphs::createForPlatformData):
3001         
3002             Remove setPlatformData in favor of constructor.
3003
3004         (WebCore::FontGlyphs::primarySimpleFontData):
3005         * platform/graphics/FontFastPath.cpp:
3006         * platform/graphics/GraphicsContext.h:
3007
3008             Remove a stray function definition also called setPlatformFont().
3009
3010         * rendering/svg/SVGTextRunRenderingContext.cpp:
3011         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
3012
3013 2013-05-26  Seokju Kwon  <seokju.kwon@gmail.com>
3014
3015         Remove a leftover CALENDAR_PICKER from LocaleNone.cpp
3016         https://bugs.webkit.org/show_bug.cgi?id=116800
3017
3018         Reviewed by Kent Tamura.
3019
3020         No new tests, no behavior change.
3021
3022         * platform/text/LocaleNone.cpp:
3023         (LocaleNone):
3024
3025 2013-05-26  Antti Koivisto  <antti@apple.com>
3026
3027         Rename FontFallbackList to FontGlyphs
3028         https://bugs.webkit.org/show_bug.cgi?id=116797
3029
3030         Reviewed by Andreas Kling.
3031
3032         Maybe it was a fallback list once. Nowadays its purpose is to cache realized glyphs and related data.
3033         
3034         File renaming will be done separately.
3035
3036         * WebCore.exp.in:
3037         * platform/graphics/Font.cpp:
3038         (WebCore::Font::Font):
3039         (WebCore::Font::operator=):
3040         (WebCore::Font::operator==):
3041         
3042             Refactored to early return style.
3043
3044         (WebCore::Font::update):
3045         (WebCore::Font::width):
3046         * platform/graphics/Font.h:
3047         (Font):
3048         (WebCore::Font::glyphs):
3049         (WebCore::Font::loadingCustomFonts):
3050         (WebCore::Font::primaryFont):
3051         (WebCore::Font::fontDataAt):
3052         (WebCore::Font::isFixedPitch):
3053         (WebCore::Font::fontSelector):
3054         * platform/graphics/FontCache.h:
3055         (FontCache):
3056         * platform/graphics/FontFallbackList.cpp:
3057         (WebCore::FontGlyphs::FontGlyphs):
3058         (WebCore::FontGlyphs::invalidate):
3059         (WebCore::FontGlyphs::releaseFontData):
3060         (WebCore::FontGlyphs::determinePitch):
3061         (WebCore::FontGlyphs::realizeFontDataAt):
3062         
3063             Renamed for clarity along with m_fontList -> m_realizedFontData.
3064
3065         (WebCore::FontGlyphs::setPlatformFont):
3066         * platform/graphics/FontFallbackList.h:
3067         (FontGlyphs):
3068         (WebCore::FontGlyphs::GlyphPagesStateSaver::GlyphPagesStateSaver):
3069         (WebCore::FontGlyphs::GlyphPagesStateSaver::~GlyphPagesStateSaver):
3070         (GlyphPagesStateSaver):
3071         (WebCore::FontGlyphs::create):
3072         (WebCore::FontGlyphs::~FontGlyphs):
3073         (WebCore::FontGlyphs::primaryFontData):
3074         * platform/graphics/FontFastPath.cpp:
3075         (WebCore::Font::glyphDataAndPageForCharacter):
3076         * rendering/svg/SVGTextRunRenderingContext.cpp:
3077         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
3078
3079 2013-05-26  Kent Tamura  <tkent@chromium.org>
3080
3081         Remove ENABLE_CALENDAR_PICKER
3082         https://bugs.webkit.org/show_bug.cgi?id=116795
3083
3084         Reviewed by Ryosuke Niwa.
3085
3086         This feature was used only by Chromium port.
3087
3088         * Resources/pagepopups/calendarPicker.css: Removed.
3089         * Resources/pagepopups/calendarPicker.js: Removed.
3090         * css/html.css:
3091         * platform/text/LocaleICU.cpp:
3092         (WebCore::LocaleICU::LocaleICU):
3093         (WebCore):
3094         * platform/text/LocaleICU.h:
3095         (LocaleICU):
3096         * platform/text/PlatformLocale.h:
3097         (Locale):
3098         * platform/text/mac/LocaleMac.h:
3099         (LocaleMac):
3100         * platform/text/mac/LocaleMac.mm:
3101         (WebCore::LocaleMac::monthLabels):
3102         * platform/text/win/LocaleWin.cpp:
3103         (WebCore::LocaleWin::LocaleWin):
3104         (WebCore::LocaleWin::monthLabels):
3105         * platform/text/win/LocaleWin.h:
3106         (LocaleWin):
3107
3108 2013-05-26  Andreas Kling  <akling@apple.com>
3109
3110         Move :active chain participation state from Node to Element.
3111         <http://webkit.org/b/116786>
3112
3113         Reviewed by Antti Koivisto.
3114
3115         Only Elements can be in the :active chain so move the logic there from Node.
3116
3117         * dom/Document.cpp:
3118         (WebCore::Document::updateHoverActiveState):
3119
3120             Add isElementNode() type checks when updating the :active chain.
3121
3122         * dom/Node.h:
3123         * dom/Node.cpp:
3124         (WebCore::Node::detach):
3125         * dom/Element.cpp:
3126         (WebCore::Element::detach):
3127
3128             Move the remaining logic for detaching from the UserActionElementSet to Element.
3129
3130         (WebCore::Element::isUserActionElementInActiveChain):
3131         * dom/Element.h:
3132         (WebCore::Element::inActiveChain):
3133
3134             Move all the :active chain stuff from Node to Element.
3135
3136         * dom/UserActionElementSet.cpp:
3137         (WebCore::UserActionElementSet::didDetach):
3138         * dom/UserActionElementSet.h:
3139         (WebCore::UserActionElementSet::isInActiveChain):
3140         (WebCore::UserActionElementSet::setInActiveChain):
3141
3142             UserActionElementSet now only takes Element* in its API.
3143
3144 2013-05-26  Antti Koivisto  <antti@apple.com>
3145
3146         Remove FontFamily.h/.cpp
3147         https://bugs.webkit.org/show_bug.cgi?id=116788
3148
3149         Reviewed by Anders Carlsson.
3150         
3151         Empty files.
3152
3153         * CMakeLists.txt:
3154         * GNUmakefile.list.am:
3155         * Target.pri:
3156         * WebCore.vcproj/WebCore.vcproj:
3157         * WebCore.vcxproj/WebCore.vcxproj:
3158         * WebCore.xcodeproj/project.pbxproj:
3159         * platform/graphics/FontDescription.h:
3160         * platform/graphics/FontFamily.cpp: Removed.
3161         * platform/graphics/FontFamily.h: Removed.
3162
3163 2013-05-26  Antti Koivisto  <antti@apple.com>
3164
3165         Use Vector instead of custom linked list for font families
3166         https://bugs.webkit.org/show_bug.cgi?id=116783
3167
3168         Reviewed by Andreas Kling.
3169
3170         Get rid of FontFamily and SharedFontFamily.
3171
3172         * accessibility/AccessibilityRenderObject.cpp:
3173         (WebCore::AccessibilityRenderObject::hasSameFont):
3174         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
3175         (getAttributeSetForAccessibilityObject):
3176         * css/CSSComputedStyleDeclaration.cpp:
3177         (WebCore::fontFamilyFromStyle):
3178         * css/DeprecatedStyleBuilder.cpp:
3179         (WebCore::ApplyPropertyFontFamily::applyInheritValue):
3180         (WebCore::ApplyPropertyFontFamily::applyInitialValue):
3181         (WebCore::ApplyPropertyFontFamily::applyValue):
3182         * css/StyleResolver.cpp:
3183         (WebCore::StyleResolver::styleForDocument):
3184         (WebCore::StyleResolver::initializeFontStyle):
3185         * html/canvas/CanvasRenderingContext2D.cpp:
3186         (WebCore::CanvasRenderingContext2D::font):
3187         (WebCore::CanvasRenderingContext2D::setFont):
3188         * page/PrintContext.cpp:
3189         (WebCore::PrintContext::pageProperty):
3190         * platform/efl/RenderThemeEfl.cpp:
3191         (WebCore::RenderThemeEfl::systemFont):
3192         * platform/graphics/Font.h:
3193         (WebCore::Font::firstFamily):
3194         (WebCore::Font::familyCount):
3195         (WebCore::Font::familyAt):
3196         * platform/graphics/FontCache.cpp:
3197         (WebCore::FontCache::getFontData):
3198         * platform/graphics/FontDescription.cpp:
3199         (SameSizeAsFontDescription):
3200         * platform/graphics/FontDescription.h:
3201         (WebCore::FontDescription::FontDescription):
3202         (WebCore::FontDescription::familyCount):
3203         (WebCore::FontDescription::firstFamily):
3204         (WebCore::FontDescription::familyAt):
3205         (WebCore::FontDescription::families):
3206         (WebCore::FontDescription::useFixedDefaultSize):
3207         (WebCore::FontDescription::setOneFamily):
3208         (WebCore::FontDescription::setFamilies):
3209         (WebCore::FontDescription::adoptFamilies):
3210         (WebCore::FontDescription::operator==):
3211         * platform/graphics/FontFamily.cpp:
3212         * platform/graphics/FontFamily.h:
3213         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
3214         (PlatformCALayerWinInternal::displayCallback):
3215         * platform/graphics/mac/FontCacheMac.mm:
3216         (WebCore::FontCache::getSimilarFontPlatformData):
3217         * platform/graphics/qt/FontCacheQt.cpp:
3218         (WebCore::FontCache::getLastResortFallbackFont):
3219         * platform/gtk/RenderThemeGtk.cpp:
3220         (WebCore::RenderThemeGtk::systemFont):
3221         * platform/mac/ThemeMac.mm:
3222         (WebCore::ThemeMac::controlFont):
3223         * platform/qt/RenderThemeQStyle.cpp:
3224         (WebCore::RenderThemeQStyle::adjustButtonStyle):
3225         * platform/text/transcoder/FontTranscoder.cpp:
3226         (WebCore::FontTranscoder::converterType):
3227         * platform/win/DragImageWin.cpp:
3228         (WebCore::dragLabelFont):
3229         * rendering/RenderText.cpp:
3230         (WebCore::RenderText::styleDidChange):
3231         * rendering/RenderTextControl.cpp:
3232         (WebCore::RenderTextControl::computeIntrinsicLogicalWidths):
3233         * rendering/RenderTextControlSingleLine.cpp:
3234         (WebCore::RenderTextControlSingleLine::preferredContentLogicalWidth):
3235         * rendering/RenderThemeMac.mm:
3236         (WebCore::RenderThemeMac::systemFont):
3237         (WebCore::RenderThemeMac::setFontFromControlSize):
3238         * rendering/RenderThemeSafari.cpp:
3239         (WebCore::RenderThemeSafari::systemFont):
3240         (WebCore::RenderThemeSafari::setFontFromControlSize):
3241         * rendering/RenderThemeWin.cpp:
3242         (WebCore::fillFontDescription):
3243
3244 2013-05-26  Andreas Kling  <akling@apple.com>
3245
3246         Move "active" state logic from Node to Element.
3247         <http://webkit.org/b/116785>
3248
3249         Reviewed by Antti Koivisto.
3250
3251         Resolve another 7 year old FIXME by merging the "active" state logic from Node and ContainerNode
3252         and moving it all to Element instead.
3253
3254         * dom/UserActionElementSet.h:
3255         (WebCore::UserActionElementSet::isActive):
3256         (WebCore::UserActionElementSet::setActive):
3257         * dom/ContainerNode.cpp:
3258         * dom/ContainerNode.h:
3259         * dom/Node.cpp:
3260         * dom/Node.h:
3261         * dom/Element.h:
3262         (WebCore::Element::active):
3263         * dom/Element.cpp:
3264         (WebCore::Element::isUserActionElementActive):
3265         (WebCore::Element::setActive):
3266
3267             Moved here from Node/ContainerNode.
3268
3269         * accessibility/AccessibilityNodeObject.cpp:
3270         (WebCore::AccessibilityNodeObject::isPressed):
3271         * dom/Document.cpp:
3272         (WebCore::Document::setFocusedNode):
3273         (WebCore::Document::updateHoverActiveState):
3274         * rendering/RenderTheme.cpp:
3275         (WebCore::RenderTheme::isPressed):
3276         (WebCore::RenderTheme::isSpinUpButtonPartPressed):
3277         * rendering/RenderThemeMac.mm:
3278         (WebCore::getMediaUIPartStateFlags):
3279         (WebCore::RenderThemeMac::updatePressedState):
3280         * platform/qt/RenderThemeQt.cpp:
3281         (WebCore::RenderThemeQt::getMediaControlForegroundColor):
3282
3283             Check that the inspected Node is an Element before asking if it's active.
3284
3285         * html/HTMLAnchorElement.cpp:
3286         (WebCore::HTMLAnchorElement::setActive):
3287
3288             Call the right superclass.
3289
3290         * html/HTMLAnchorElement.h:
3291         * html/HTMLLabelElement.h:
3292         * html/shadow/MediaControlElementTypes.h:
3293
3294             Sprinkle OVERRIDE>
3295
3296 2013-05-26  Andreas Kling  <akling@apple.com>
3297
3298         Move Node::dispatchSimulatedClick() to Element.
3299         <http://webkit.org/b/116784>
3300
3301         Reviewed by Antti Koivisto.
3302
3303         Only Elements use the dispatchSimulatedClick() functionality, so move it there.
3304
3305         * dom/Node.cpp:
3306         * dom/Node.h:
3307         * dom/Element.h:
3308         * dom/Element.cpp:
3309         (WebCore::Element::dispatchSimulatedClick):
3310         * dom/EventDispatcher.h:
3311         * dom/EventDispatcher.cpp:
3312         (WebCore::EventDispatcher::dispatchSimulatedClick):
3313
3314 2013-05-26  Andreas Kling  <akling@apple.com>
3315
3316         TreeScope::rootNode() should return a ContainerNode.
3317         <http://webkit.org/b/116782>
3318
3319         Reviewed by Antti Koivisto.
3320
3321         The rootNode() of a TreeScope is always a ContainerNode, so update pointer types to reflect that.
3322         This lets us take advantage of Antti's optimized traversal functions.
3323
3324         * dom/ContainerNode.h:
3325         (WebCore::Node::isTreeScope):
3326         * dom/Document.cpp:
3327         (WebCore::Document::buildAccessKeyMap):
3328         * dom/Node.cpp:
3329         (WebCore::Node::containingShadowRoot):
3330         * dom/Node.h:
3331         * dom/TreeScope.h:
3332         (WebCore::TreeScope::rootNode):
3333         (TreeScope):
3334         * page/FocusController.cpp:
3335         (WebCore::FocusNavigationScope::rootNode):
3336         (WebCore::FocusNavigationScope::owner):
3337         * page/FocusController.h:
3338         (FocusNavigationScope):
3339
3340 2013-05-26  Andreas Kling  <akling@apple.com>
3341
3342         FocusController::setFocusedNode() should be setFocusedElement().
3343         <http://webkit.org/b/116780>
3344
3345         Reviewed by Antti Koivisto.
3346
3347         Only Elements can have focus, so make the public API of FocusController take Element*.
3348
3349         * WebCore.exp.in:
3350         * page/FocusController.h:
3351         * page/FocusController.cpp:
3352         (WebCore::FocusController::setFocusedElement):
3353
3354             Out with the setFocusedNode(), in with the setFocusedElement().
3355
3356         * dom/Element.cpp:
3357         (WebCore::Element::focus):
3358         (WebCore::Element::blur):
3359         * page/EventHandler.cpp:
3360         (WebCore::EventHandler::dispatchMouseEvent):
3361         * plugins/PluginView.cpp:
3362         (WebCore::PluginView::focusPluginElement):
3363         * editing/FrameSelection.cpp:
3364         (WebCore::FrameSelection::setFocusedNodeIfNeeded):
3365
3366             Tweak for FocusController taking Element* instead of Node*.
3367
3368         (WebCore::FrameSelection::setFocusedElementIfNeeded):
3369
3370             Renamed from setFocusedNodeIfNeeded().
3371
3372         * editing/htmlediting.h:
3373         * editing/htmlediting.cpp:
3374         (WebCore::enclosingAnchorElement):
3375
3376             Cleaned up the loop for readability and made it return an Element.
3377
3378 2013-05-26  Andreas Kling  <akling@apple.com>
3379
3380         Move some form control things from Element to HTMLFormControlElement.
3381         <http://webkit.org/b/116779>
3382
3383         Reviewed by Antti Koivisto.
3384
3385         The following methods sit better on HTMLFormControlElement than on Element:
3386
3387             - formControlType()
3388             - wasChangedSinceLastFormControlChangeEvent()
3389             - setChangedSinceLastFormControlChangeEvent()
3390             - dispatchFormControlChangeEvent()
3391
3392         Moved them, and devirtualized as much as possible.
3393
3394         * dom/Document.cpp:
3395         (WebCore::Document::setFocusedNode):
3396
3397             Check if the old focus target is an Element before (possibly) dispatching a change event.
3398
3399         * dom/Element.cpp:
3400         * dom/Element.h:
3401
3402             Removed some stub methods that were only used by HTMLFormControlElement subclasses.
3403
3404         * html/HTMLFormControlElement.cpp:
3405         * html/HTMLFormControlElement.h:
3406         (WebCore::isHTMLFormControlElement):
3407         (WebCore::toHTMLFormControlElement):
3408
3409             Add toHTMLFormControlElement() helper with ASSERT_WITH_SECURITY_IMPLICATION.
3410
3411         * html/HTMLTextFormControlElement.h:
3412
3413             Sprinkle OVERRIDE.
3414
3415 2013-05-25  Andreas Kling  <akling@apple.com>
3416
3417         Move Node::supportsFocus() to Element.
3418         <http://webkit.org/b/116778>
3419
3420         Reviewed by Antti Koivisto.
3421
3422         Node never supports focus, so move supportsFocus() to Element instead.
3423
3424         * dom/Element.h:
3425         * dom/Node.cpp:
3426         * dom/Node.h:
3427
3428             Removed Node::supportsFocus(), it always returned false anyway.
3429
3430         * accessibility/AccessibilityNodeObject.cpp:
3431         (WebCore::AccessibilityNodeObject::canSetFocusAttribute):
3432
3433             Check that the underlying Node is an Element before asking if it supports focus.
3434
3435         * html/HTMLAnchorElement.h:
3436         * html/HTMLAreaElement.h:
3437         * html/HTMLBodyElement.h:
3438         * html/HTMLElement.h:
3439         * html/HTMLFieldSetElement.h:
3440         * html/HTMLFormControlElement.h:
3441         * html/HTMLFrameElementBase.h:
3442         * html/HTMLMediaElement.h:
3443         * html/HTMLOptGroupElement.h:
3444         * html/HTMLOptionElement.h:
3445         * html/HTMLOutputElement.h:
3446         * svg/SVGAElement.h:
3447         * svg/SVGCircleElement.h:
3448         * svg/SVGEllipseElement.h:
3449         * svg/SVGGElement.h:
3450         * svg/SVGImageElement.h:
3451         * svg/SVGLineElement.h:
3452         * svg/SVGPathElement.h:
3453         * svg/SVGPolyElement.h:
3454         * svg/SVGRectElement.h:
3455         * svg/SVGSVGElement.h:
3456         * svg/SVGSwitchElement.h:
3457         * svg/SVGSymbolElement.h:
3458         * svg/SVGTextElement.h:
3459         * svg/SVGUseElement.h:
3460
3461             OVERRIDE ALL THE THINGS!
3462
3463 2013-05-25  Andreas Kling  <akling@apple.com>
3464
3465         Move Node::isFocusable() to Element.
3466         <http://webkit.org/b/116777>
3467
3468         Reviewed by Anders Carlsson.
3469
3470         Nodes cannot be focusable, so move isFocusable() from Node to Element.
3471
3472         * dom/Node.cpp:
3473         * dom/Node.h:
3474         * dom/Element.h:
3475         * dom/Element.cpp:
3476         (WebCore::Element::isFocusable):
3477
3478             Moved here from Node.
3479
3480         * dom/Document.cpp:
3481         (WebCore::Document::setFocusedNode):
3482         * accessibility/AccessibilityNodeObject.cpp:
3483         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
3484
3485             Check that the underlying node is an Element before asking if it's focusable.
3486
3487         * page/FrameView.cpp:
3488         (WebCore::FrameView::scrollToAnchor):
3489
3490             Renamed the 'anchorNode' variable to 'anchorElement' because reasons.
3491
3492         * html/HTMLAreaElement.h:
3493         * html/HTMLFormControlElement.h:
3494         * html/HTMLLabelElement.h:
3495         * html/HTMLOptionElement.h:
3496         * svg/SVGAElement.h:
3497
3498             Sprinkle OVERRIDE.
3499
3500         * html/ValidationMessage.cpp:
3501         (WebCore::ValidationMessage::setMessage):
3502
3503             Update a comment to refer to Element::isFocusable() instead of Node.
3504
3505 2013-05-25  Andreas Kling  <akling@apple.com>
3506
3507         Move Node::tabIndex() to Element.
3508         <http://webkit.org/b/116772>
3509
3510         Reviewed by Ryosuke Niwa.
3511
3512         Since only Elements are keyboard-focusable, it doesn't make sense for Node to have a tabIndex().
3513
3514         * dom/Element.h:
3515         * dom/Node.cpp:
3516         * dom/Node.h:
3517
3518             A Node can't have a tab index, so move tabIndex() to Element.
3519
3520         * page/FocusController.h:
3521         * page/FocusController.cpp:
3522         (WebCore::adjustedTabIndex):
3523         (WebCore::FocusController::findElementWithExactTabIndex):
3524         (WebCore::nextElementWithGreaterTabIndex):
3525         (WebCore::previousElementWithLowerTabIndex):
3526         (WebCore::FocusController::nextFocusableNode):
3527         (WebCore::FocusController::previousFocusableNode):
3528
3529             Make this code deal in Element* when doing tab index stuff. FocusController needs
3530             more Node->Element cleanup, but let's do that separately.
3531
3532         * html/HTMLAnchorElement.h:
3533         * html/HTMLElement.h:
3534         * html/HTMLFormControlElement.h:
3535
3536             Sprinkle OVERRIDE.
3537
3538 2013-05-25  Andreas Kling  <akling@apple.com>
3539
3540         Don't instantiate ChildNodeLists just to get a child count.
3541         <http://webkit.org/b/116776>
3542
3543         Reviewed by Ryosuke Niwa.
3544
3545         Use ContainerNode::childNodeCount() instead of Node::childNodes()->length().
3546
3547         * editing/ApplyStyleCommand.cpp:
3548         (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
3549
3550 2013-05-25  Andreas Kling  <akling@apple.com>
3551
3552         PluginDocument::pluginNode() should be pluginElement() instead.
3553         <http://webkit.org/b/116774>
3554
3555         Reviewed by Anders Carlsson.
3556
3557         Make PluginDocument hand out a HTMLPlugInElement* instead of a Node*.
3558
3559         * dom/Document.cpp:
3560         (WebCore::eventTargetNodeForDocument):
3561         * html/PluginDocument.h:
3562         * html/PluginDocument.cpp:
3563         (WebCore::PluginDocumentParser::createDocumentStructure):
3564         (WebCore::PluginDocument::pluginWidget):
3565         (WebCore::PluginDocument::setPluginElement):
3566         (WebCore::PluginDocument::detach):
3567
3568 2013-05-25  Andreas Kling  <akling@apple.com>
3569
3570         Remove Document::getFocusableNodes().
3571         <http://webkit.org/b/116773>
3572
3573         Reviewed by Joseph Pecoraro.
3574
3575         This was added in r42191 and there are no remaining clients of the API.
3576
3577         * dom/Document.cpp:
3578         * dom/Document.h:
3579         * WebCore.exp.in:
3580
3581 2013-05-25  Andreas Kling  <akling@apple.com>
3582
3583         Move Node::focusDelegate() to Element.
3584         <http://webkit.org/b/116768>
3585
3586         Reviewed by Anders Carlsson.
3587
3588         Only Element can be a focus delegate (it's currently only ever HTMLInputElement actually)
3589         so move Node::focusDelegate() to Element. Sprinkled isElementNode() checks as needed.
3590
3591         * dom/Node.cpp:
3592         * dom/Node.h:
3593         * dom/Element.h:
3594         * dom/Element.cpp:
3595         * html/shadow/SliderThumbElement.cpp:
3596         (WebCore::SliderThumbElement::focusDelegate):
3597         * html/shadow/SliderThumbElement.h:
3598         * rendering/RenderTheme.cpp:
3599         (WebCore::RenderTheme::isFocused):
3600         * rendering/RenderThemeMac.mm:
3601         (WebCore::RenderThemeMac::paintSliderThumb):
3602
3603 2013-05-25  Alberto Garcia  <agarcia@igalia.com>
3604
3605         Path: clean up addPathForRoundedRect()
3606         https://bugs.webkit.org/show_bug.cgi?id=116765
3607
3608         Reviewed by Andreas Kling.
3609
3610         Reorganize code that is a bit redundant.
3611
3612         No new tests, no behavior change.
3613
3614         * platform/graphics/Path.cpp:
3615         (WebCore::Path::addPathForRoundedRect):
3616
3617 2013-05-25  Simon Fraser  <simon.fraser@apple.com>
3618
3619         Unprefix Page Visibility API
3620         https://bugs.webkit.org/show_bug.cgi?id=102340
3621
3622         Reviewed by Tim Horton.
3623         
3624         Remove prefixes from the document properties, and the visibilitychanged event.
3625         
3626         Rename the "preview" state to "unloaded". The "unloaded" state is never
3627         reached yet (see https://bugs.webkit.org/show_bug.cgi?id=116769).
3628         
3629         Add some comments to places where we should update the visibility state
3630         when going in and out of the page cache, but cannot safely do so yet.
3631
3632         Tested by existing Page Visibility tests.
3633
3634         * dom/Document.cpp:
3635         (WebCore::Document::pageVisibilityState):
3636         (WebCore::Document::visibilityState):
3637         (WebCore::Document::hidden):
3638         (WebCore::Document::dispatchVisibilityStateChangeEvent):
3639         * dom/Document.h:
3640         * dom/Document.idl:
3641         * dom/EventNames.h:
3642         * history/CachedFrame.cpp:
3643         (WebCore::CachedFrameBase::restore):
3644         * loader/FrameLoader.cpp:
3645         (WebCore::FrameLoader::stopLoading):
3646         * page/Page.cpp:
3647         (WebCore::Page::setVisibilityState):
3648         * page/PageVisibilityState.cpp:
3649         (WebCore::pageVisibilityStateString):
3650         * page/PageVisibilityState.h:
3651
3652 2013-05-25  Andreas Kling  <akling@apple.com>
3653
3654         Move Node::isMouseFocusable() to Element.
3655         <http://webkit.org/b/116762>
3656
3657         Reviewed by Anders Carlsson.
3658
3659         Node::isMouseFocusable() would just return isFocusable(), which is never true for a non-Element
3660         since Node::supportsFocus() always returns false. So move it to Element!
3661
3662         * dom/Node.h:
3663         * dom/Node.cpp:
3664         * dom/Element.h:
3665         * dom/Element.cpp:
3666         (WebCore::Element::isMouseFocusable):
3667
3668             Moved here from Node.
3669
3670         * editing/FrameSelection.cpp:
3671         (WebCore::FrameSelection::setFocusedNodeIfNeeded):
3672         * page/EventHandler.cpp:
3673         (WebCore::EventHandler::dispatchMouseEvent):
3674
3675             Walk up the parent chain with parentOrShadowHostElement() instead of parentOrShadowHostNode().
3676             Removed a misleading no-op hunk about mouse-focusable ShadowRoots, since ShadowRoots are not
3677             Elements and thus cannot be mouse-focusable.
3678
3679         * page/TouchAdjustment.cpp:
3680         (WebCore::TouchAdjustment::nodeRespondsToTapGesture):
3681
3682             Check that the Node is an Element before asking if it's mouse-focusable.
3683
3684         * html/HTMLAnchorElement.h:
3685         * html/HTMLAreaElement.h:
3686         * html/HTMLFormControlElement.h:
3687         * html/HTMLInputElement.h:
3688         * html/HTMLMediaElement.h:
3689         * html/HTMLSelectElement.h:
3690         * html/HTMLTextAreaElement.h:
3691         * html/shadow/ClearButtonElement.h:
3692         * html/shadow/TextControlInnerElements.h:
3693         * svg/SVGAElement.h:
3694         * svg/SVGStyledElement.h:
3695
3696             Sprinkle OVERRIDE.
3697
3698 2013-05-25  Andreas Kling  <akling@apple.com>
3699
3700         Move Node::isKeyboardFocusable() to Element.
3701         <http://webkit.org/b/116761>
3702
3703         Reviewed by Antti Koivisto.
3704
3705         Only Elements can be keyboard-focusable. Move the base isKeyboardFocusable() implementation to Element
3706         and sprinkle OVERRIDE on subclass overrides.
3707         FocusController gets some temporary type checks that will go away as that code moves to dealing in
3708         Elements instead of Node.
3709
3710         * dom/Node.h:
3711         * dom/Node.cpp:
3712         * dom/Element.h:
3713         * dom/Element.cpp:
3714         (WebCore::Element::isKeyboardFocusable):
3715
3716             Move isKeyboardFocusable() from Node to Element.
3717
3718         * page/FocusController.cpp:
3719         (WebCore::isNonFocusableShadowHost):
3720         (WebCore::isFocusableShadowHost):
3721         (WebCore::shouldVisit):
3722         (WebCore::FocusController::advanceFocusInDocumentOrder):
3723
3724             Check that the inspected Node is an Element before querying isKeyboardFocusable().
3725
3726         * html/HTMLAnchorElement.h:
3727         * html/HTMLAreaElement.h:
3728         * html/HTMLFormControlElement.h:
3729         * html/HTMLFrameOwnerElement.h:
3730         * html/HTMLInputElement.h:
3731         * html/HTMLPlugInElement.h:
3732         * html/HTMLSelectElement.h:
3733         * html/HTMLTextAreaElement.h:
3734         * svg/SVGAElement.h:
3735         * svg/SVGStyledElement.h:
3736
3737             Sprinkle OVERRIDE.
3738
3739 2013-05-25  Andreas Kling  <akling@apple.com>
3740
3741         Begin moving "focus" state logic from Node to Element.
3742         <http://webkit.org/b/116760>
3743
3744         Reviewed by Antti Koivisto.
3745
3746         Only Elements can be focused, so merge the "focus" state logic from Node and ContainerNode
3747         and move it into Element. There's a lot more iceberg under this tip, but we'll be starting
3748         with setFocus(bool) and focused().
3749
3750         * dom/Node.h:
3751         * dom/ContainerNode.cpp:
3752         * dom/ContainerNode.h:
3753         * dom/Element.cpp:
3754         (WebCore::Element::isUserActionElementFocused):
3755         (WebCore::Element::setFocus):
3756         * dom/Element.h:
3757         (WebCore::Element::focused):
3758         * dom/Node.cpp:
3759
3760             Move focused() and setFocus(bool) from Node/ContainerNode to Element.
3761
3762         * dom/Document.cpp:
3763         (WebCore::Document::setFocusedNode):
3764         * page/EventHandler.cpp:
3765         (WebCore::EventHandler::dispatchMouseEvent):
3766
3767             Check if the inspected Node is an Element before asking if it's focused.
3768
3769 2013-05-25  Noam Rosenthal  <noam.rosenthal@nokia.com>
3770
3771         Direct pattern compositing breaks when no-repeat is set on a large layer
3772         https://bugs.webkit.org/show_bug.cgi?id=116140
3773
3774         Reviewed by Antti Koivisto.
3775
3776         In some cases the directly composited background color logic overrides the layer's
3777         contentsRect, which results in wrong rendering of tiled images.
3778         This patch makes sure that the background image is applied after the solid color,
3779         which ensures the correct contentsRect.
3780
3781         Test: compositing/patterns/direct-pattern-compositing-contain-no-repeat.html
3782
3783         * rendering/RenderLayerBacking.cpp:
3784         (WebCore::RenderLayerBacking::updateDirectlyCompositedContents):
3785
3786 2013-05-24  Andreas Kling  <akling@apple.com>
3787
3788         Move "hover" state logic from Node to Element.
3789         <http://webkit.org/b/116757>
3790
3791         Reviewed by Antti Koivisto.
3792
3793         Resolve a 7 year old FIXME by merging the "hover" state logic from Node and ContainerNode
3794         and moving it all to Element instead.
3795
3796         * dom/Node.cpp:
3797         (WebCore::Node::detach):
3798         * dom/Element.cpp:
3799         (WebCore::Element::detach):
3800
3801             Move Document::hoveredNodeDetached() call from Node::detach() to Element::detach().
3802
3803         (WebCore::Element::isUserActionElementHovered):
3804         (WebCore::Element::setHovered):
3805         * dom/Element.h:
3806         (WebCore::Element::hovered):
3807
3808             Moved here from Node/ContainerNode.
3809
3810         * dom/UserActionElementSet.h:
3811         (WebCore::UserActionElementSet::setHovered):
3812         (WebCore::UserActionElementSet::setFlags):
3813
3814             Make setHovered() take an Element* instead of a Node*. I'd like to do this will all
3815             of these methods eventually, so added a setFlags() helper with the tighter type.
3816
3817         * html/HTMLLabelElement.h:
3818         * html/shadow/SpinButtonElement.h:
3819
3820             Sprinkle OVERRIDE on setHovered() overrides.
3821
3822         * dom/Document.cpp:
3823         (WebCore::Document::updateHoverActiveState):
3824         * accessibility/AccessibilityNodeObject.cpp:
3825         (WebCore::AccessibilityNodeObject::isHovered):
3826         * rendering/RenderTheme.cpp:
3827         (WebCore::RenderTheme::isHovered):
3828
3829             Check if the inspected Node is an element before asking if it's hovered.
3830
3831 2013-05-25  Andreas Kling  <akling@apple.com>
3832
3833         Document::formController() should return a reference.
3834         <http://webkit.org/b/116758>
3835
3836         Reviewed by Antti Koivisto.
3837
3838         The formController() is created on demand, so return a reference instead.
3839
3840         * dom/Document.h:
3841         * dom/Document.cpp:
3842         (WebCore::Document::formController):
3843         (WebCore::Document::setStateForNewFormElements):
3844         * html/HTMLFormControlElementWithState.cpp:
3845         (WebCore::HTMLFormControlElementWithState::HTMLFormControlElementWithState):
3846         (WebCore::HTMLFormControlElementWithState::~HTMLFormControlElementWithState):
3847         (WebCore::HTMLFormControlElementWithState::didMoveToNewDocument):
3848         (WebCore::HTMLFormControlElementWithState::finishParsingChildren):
3849         * html/HTMLFormElement.cpp:
3850         (WebCore::HTMLFormElement::~HTMLFormElement):
3851         (WebCore::HTMLFormElement::finishParsingChildren):
3852         * html/HTMLInputElement.cpp:
3853         (WebCore::HTMLInputElement::~HTMLInputElement):
3854         (WebCore::HTMLInputElement::didMoveToNewDocument):
3855         (WebCore::HTMLInputElement::checkedRadioButtons):
3856
3857 2013-05-25  Sergio Villar Senin  <svillar@igalia.com>
3858
3859         Reducing CSS code duplication in declaration list error recovery
3860         https://bugs.webkit.org/show_bug.cgi?id=115157
3861
3862         Reviewed by Andreas Kling.
3863
3864         From Blink r148974 by <serya@chromium.org>
3865
3866         Refactor "invalid_block_list error | /* empty */" in a new
3867         decl_list_recovery rule that allows to remove 4 redundant rules.
3868
3869         No new test required as we're just refactoring code, no new behaviour.
3870
3871         * css/CSSGrammar.y.in:
3872
3873 2013-05-24  Ryosuke Niwa  <rniwa@webkit.org>
3874
3875         Build fix after r150664.
3876
3877         * bindings/scripts/test/JS/JSTestObj.cpp:
3878         (WebCore):
3879
3880 2013-05-24  Sergio Villar Senin  <svillar@igalia.com>
3881
3882         Fixing invalid block recovery in some declaration list.
3883         https://bugs.webkit.org/show_bug.cgi?id=115159
3884
3885         Reviewed by Darin Adler.
3886
3887         From Blink r148889 by <serya@chromium.org>
3888
3889         Improves the detection of some invalid block declarations inside a
3890         declaration list. This allows the parser not to completely discard
3891         a whole declaration list that contains an invalid block. In
3892         particular grammar failed in tests 8, 12, 13, 15, 16 and 17 in the
3893         new test added by this change.
3894
3895         Test: fast/css/parsing-invalid-block-recovery.html
3896
3897         * css/CSSGrammar.y.in:
3898
3899
3900 2013-05-24  Beth Dakin  <bdakin@apple.com>
3901
3902         DidFirstFlushForHeaderLayer can be called too soon on pages that redirect
3903         https://bugs.webkit.org/show_bug.cgi?id=116749
3904         -and corresponding-
3905         <rdar://problem/13886753>
3906
3907         Reviewed by Simon Fraser.
3908
3909         Only start m_paintRelatedMilestonesTimer if we have actually painted.
3910         * rendering/RenderLayerCompositor.cpp:
3911         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
3912
3913 2013-05-24  Anders Carlsson  <andersca@apple.com>
3914
3915         Fix Windows build.
3916
3917         * WebCore.vcproj/WebCore.vcproj:
3918         * WebCore.vcxproj/WebCore.vcxproj:
3919         * WebCore.vcxproj/WebCore.vcxproj.filters:
3920
3921 2013-05-24  Tim Horton  <timothy_horton@apple.com>
3922
3923         Animated GIFs don't repaint after TiledCoreAnimationDrawingArea un-suspends painting
3924         https://bugs.webkit.org/show_bug.cgi?id=116744
3925         <rdar://problem/13973514>
3926
3927         Reviewed by Simon Fraser.
3928
3929         * WebCore.exp.in: Export FrameView::resumeAnimatingImages.
3930         * page/FrameView.cpp:
3931         (WebCore::FrameView::setIsInWindow):
3932         (WebCore::FrameView::resumeAnimatingImages):
3933         Factor the code to restart animated images out of frameView::setIsInWindow.
3934
3935         * page/FrameView.h:
3936         (FrameView):
3937
3938 2013-05-24  Anders Carlsson  <andersca@apple.com>
3939
3940         Move history property list writer to WebKit
3941         https://bugs.webkit.org/show_bug.cgi?id=116746
3942
3943         Reviewed by Tim Horton.
3944
3945         Remove files from the Xcode project and remove symbols that now live in WebKit.
3946
3947         * WebCore.exp.in:
3948         * WebCore.xcodeproj/project.pbxproj:
3949
3950 2013-05-24  Christophe Dumez  <ch.dumez@sisa.samsung.com>
3951
3952         Global constructors exposed in worker environment have wrong attributes
3953         https://bugs.webkit.org/show_bug.cgi?id=116708
3954
3955         Reviewed by Geoffrey Garen.
3956
3957         Fix JSC bindings generator so that Global constructors exposed in worker environment
3958         have the following attributes:
3959         { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }
3960
3961         This is now consistent with global constructors on DOMWindow and with the Web IDL
3962         specification:
3963         http://dev.w3.org/2006/webapi/WebIDL/#es-interfaces
3964
3965         Test: fast/js/global-constructors-attributes-worker.html
3966
3967         * bindings/scripts/CodeGeneratorJS.pm:
3968         (GenerateAttributesHashTable):
3969
3970 2013-05-24  Christophe Dumez  <ch.dumez@sisa.samsung.com>
3971
3972         Remove custom code for webkitAudioContext global constructor getter
3973         https://bugs.webkit.org/show_bug.cgi?id=116530
3974
3975         Reviewed by Geoffrey Garen.
3976
3977         Get rid of custom code for webkitAudioContext global constructor getter. The
3978         global DOMWindow attribute is now automatically generated by leveraging support
3979         for [EnabledAtRuntime] extended attribute and the existing methods in
3980         RuntimeEnabledFeatures class.
3981
3982         No new tests, no behavior change.
3983
3984         * GNUmakefile.list.am: Remove JSDOMWindowWebAudioCustom.*.
3985         * Modules/webaudio/AudioContext.idl:
3986         Remove [NoInterfaceObject] extended attribute so that the global constructor is
3987         automatically generated instead of automatically added. Add [EnabledAtRuntime]
3988         extended attribute since this global constructor can be disabled at runtime and
3989         so that we can getter rid of the [CustomGetter] for the corresponding global
3990         constructor. Use [InterfaceName] extended attribute so that the interface name
3991         matches the global constructor on DOMWindow (webkitAudioContext).
3992
3993         * Target.pri: Remove JSDOMWindowWebAudioCustom.*.
3994         * UseJSC.cmake: Remove JSDOMWindowWebAudioCustom.*.
3995         * WebCore.exp.in: Export additional symbol.
3996         * WebCore.order: Export additional symbol.
3997         * WebCore.vcproj/WebCore.vcproj: Remove JSDOMWindowWebAudioCustom.*.
3998         * WebCore.vcxproj/WebCore.vcxproj: Remove JSDOMWindowWebAudioCustom.*.
3999         * WebCore.vcxproj/WebCore.vcxproj.filters: Remove JSDOMWindowWebAudioCustom.*.
4000         * WebCore.xcodeproj/project.pbxproj: Remove JSDOMWindowWebAudioCustom.*.
4001         * bindings/generic/RuntimeEnabledFeatures.h:
4002         (WebCore::RuntimeEnabledFeatures::setWebAudioEnabled):
4003         * bindings/js/JSBindingsAllInOne.cpp: Remove JSDOMWindowWebAudioCustom.*.
4004         * bindings/js/JSDOMWindowWebAudioCustom.cpp: Removed. We no longer need any custom code for
4005         the WebAudio global constructor getter because we use [EnabledAtRuntime] support in the
4006         bindings generator now.
4007         * page/DOMWindow.idl: Remove global constructor for AudioContext as it is now automatically
4008         generated.
4009         * page/Settings.in: Remove webAudioEnabled setting as we use the existing setting
4010         in RuntimeEnabledFeatures now.
4011
4012 2013-05-24  Seokju Kwon  <seokju.kwon@gmail.com>
4013
4014         [AC] Needs to be guarded by USE(ACCELERATED_COMPOSITING)
4015         https://bugs.webkit.org/show_bug.cgi?id=116712
4016
4017         Reviewed by Andreas Kling.
4018
4019         renderView is used when ACCELERATED_COMPOSITING is enabled.
4020         So, this patch allows it to be guarded by USE(ACCELERATED_COMPOSITING).
4021
4022         No new tests, no behavior change.
4023
4024         * page/FrameView.cpp:
4025         (WebCore::FrameView::setFrameRect):
4026
4027 2013-05-24  Thomas Deniau  <deniau@apple.com>
4028
4029         Add more lines to the context during Dictionary lookups
4030         https://bugs.webkit.org/show_bug.cgi?id=115256
4031
4032         Reviewed by Ryosuke Niwa.
4033
4034         No new tests - no new functionality.
4035
4036         * WebCore.exp.in: Export a few methods in VisibleUnits needed to be able
4037         to call previousLinePosition(), nextLinePosition(), startOfLine() and
4038         endOfLine() in WebPageMac.mm when determining the context while looking
4039         up a dictionary definition. These symbols used to be exported for iOS
4040         only, export them on the desktop too.
4041
4042 2013-05-24  Anders Carlsson  <andersca@apple.com>
4043
4044         Remove PagePopup code
4045         https://bugs.webkit.org/show_bug.cgi?id=116732
4046
4047         Reviewed by Andreas Kling.
4048
4049         Remove all page popup code.
4050
4051         * GNUmakefile.list.am:
4052         * WebCore.xcodeproj/project.pbxproj:
4053         * dom/ContextFeatures.cpp:
4054         * dom/ContextFeatures.h:
4055         * loader/EmptyClients.h:
4056         * page/ChromeClient.h:
4057         * page/DOMWindowPagePopup.cpp: Removed.
4058         * page/DOMWindowPagePopup.h: Removed.
4059         * page/DOMWindowPagePopup.idl: Removed.
4060         * page/PagePopup.h: Removed.
4061         * page/PagePopupClient.cpp: Removed.
4062         * page/PagePopupClient.h: Removed.
4063         * page/PagePopupController.cpp: Removed.
4064         * page/PagePopupController.h: Removed.
4065         * page/PagePopupController.idl: Removed.
4066         * page/PagePopupDriver.h: Removed.
4067         * testing/Internals.cpp:
4068         (WebCore::Internals::resetToConsistentState):
4069         (WebCore):
4070         * testing/Internals.h:
4071         (WebCore):
4072         (Internals):
4073         * testing/Internals.idl:
4074         * testing/MockPagePopupDriver.cpp: Removed.
4075         * testing/MockPagePopupDriver.h: Removed.
4076
4077 2013-05-24  Jer Noble  <jer.noble@apple.com>
4078
4079         Mac: Set the default audio buffer size to a large value for <video> elements.
4080         https://bugs.webkit.org/show_bug.cgi?id=116342
4081
4082         Reviewed by Eric Carlson.
4083         Roll-in rubber stamped by Eric Carlson.
4084
4085         To enable power savings by waking up the audio hardware less often, set the
4086         requested buffer frame size to a large value, such as 4096. Since this results
4087         in approximately 100ms worth of buffer, set the buffer size to a much lower
4088         value when playing WebAudio, which is much more sensitive to latency than video
4089         or audio elements.
4090
4091         Introduce a new class, AudioSessionManager, as well as a helper class,
4092         AudioSessionManagerToken. Audio elements, video elements, and WebAudio destination
4093         nodes will create and retain a token, and release the token in their destructor.
4094         This allows the AudioSessionManager to track how many of what type of audio-
4095         generating objects are in existence.
4096
4097         This requires implementing AudioSession for Mac platforms. Move the implementation
4098         for retrieving the hardware sample rate and setting the buffer duration into
4099         AudioSessionMac from AudioDestinationMac, to be shared with AudioSessionManagerMac.
4100
4101         Change the AudioSession method preferredBufferLength() into preferredBufferSize(),
4102         as the callers really want to specify a buffer size, not a buffer duration. On iOS,
4103         where the available API requires a duration, perform the conversion from duration to
4104         size on behalf of the caller.
4105
4106         However, since the original version of this patch caused media test
4107         failures on the Mac ML and Lion bots, only enable the buffer size
4108         change for OS X > ML.
4109
4110         * html/HTMLMediaElement.h:  Add a AudioSessionManagerToken member.
4111         * html/HTMLMediaElement.cpp:
4112         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize the token.
4113         * platform/audio/AudioSession.cpp:
4114         (WebCore::AudioSession::preferredBufferSize): Renamed from preferredBufferLength.
4115         (WebCore::AudioSession::setPreferredBufferSize): Renamed from setPreferredBufferLength.
4116         * platform/audio/AudioSession.h:
4117         * platform/audio/AudioSessionManager.cpp:
4118         (AudioSessionManagerToken::create): Simple factory method.
4119         (AudioSessionManagerToken::AudioSessionManagerToken): Call AudioSessionManager::incrementCount().
4120         (AudioSessionManagerToken::~AudioSessionManagerToken): Call AudioSessionManager::decrementCount().
4121         (AudioSessionManager::sharedManager): Simple singleton method.
4122         (AudioSessionManager::AudioSessionManager): Simple constructor.
4123         (AudioSessionManager::has): Return whether the type is present.
4124         (AudioSessionManager::incrementCount): Increment, then call updateSessionState()
4125         (AudioSessionManager::decrementCount): Decrement, then call updateSessionState()
4126         (AudioSessionManager::updateSessionState): Stub, does nothing.
4127         * platform/audio/AudioSessionManager.h:
4128         * platform/audio/ios/AudioDestinationIOS.cpp:
4129         (WebCore::AudioDestinationIOS::configure): Call setPreferredBufferSize() instead of setPreferredBufferLength()
4130         * platform/audio/ios/AudioSessionIOS.mm:
4131         (WebCore::AudioSession::preferredBufferSize): Renamed from preferredBufferLength.
4132         (WebCore::AudioSession::setPreferredBufferSize): Renamed from setPreferredBufferLength
4133         * platform/audio/mac/AudioDestinationMac.cpp:
4134         (WebCore::AudioDestination::hardwareSampleRate): Call AudioSession::sampleRate().
4135