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