Make sure the removal of user stylesheets results in all of the WebViews being updated to
[WebKit.git] / WebCore / ChangeLog
1 2009-09-30  Dave Hyatt  <hyatt@apple.com>
2
3         Reviewed by Tim Hatcher.
4
5         Make sure the removal of user stylesheets results in all of the WebViews being updated to
6         reflect the changes.
7
8         * page/PageGroup.cpp:
9         (WebCore::PageGroup::removeUserContentWithURLForWorld):
10         (WebCore::PageGroup::removeUserContentForWorld):
11
12 2009-09-30  Dan Bernstein  <mitz@apple.com>
13
14         Reviewed by Sam Weinig.
15
16         REGRESSION(r47440): drop down menus at americanexpress.com disappear on mouse out
17         https://bugs.webkit.org/show_bug.cgi?id=29209
18
19         Test: fast/inline/relative-positioned-overflow.html
20
21         * rendering/InlineFlowBox.cpp:
22         (WebCore::InlineFlowBox::computeVerticalOverflow): Add self-painting
23         inlines to overflow to ensure that they are included in hit-testing.
24
25 2009-09-30  Simon Fraser  <simon.fraser@apple.com>
26
27         Reviewed by Mark Rowe.
28
29         transforms/3d tests are not run in Release builds
30         https://bugs.webkit.org/show_bug.cgi?id=29827
31
32         Make sure we export the WebCoreHas3DRendering symbol in Release builds,
33         because this symbols is used by run-webkit-tests (via 'nm') to detect whether
34         WebCore was built with ENABLE_3D_RENDERING turned on.
35
36         * DerivedSources.make:
37         * WebCore.3DRendering.exp: Added.
38         * WebCore.xcodeproj/project.pbxproj:
39
40 2009-09-30  Jeremy Orlow  <jorlow@chromium.org>
41
42         Build fix for QT.  Didn't know WebCore.pro existed.
43
44         * WebCore.pro:
45
46 2009-09-30  Dave Hyatt  <hyatt@apple.com>
47
48         Reviewed by Adam Roben.
49
50         Add a method for removal of user scripts and stylesheets by URL from a specific world.
51
52         * page/PageGroup.cpp:
53         (WebCore::PageGroup::removeUserContentURLForWorld):
54         * page/PageGroup.h:
55
56 2009-09-30  Chris Hawk  <hawk@chromium.org>
57
58         Reviewed by Dimitri Glazkov.
59
60         Fix for conditionals in the WebCore gyp file, which contained two separate
61         'conditions' values for the webcore target. The first entry was ignored,
62         resulting in some missine defines.
63         https://bugs.webkit.org/show_bug.cgi?id=29907
64
65         * WebCore.gyp/WebCore.gyp:
66
67 2009-09-21  Jeremy Orlow  <jorlow@chromium.org>
68
69         Reviewed by Adam Barth.
70
71         DOM Storage needs to be more careful about where "ThreadSafe" objects are destroyed.
72         https://bugs.webkit.org/show_bug.cgi?id=29265
73
74         DOM Storage needs to be more careful about where "ThreadSafe" objects are
75         destroyed.  With the current code, there actually isn't a race condition, but
76         it sure would be easy for someone to introduce one.  A bunch of
77         ThreadSafeShared objects have RefPtrs to objects that are NOT ThreadSafeShared
78         objects.  If it were possible any of these objects' destructors to be fired off
79         the main thread, then the you'd have a race condition.  The code should be more
80         clear and self-documenting about how things related to each other.
81
82         Since the lifetime of a LocalStorageTask is bounded by the LocalStorageThread
83         which is bounded by the StorageSyncManager, StorageAreaImpl, and
84         StorageAreaSync, there's no reason for LocalStorageTask to store anything other
85         than pointers.  By breaking this dependency, we can eliminate the risk.
86
87         Note that we _could_ have LocalStorageThread's task queue just store
88         LocalStorageTask*'s rather than RefPtr<LocalStorageTask>s but then we'd need to
89         manually take care of deleting.  It'd probably also be possible to change
90         LocalStorageThread around so that it needn't hold onto a reference of itself
91         and have a more deterministic shutdown, but my initial attempts to do so
92         failed, and I decided it wasn't worth changing.  The queue is killed before
93         hand, so the thread is 100% impotent before the main thread continues anyway.
94
95         The constructors and destructors of StorageSyncManager, StorageAreaImpl, and
96         StorageAreaSync now have ASSERTs to verify they're running on the main thread. 
97         I'm fairly positive that it'd be impossible to hit these asserts and the fact
98         that these classes are no longer ThreadSafeShared should make it clear how
99         they're meant to be used, but I think it's worth it to be extra sure.  Of
100         course, ideally, we'd have such an assert every time a ref is incremented or
101         decremented.
102
103         Behavior should be unchanged and this is just an internal code cleanup, so no
104         new tests.
105
106         * storage/LocalStorageTask.cpp:
107         (WebCore::LocalStorageTask::LocalStorageTask):
108         (WebCore::LocalStorageTask::performTask):
109         * storage/LocalStorageTask.h:
110         (WebCore::LocalStorageTask::createImport):
111         (WebCore::LocalStorageTask::createSync):
112         (WebCore::LocalStorageTask::createTerminate):
113         * storage/LocalStorageThread.cpp:
114         (WebCore::LocalStorageThread::scheduleImport):
115         (WebCore::LocalStorageThread::scheduleSync):
116         * storage/LocalStorageThread.h:
117         * storage/StorageArea.h:
118         * storage/StorageAreaImpl.cpp:
119         (WebCore::StorageAreaImpl::~StorageAreaImpl):
120         (WebCore::StorageAreaImpl::StorageAreaImpl):
121         * storage/StorageAreaSync.cpp:
122         (WebCore::StorageAreaSync::StorageAreaSync):
123         (WebCore::StorageAreaSync::~StorageAreaSync):
124         * storage/StorageSyncManager.cpp:
125         (WebCore::StorageSyncManager::StorageSyncManager):
126         (WebCore::StorageSyncManager::~StorageSyncManager):
127         (WebCore::StorageSyncManager::scheduleImport):
128         (WebCore::StorageSyncManager::scheduleSync):
129         * storage/StorageSyncManager.h:
130
131 2009-09-28  Jeremy Orlow  <jorlow@chromium.org>
132
133         Reviewed by Darin Fisher.
134
135         Chromium needs to be able to override the way storage events are delivered
136         https://bugs.webkit.org/show_bug.cgi?id=29655
137
138         Chromium needs to be able to override the way storage events are delivered.
139         This replaced https://bugs.webkit.org/show_bug.cgi?id=29257 because it'll be
140         faster (no vtables and extra allocation) and somewhat cleaner (no dependency
141         injection).  This is necessary because Chromium needs to transport events across
142         a process barrier and then dispatch them without use of a Frame*.
143
144         Behavior should not change with this, so no updates to tests.
145
146         * GNUmakefile.am:
147         * WebCore.gypi:
148         * WebCore.vcproj/WebCore.vcproj:
149         * WebCore.xcodeproj/project.pbxproj:
150         * WebCoreSources.bkl:
151         * storage/StorageAreaImpl.cpp:
152         (WebCore::StorageAreaImpl::setItem):
153         (WebCore::StorageAreaImpl::removeItem):
154         (WebCore::StorageAreaImpl::clear):
155         * storage/StorageAreaImpl.h:
156         * storage/StorageEventDispatcher.cpp: Copied from WebCore/storage/StorageAreaImpl.cpp.
157         (WebCore::StorageEventDispatcher::dispatch):
158         * storage/StorageEventDispatcher.h: Added.  (Well, technically in the other half of this patch.)
159
160 2009-09-30  Jian Li  <jianli@chromium.org>
161
162         Reviewed by Darin Adler.
163
164         Need to check NULL frame in EventHandler::updateDragAndDrop.
165         https://bugs.webkit.org/show_bug.cgi?id=29929
166
167         Test: http/tests/misc/drag-over-iframe-invalid-source-crash.html
168
169         * page/EventHandler.cpp:
170         (WebCore::EventHandler::updateDragAndDrop):
171
172 2009-09-29  Simon Fraser  <simon.fraser@apple.com>
173
174         Reviewed by Dan Bernstein.
175
176         ASSERTION FAILED: !repaintContainer || repaintContainer == this
177         https://bugs.webkit.org/show_bug.cgi?id=29755
178         
179         Generalize the fix for this bug to account for cases where there may be multiple
180         containing blocks between the repaint container, and the container of the element
181         being repainted.
182
183         Test: compositing/repaint/opacity-between-absolute2.html
184
185         * rendering/RenderBox.cpp:
186         (WebCore::RenderBox::mapLocalToContainer):
187         Call offsetFromAncestorContainer() to get the correct offset.
188         
189         (WebCore::RenderBox::computeRectForRepaint): Ditto
190         * rendering/RenderInline.cpp:
191         (WebCore::RenderInline::computeRectForRepaint): Ditto.
192         
193         * rendering/RenderObject.h:
194         * rendering/RenderObject.cpp:
195         (WebCore::RenderObject::offsetFromAncestorContainer):
196         New method that computes an offset from some object in the ancestor container() chain.
197
198 2009-09-30  Andras Becsi  <becsi.andras@stud.u-szeged.hu>
199
200         Reviewed by Simon Hausmann.
201
202         [Qt] Fix TextCodecQt::decode method after r48752 to return a non-null string if the length of the input is 0.
203         This fixes https://bugs.webkit.org/show_bug.cgi?id=29736.
204
205         * platform/text/qt/TextCodecQt.cpp:
206         (WebCore::TextCodecQt::decode):
207
208 2009-09-29  Dave Hyatt  <hyatt@apple.com>
209
210         Reviewed by Jon Honeycutt.
211
212         Fix a couple of bugs with patterns.  Move the setting of the document URL to before the style
213         selector gets constructed so that pattern match testing gets the correct URL.
214
215         * loader/FrameLoader.cpp:
216         (WebCore::FrameLoader::begin):
217         * page/UserContentURLPattern.cpp:
218         (WebCore::UserContentURLPattern::parse):
219
220 2009-09-29  Alexey Proskuryakov  <ap@apple.com>
221
222         Rubber-stamped by Brady Eidson.
223
224         Assertion failure in http/tests/xmlhttprequest/failed-auth.html.
225
226         I couldn't find out why this only started to happen now, but it was incorrect to check
227         persistence of a credential returned by CredentialStorage::get() without checking that it
228         was non-null. When there is no credential for the protection space in storage, get()
229         returns a new object, and Credentil constructor doesn't initialize m_persistence.
230
231         * platform/network/mac/ResourceHandleMac.mm:
232         (-[WebCoreSynchronousLoader connection:didReceiveAuthenticationChallenge:]): Moved the
233         assertion after credential null check.
234         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Added the same persistence
235         assertion, matching sync code (and CF one, as well).
236
237 2009-09-29  Yong Li  <yong.li@torchmobile.com>
238
239         Reviewed by Darin Adler.
240
241         Add an ASSERT for UTF8Encoding().isValid()
242         https://bugs.webkit.org/show_bug.cgi?id=29908
243
244         * platform/text/TextEncoding.cpp:
245         (WebCore::UTF8Encoding):
246
247 2009-09-29  Dave Hyatt  <hyatt@apple.com>
248
249         Reviewed by Jon Honeycutt.
250
251         https://bugs.webkit.org/show_bug.cgi?id=29892
252         Add support for whitelist patterns to control conditional injection of user scripts and
253         user stylesheets.
254
255         No new tests. Not testable until WebKit portion is added in followup patch.
256
257         * GNUmakefile.am:
258         * WebCore.gypi:
259         * WebCore.pro:
260         * WebCore.vcproj/WebCore.vcproj:
261         * WebCore.xcodeproj/project.pbxproj:
262         * dom/Document.cpp:
263         (WebCore::Document::pageGroupUserSheets):
264         * page/Frame.cpp:
265         (WebCore::Frame::injectUserScriptsForWorld):
266         * page/UserContentURLPattern.cpp: Added.
267         (WebCore::UserContentURLPattern::matchesPatterns):
268         (WebCore::UserContentURLPattern::parse):
269         (WebCore::UserContentURLPattern::matches):
270         (WebCore::UserContentURLPattern::matchesHost):
271         (WebCore::MatchTester::MatchTester):
272         (WebCore::MatchTester::testStringFinished):
273         (WebCore::MatchTester::patternStringFinished):
274         (WebCore::MatchTester::eatWildcard):
275         (WebCore::MatchTester::eatSameChars):
276         (WebCore::MatchTester::test):
277         (WebCore::UserContentURLPattern::matchesPath):
278         * page/UserContentURLPattern.h: Added.
279         (WebCore::UserContentURLPattern::UserContentURLPattern):
280         (WebCore::UserContentURLPattern::scheme):
281         (WebCore::UserContentURLPattern::host):
282         (WebCore::UserContentURLPattern::path):
283         (WebCore::UserContentURLPattern::matchSubdomains):
284
285 2009-09-29  Enrica Casucci  <enrica@apple.com>
286
287         Reviewed by Adele Peterson.
288
289         Reproducible crash pressing return inside quoted content
290         at WebCore::BreakBlockquoteCommand::doApply.
291         <rdar://problem/7085453>
292         In some case, like the one provided in the test case, m_downStreamEnd
293         refers to a node that gets deleted when executing the DeleteSelectionCommand.
294         We shouldn't use m_downStreamEnd to recalculate the new m_endPosition when
295         pruning is needed, because it may be point to a node that has been deleted, but
296         rather rely on removeNode in CompositeEditCommand to update m_endPosition correctly.
297
298         Test: editing/selection/blockquote-crash.html
299
300         * editing/BreakBlockquoteCommand.cpp:
301         (WebCore::BreakBlockquoteCommand::doApply): Added check for invalid position
302         to avoid dereferencing a null node pointer.
303         * editing/DeleteSelectionCommand.cpp:
304         (WebCore::DeleteSelectionCommand::mergeParagraphs): Don't reset m_endPosition
305         using the value in m_downStreamEnd when it is necessary to prune the start block.
306         
307 2009-09-29  Alexey Proskuryakov  <ap@apple.com>
308
309         Reviewed by Brady Eidson.
310
311         Basic authentication credentials are not sent automatically to top resources
312         https://bugs.webkit.org/show_bug.cgi?id=29901
313
314         No new tests - I don't want to pollute root directory of http tests to check for this rather
315         minor issue.
316
317         * platform/network/CredentialStorage.cpp:
318         (WebCore::CredentialStorage::set): Changed to always preserve leading slash.
319         (WebCore::CredentialStorage::getDefaultAuthenticationCredential): Made breaking out of the
320         loop more explicit.
321
322 2009-09-29  Pavel Feldman  <pfeldman@chromium.org>
323
324         Reviewed by Oliver Hunt.
325
326         Web Inspector REGRESSION(r47820-r47822): Profiles aren't
327         added to the inspector unless the inspector is already open
328         when the profile completes.
329
330         https://bugs.webkit.org/show_bug.cgi?id=29897
331
332         * inspector/front-end/ProfilesPanel.js:
333         (WebInspector.ProfilesPanel.prototype._populateProfiles):
334
335 2009-09-29  Kenneth Rohde Christiansen  <kenneth@webkit.org>
336
337         Rubberstamped by David Hyatt.
338
339         Fix to logic of earlier commit 48902.
340
341         When merging two if's before committing, I forgot to invert the
342         bool check.
343
344         * platform/network/qt/QNetworkReplyHandler.cpp:
345         (WebCore::ignoreHttpError):
346
347 2009-09-29  Stephen White  <senorblanco@chromium.org>
348
349         Unreviewed, build fix.
350
351         Fixing Chromium build, following r48884.
352
353         [https://bugs.webkit.org/show_bug.cgi?id=29894]
354
355         * bindings/v8/V8AbstractEventListener.cpp:
356         (WebCore::V8AbstractEventListener::handleEvent):
357         * bindings/v8/V8AbstractEventListener.h:
358         * bindings/v8/V8WorkerContextEventListener.cpp:
359         (WebCore::V8WorkerContextEventListener::handleEvent):
360         * bindings/v8/V8WorkerContextEventListener.h:
361
362 2009-09-29  Kent Tamura  <tkent@chromium.org>
363
364         Reviewed by Darin Adler.
365
366         Follows HTML5's maxLength change in September 2009.
367         - Change HTMLTextAreaElement.maxLength type to signed.
368         - HTMLTextAreaElement.maxLength returns -1 if maxlength= attribute is missing.
369         - HTMLTextAreaElement.maxLength and HTMLInputElement.maxLength
370           throw INDEX_SIZE_ERR for setting negative values.
371         https://bugs.webkit.org/show_bug.cgi?id=29796
372
373         * html/HTMLInputElement.cpp:
374         (WebCore::HTMLInputElement::setMaxLength):
375         * html/HTMLInputElement.h:
376         * html/HTMLInputElement.idl:
377         * html/HTMLTextAreaElement.cpp:
378         (WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent):
379         (WebCore::HTMLTextAreaElement::maxLength):
380         (WebCore::HTMLTextAreaElement::setMaxLength):
381         * html/HTMLTextAreaElement.h:
382         * html/HTMLTextAreaElement.idl:
383
384 2009-09-29  Dimitri Glazkov  <dglazkov@chromium.org>
385
386         No review, rolling out r48894, because review discussion was not complete.
387         http://trac.webkit.org/changeset/48894
388
389         * platform/sql/SQLiteTransaction.cpp:
390         (WebCore::SQLiteTransaction::begin):
391
392 2009-09-29  Dirk Schulze  <krit@webkit.org>
393
394         Reviewed by Nikolas Zimmermann.
395
396         SVG Filter feComposite implementation is missing
397         [https://bugs.webkit.org/show_bug.cgi?id=28362]
398
399         feComposite implementation for SVG.
400
401         Test: svg/filters/feComposite.svg
402
403         * platform/graphics/filters/FEComposite.cpp:
404         (WebCore::arithmetic):
405         (WebCore::FEComposite::apply):
406
407 2009-09-29  Dumitru Daniliuc  <dumi@chromium.org>
408
409         Reviewed by Dimitri Glazkov.
410
411         Starting all read-only transactions with an explicit BEGIN
412         DEFERRED command instead of BEGIN, since some ports (chromium)
413         might compile their own SQLite library and set BEGIN to BEGIN
414         IMMEDIATE by default; which would result in a deadlock in case of
415         two concurrent read-only transactions on the same DB, and would
416         unnecessarily delay other potential transactions to the same DB.
417
418         https://bugs.webkit.org/show_bug.cgi?id=29729
419
420         * platform/sql/SQLiteTransaction.cpp:
421         (WebCore::SQLiteTransaction::begin):
422
423 2009-09-29  Kenneth Russell  <kbr@google.com>
424
425         Reviewed by Dimitri Glazkov.
426
427         Add support for run-time flag for 3D canvas
428         https://bugs.webkit.org/show_bug.cgi?id=29826
429
430         * html/HTMLCanvasElement.cpp:
431         (WebCore::HTMLCanvasElement::getContext): Check page settings for
432         experimental WebGL flag before returning 3D graphics context.
433         * page/Settings.cpp:
434         (WebCore::Settings::Settings): Initialize new flag to false.
435         (WebCore::Settings::setExperimentalWebGLEnabled):
436         * page/Settings.h: Set new flag.
437         (WebCore::Settings::experimentalWebGLEnabled): Return new flag.
438
439 2009-09-29  Jeremy Orlow  <jorlow@chromium.org>
440
441         Reviewed by Darin Fisher.
442
443         Chromium needs to be able to override the way storage events are delivered - part 1
444         https://bugs.webkit.org/show_bug.cgi?id=29889
445
446         Chromium needs to be able to override the way storage events are delivered.
447         This replaced https://bugs.webkit.org/show_bug.cgi?id=29257 because it'll be
448         faster (no vtables and extra allocation) and somewhat cleaner (no dependency
449         injection).  This is necessary because Chromium needs to transport events across
450         a process barrier and then dispatch them without use of a Frame*.
451
452         This patch should be a no-op for all ports other than Chromium.
453
454         * WebCore.gypi:
455         * storage/StorageEventDispatcher.h: Added.
456
457 2009-09-29  Oliver Hunt  <oliver@apple.com>
458
459         Reviewed by NOBODY (missed file).
460
461         Adding file missed in previous commit.
462
463         * manual-tests/gtk/resources/long_cell.cur: Copied from WebCore/dom/PositionCreationFunctions.h.
464
465 2009-09-29  Dimitri Glazkov  <dglazkov@chromium.org>
466
467         Reviewed by Darin Fisher.
468
469         [V8] Correct an issue with XMLHttpRequest attribute event listeners never being cleared.
470         https://bugs.webkit.org/show_bug.cgi?id=29888
471
472         Test: LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-abort-readyState-shouldDispatchEvent.html
473
474         * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
475         (WebCore::getEventListener): Added isAttribute parameter.
476         (WebCore::ACCESSOR_SETTER): Made all event listener setters create attribute listeners.
477         (WebCore::CALLBACK_FUNC_DECL): Made addEventListener create object listener.
478
479 2009-09-22  Martin Robinson  <martin.james.robinson@gmail.com>
480
481         Reviewed by Eric Seidel.
482
483         Fix corruption for non-square images.
484
485         [GTK] REGRESSION: BitmapImage::getGdkPixbuf fails for non-square images
486         https://bugs.webkit.org/show_bug.cgi?id=29654
487
488         Added an additional manual-test for this issue to the existing Gtk
489         cursor image test.
490
491         * manual-tests/gtk/cursor-image.html:
492         * manual-tests/gtk/resources/long_cell.cur: Added.
493         * platform/graphics/gtk/ImageGtk.cpp:
494         (WebCore::BitmapImage::getGdkPixbuf):
495
496 2009-09-29  Alexey Proskuryakov  <ap@apple.com>
497
498         Reviewed by Timothy Hatcher.
499
500         Build fix - pass a proper ScriptExecutipnContext to getEventListenerHandlerBody()
501
502         * bindings/js/ScriptEventListener.cpp:
503         (WebCore::getEventListenerHandlerBody):
504         * bindings/js/ScriptEventListener.h:
505         * bindings/v8/ScriptEventListener.cpp:
506         (WebCore::getEventListenerHandlerBody):
507         * bindings/v8/ScriptEventListener.h:
508         * inspector/InspectorDOMAgent.cpp:
509         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
510
511 2009-09-29  Nate Chapin  <japhet@chromium.org>
512
513         Reviewed by Eric Seidel.
514
515         Ensure that we don't scroll lock to an anchor node after a
516         user-initiated scroll, even if that scroll doesn't propagate
517         all the way up to FrameView.
518
519         Test: fast/events/node-event-anchor-lock.html
520
521         * page/EventHandler.cpp: Call setFrameWasScrolledByUser() when a scroll is handled by a node rather than a frame.
522         (WebCore::EventHandler::scrollOverflow):
523         (WebCore::EventHandler::handleWheelEvent):
524         (WebCore::EventHandler::sendScrollEvent): Use setFrameWasScrolledByUser();
525         (WebCore::EventHandler::setFrameWasScrolledByUser): Split out of sendScrollEvent();
526         (WebCore::EventHandler::passMousePressEventToScrollbar):
527         * page/EventHandler.h: Declare setFrameWasScrolledByUser().
528
529 2009-09-28  Alexey Proskuryakov  <ap@apple.com>
530
531         Reviewed by Darin Adler and Sam Weinig.
532
533         Onclick not fired for an element copied with cloneContents() or cloneNode()
534         https://bugs.webkit.org/show_bug.cgi?id=25130
535
536         The change here is that JS event listeners don't keep a reference to a global object from
537         where they were created, and instead take it as a parameter when parsing source code. Also,
538         the listener creation won't fail just because it happens for an element in a frameless
539         document.
540         Thus, moving nodes between documents no longer results in having incorrect registered
541         lazy event listeners on them.
542
543         Tests: fast/events/attribute-listener-cloned-from-frameless-doc-context-2.html
544                fast/events/attribute-listener-cloned-from-frameless-doc-context.html
545                fast/events/attribute-listener-cloned-from-frameless-doc.xhtml
546                fast/events/attribute-listener-extracted-from-frameless-doc-context-2.html
547                fast/events/attribute-listener-extracted-from-frameless-doc-context.html
548
549         * bindings/js/JSEventListener.cpp:
550         (WebCore::JSEventListener::JSEventListener): Don't take a reference to JSDOMGlobalObject.
551         (WebCore::JSEventListener::jsFunction): Take ScriptExecutionContext as a parameter for
552         getting to JSDOMGlobalObject. It's not used in base class, but is in JSLazyEventListner.
553         (WebCore::JSEventListener::markJSFunction): Don't mark the global object.
554         (WebCore::JSEventListener::handleEvent): Get global object from ScriptExecutionContext.
555         (WebCore::JSEventListener::reportError): Ditto.
556
557         * bindings/js/JSEventListener.h: (WebCore::JSEventListener::create): Don't keep a reference
558         to JSDOMGlobalObject.
559
560         * bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::parseCode): Listener
561         creation was split between this function and ScriptEventListener; moved it here, as JS
562         global object can be different now.
563
564         * bindings/js/JSLazyEventListener.h: (WebCore::JSLazyEventListener::create): Keep source URL,
565         which can not be determined at parsing time.
566
567         * bindings/js/ScriptEventListener.cpp: (WebCore::createAttributeEventListener): Moved code
568         for listener creation to JSLazyEventListener. XSSAuditor code remains here, because tests
569         expect that errors are logged at document parsing time, and because I don't know what other
570         side effects moving it vould have.
571
572         * dom/EventListener.h: handleEvent() and reportError() now take ScriptExecutionContext,
573         because JSC needs a global context here.
574
575         * bindings/js/JSAbstractWorkerCustom.cpp:
576         (WebCore::JSAbstractWorker::addEventListener):
577         (WebCore::JSAbstractWorker::removeEventListener):
578         * bindings/js/JSDOMApplicationCacheCustom.cpp:
579         (WebCore::JSDOMApplicationCache::addEventListener):
580         (WebCore::JSDOMApplicationCache::removeEventListener):
581         * bindings/js/JSDOMGlobalObject.cpp:
582         (WebCore::JSDOMGlobalObject::createJSAttributeEventListener):
583         * bindings/js/JSDOMWindowCustom.cpp:
584         (WebCore::JSDOMWindow::addEventListener):
585         (WebCore::JSDOMWindow::removeEventListener):
586         * bindings/js/JSEventSourceCustom.cpp:
587         (WebCore::JSEventSource::addEventListener):
588         (WebCore::JSEventSource::removeEventListener):
589         * bindings/js/JSMessagePortCustom.cpp:
590         (WebCore::JSMessagePort::addEventListener):
591         (WebCore::JSMessagePort::removeEventListener):
592         * bindings/js/JSNodeCustom.cpp:
593         (WebCore::JSNode::addEventListener):
594         (WebCore::JSNode::removeEventListener):
595         * bindings/js/JSSVGElementInstanceCustom.cpp:
596         (WebCore::JSSVGElementInstance::addEventListener):
597         (WebCore::JSSVGElementInstance::removeEventListener):
598         * bindings/js/JSWorkerContextCustom.cpp:
599         (WebCore::JSWorkerContext::addEventListener):
600         (WebCore::JSWorkerContext::removeEventListener):
601         * bindings/js/JSXMLHttpRequestCustom.cpp:
602         (WebCore::JSXMLHttpRequest::addEventListener):
603         (WebCore::JSXMLHttpRequest::removeEventListener):
604         * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
605         (WebCore::JSXMLHttpRequestUpload::addEventListener):
606         (WebCore::JSXMLHttpRequestUpload::removeEventListener):
607         * bindings/objc/ObjCEventListener.h:
608         * bindings/objc/ObjCEventListener.mm:
609         (WebCore::ObjCEventListener::handleEvent):
610         * bindings/scripts/CodeGeneratorJS.pm:
611         * dom/EventTarget.cpp:
612         (WebCore::EventTarget::fireEventListeners):
613         * inspector/InspectorDOMAgent.cpp:
614         (WebCore::InspectorDOMAgent::handleEvent):
615         * inspector/InspectorDOMAgent.h:
616         * inspector/InspectorDOMStorageResource.cpp:
617         (WebCore::InspectorDOMStorageResource::handleEvent):
618         * inspector/InspectorDOMStorageResource.h:
619         * loader/ImageDocument.cpp:
620         (WebCore::ImageEventListener::handleEvent):
621         * svg/animation/SVGSMILElement.cpp:
622         (WebCore::ConditionEventListener::handleEvent):
623         * workers/WorkerContext.cpp:
624         (WebCore::WorkerContext::reportException):
625         Don't pass global object to JSEventListener::create(), which no longer needs it.
626         Note that some of these functions still have an early return for null global object, which
627         can probably be removed in a later patch.
628         Pass ScriptExecutionContext to EventListener methods that now need it.
629
630         * bindings/scripts/CodeGeneratorCOM.pm: Don't force EventTarget implementation on Node -
631         it doesn't work yet (it didn't quite work before this patch, too, because it assumed that
632         any object implementing EventTarget COM interface originated from WebCore).
633
634         * dom/EventListener.idl: Just like in ObjC, EventListener should be a pure interface in
635         COM bindings.
636
637 2009-09-28  Geoffrey Garen  <ggaren@apple.com>
638
639         Reviewed by Sam Weinig.
640
641         Removed virtual destructor from JSGlobalObjectData to eliminate pointer
642         fix-ups when accessing JSGlobalObject::d.
643         
644         Replaced with an explicit destructor function pointer.
645
646         * bindings/js/JSDOMGlobalObject.cpp:
647         (WebCore::JSDOMGlobalObject::destroyJSDOMGlobalObjectData):
648         * bindings/js/JSDOMGlobalObject.h:
649         (WebCore::JSDOMGlobalObject::JSDOMGlobalObjectData::JSDOMGlobalObjectData):
650
651 2009-09-29  Kenneth Rohde Christiansen  <kenneth@webkit.org>
652
653         Reviewed by Simon Hausmann.
654
655         Don't rely on QNetworkReply::NetworkError codes, but
656         on HTTP error codes instead.
657
658         * platform/network/qt/QNetworkReplyHandler.cpp:
659         (WebCore::ignoreHttpError):
660         (WebCore::QNetworkReplyHandler::finish):
661
662 2009-09-29  Kenneth Rohde Christiansen  <kenneth@webkit.org>
663
664         Reviewed by Simon Hausmann.
665
666         Use const references when using Qt's foreach.
667
668         * platform/network/qt/QNetworkReplyHandler.cpp:
669         (WebCore::QNetworkReplyHandler::sendResponseIfNeeded):
670
671 2009-09-29  Kenneth Rohde Christiansen  <kenneth@webkit.org>
672
673         Reviewed by Simon Hausmann.
674
675         Fix handling of QNetworkReply errors.
676
677         In the QNetworkReplyHandler::finish() a response was sent even when
678         the reply contained an error. This resulted in a sendResponseIfNeeded()
679         calling didReceiveResponse on the client, leading to the destruction
680         of the m_resourceHandle, discontinuing further processing in finish(),
681         and thus not calling didFail on the client.
682
683         Instead it continued as everything went fine, and
684         FrameLoaderClientQt::dispatchDecidePolicyForMIMEType() changed the
685         policy to PolicyDownload due to not being able to show the non existing
686         MIMEType. As the download also obviously fails, it ended up with a
687         policy change error.
688
689         * platform/network/qt/QNetworkReplyHandler.cpp:
690         (WebCore::QNetworkReplyHandler::finish):
691
692 2009-09-29  Kenneth Rohde Christiansen  <kenneth@webkit.org>
693
694         Reviewed by Simon Hausmann.
695
696         The code for showing error pages when the response was
697         a 401/403/404, was not actually doing so. This patch
698         fixes that.
699
700         * platform/network/qt/QNetworkReplyHandler.cpp:
701         (WebCore::QNetworkReplyHandler::finish):
702
703 2009-09-28  Alexey Proskuryakov  <ap@apple.com>
704
705         Reviewed by Brady Eidson.
706
707         <rdar://problem/7259965> REGRESSION: http/tests/xmlhttprequest/cross-origin-authorization.html
708         is failing/crashing intermittently
709         https://bugs.webkit.org/show_bug.cgi?id=29322
710
711         This was caused by CStringBuffer::encodeBase64() returning a buffer that wasn't zero terminated.
712         The code had other issues as well, so I removed it altogether:
713         - it claimed to avoid some buffer copies, but it didn't;
714         - and I don't think that base64 encoding should be part of CString interface.
715
716         * platform/network/mac/ResourceHandleMac.mm:
717         (WebCore::encodeBasicAuthorization): Encode username and password using Base64.h directly.
718         (WebCore::ResourceHandle::start): Use encodeBasicAuthorization().
719         (+[WebCoreSynchronousLoader loadRequest:allowStoredCredentials:returningResponse:error:]): Ditto.
720         (-[WebCoreSynchronousLoader connection:willSendRequest:redirectResponse:]): Extended logging
721         to synchronous case.
722         (-[WebCoreSynchronousLoader connectionShouldUseCredentialStorage:]): Ditto.
723         (-[WebCoreSynchronousLoader connection:didReceiveAuthenticationChallenge:]): Ditto.
724         (-[WebCoreSynchronousLoader connection:didReceiveResponse:]): Ditto.
725         (-[WebCoreSynchronousLoader connection:didReceiveData:]): Ditto.
726         (-[WebCoreSynchronousLoader connectionDidFinishLoading:]): Ditto.
727         (-[WebCoreSynchronousLoader connection:didFailWithError:]): Ditto.
728
729         * platform/network/cf/ResourceHandleCFNet.cpp: Matched Mac changes.
730
731         * platform/text/CString.cpp:
732         * platform/text/CString.h:
733         (WebCore::CStringBuffer::create):
734         (WebCore::CStringBuffer::CStringBuffer):
735         Removed code that was added for Base64 in r48363.
736
737 2009-09-29  Jedrzej Nowacki  <jedrzej.nowacki@nokia.com>
738
739         Reviewed by Simon Hausmann.
740
741         Fix typo in Localizations.cpp
742
743         https://bugs.webkit.org/show_bug.cgi?id=29872
744
745         * platform/qt/Localizations.cpp:
746         (WebCore::localizedMediaControlElementHelpText):
747
748 2009-09-29  Simon Hausmann  <simon.hausmann@nokia.com>
749
750         Reviewed by Tor Arne Vestbø.
751
752         Make the XSLT conditional in DOMWindow.idl's xsltProcessor
753         attribute conditional in the generated files, similar to
754         r44116.
755
756         * page/DOMWindow.idl:
757
758 2009-09-29  Kenneth Rohde Christiansen  <kenneth@webkit.org>
759
760         Reviewed by Simon Hausmann and Tor Arne Vestbø.
761
762         Use the ResourceError as it is supposed to and handle
763         not HTTP errors from QNetworkReply.
764
765         Thanks to Adam Roben for his input.
766
767         * platform/network/qt/QNetworkReplyHandler.cpp:
768         (WebCore::QNetworkReplyHandler::finish):
769
770 009-09-29  Pavel Feldman  <pfeldman@chromium.org>
771
772         Reviewed by Timothy Hatcher.
773
774         Web Inspector: Encapsulate JS listeners specifics into ScriptEventListener.
775
776         https://bugs.webkit.org/show_bug.cgi?id=29816
777
778         * bindings/js/ScriptEventListener.cpp:
779         (WebCore::getEventListenerHandlerBody):
780         * bindings/js/ScriptEventListener.h:
781         * bindings/v8/ScriptEventListener.cpp:
782         (WebCore::getEventListenerHandlerBody):
783         * bindings/v8/ScriptEventListener.h:
784         * inspector/InspectorDOMAgent.cpp:
785         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
786
787 2009-09-29  Xan Lopez  <xlopez@igalia.com>
788
789         Unreviewed attempt to fix the build.
790
791         * page/Settings.cpp:
792         (WebCore::Settings::Settings):
793
794 2009-09-28  Fumitoshi Ukai  <ukai@chromium.org>
795
796         Reviewed by Eric Seidel.
797
798         Add experimentalWebSocketsEnabled in Settings.
799         https://bugs.webkit.org/show_bug.cgi?id=28941
800
801         * WebCore.base.exp:
802         * bindings/js/JSDOMWindowCustom.cpp:
803         (WebCore::JSDOMWindow::webSocket):
804         * bindings/v8/V8DOMWrapper.cpp:
805         (WebCore::V8DOMWrapper::getConstructor):
806         * bindings/v8/custom/V8WebSocketCustom.cpp:
807         * page/Settings.cpp:
808         (WebCore::Settings::Settings):
809         (WebCore::Settings::setExperimentalWebSocketsEnabled):
810         * page/Settings.h:
811         (WebCore::Settings::experimentalWebSocketsEnabled):
812         
813 2009-09-11  Fumitoshi Ukai  <ukai@chromium.org>
814
815         Reviewed by Adam Barth.
816
817         Add platform code to support WebSocket for chromium.
818         https://bugs.webkit.org/show_bug.cgi?id=29171
819
820         To build within chromium tree, it requires a patch in bug 29174.
821         Real implementation will be landed in chromium tree.
822
823         * WebCore.gypi:
824         * platform/network/chromium/SocketStreamError.h: Added.
825         (WebCore::SocketStreamError::SocketStreamError):
826         * platform/network/chromium/SocketStreamHandle.h: Added.
827         (WebCore::SocketStreamHandle::create):
828
829 2009-09-28  Dan Bernstein  <mitz@apple.com>
830
831         Reviewed by Sam Weinig.
832
833         <rdar://problem/7157288> Crash in RenderStyle::computedLineHeight()
834         when Times New Roman is not installed
835
836         * platform/graphics/win/FontCacheWin.cpp:
837         (WebCore::FontCache::getLastResortFallbackFont): If Times New Roman is
838         not available, use the Windows default GUI font.
839
840 2009-09-28  Jian Li  <jianli@chromium.org>
841
842         Reviewed by David Levin.
843
844         Do not add platform-specific methods to cross-platform header
845         FileSystem.h per Darin's feedback for 29109.
846         https://bugs.webkit.org/show_bug.cgi?id=29830
847
848         * platform/FileSystem.h:
849         * platform/chromium/DragDataChromium.cpp:
850         (WebCore::DragData::asURL):
851         * platform/chromium/FileSystemChromium.cpp:
852
853 2009-09-28  Dumitru Daniliuc  <dumi@chromium.org>
854
855         Reviewed by Dimitri Glazkov.
856
857         Register Chromium's VFSs with a proper sqlite3_io_methods
858         finder. This should only affect the POSIX implementation. The
859         Windows change is included for consistency and in case sqlite
860         starts using something similar in its Windows VFS in the future.
861
862         https://bugs.webkit.org/show_bug.cgi?id=29743
863
864         * platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp:
865         (WebCore::SQLiteFileSystem::registerSQLiteVFS):
866         * platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp:
867         (WebCore::SQLiteFileSystem::registerSQLiteVFS):
868
869 2009-09-28  Nate Chapin  <japhet@chromium.org>
870
871         Reviewed by Adam Barth.
872
873         Change the V8 bindings' handling of window.toString(),
874         so we return [object DOMWindow] (like JSC), not [object global].
875
876         https://bugs.webkit.org/show_bug.cgi?id=29742
877
878         This will fix a couple of Chromium port test failures and enable us to
879         use the default expectations for a bunch more.
880
881         * bindings/v8/custom/V8DOMWindowCustom.cpp: Use the DOMWindow wrapper instead
882         of the global object wrapper when it's available in the DOMWindow toString callback.
883
884 2009-09-28  Nate Chapin  <japhet@chromium.org>
885
886         Rubber stamped by David Levin.
887
888         Chromium build fix, add back in #include of V8Proxy.h in V8WebKitPointConstructor.cpp.
889
890         * bindings/v8/custom/V8WebKitPointConstructor.cpp: Re-include V8Proxy.h.
891
892 2009-09-28  Geoffrey Garen  <ggaren@apple.com>
893
894         Reviewed by Darin Adler.
895
896         NotNullPassRefPtr: smart pointer optimized for passing references that are not null
897         https://bugs.webkit.org/show_bug.cgi?id=29822
898         
899         Added NotNullPassRefPtr, and deployed it in all places that initialize
900         JavaScript objects.
901
902         * bindings/js/DOMObjectWithSVGContext.h:
903         (WebCore::DOMObjectWithSVGContext::DOMObjectWithSVGContext):
904         * bindings/js/JSDOMBinding.cpp:
905         (WebCore::cacheDOMStructure):
906         * bindings/js/JSDOMBinding.h:
907         (WebCore::DOMObject::DOMObject):
908         (WebCore::DOMObjectWithGlobalPointer::DOMObjectWithGlobalPointer):
909         (WebCore::DOMConstructorObject::DOMConstructorObject):
910         (WebCore::DOMConstructorWithDocument::DOMConstructorWithDocument):
911         * bindings/js/JSDOMGlobalObject.cpp:
912         (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
913         * bindings/js/JSDOMGlobalObject.h:
914         * bindings/js/JSDOMWindowBase.cpp:
915         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
916         * bindings/js/JSDOMWindowBase.h:
917         * bindings/js/JSHTMLAllCollection.h:
918         (WebCore::JSHTMLAllCollection::JSHTMLAllCollection):
919         * bindings/js/JSInspectedObjectWrapper.cpp:
920         (WebCore::JSInspectedObjectWrapper::JSInspectedObjectWrapper):
921         * bindings/js/JSInspectedObjectWrapper.h:
922         * bindings/js/JSInspectorCallbackWrapper.cpp:
923         (WebCore::JSInspectorCallbackWrapper::JSInspectorCallbackWrapper):
924         * bindings/js/JSInspectorCallbackWrapper.h:
925         * bindings/js/JSQuarantinedObjectWrapper.cpp:
926         (WebCore::JSQuarantinedObjectWrapper::JSQuarantinedObjectWrapper):
927         * bindings/js/JSQuarantinedObjectWrapper.h:
928         * bindings/js/JSWorkerContextBase.cpp:
929         (WebCore::JSWorkerContextBase::JSWorkerContextBase):
930         * bindings/js/JSWorkerContextBase.h:
931         * bindings/scripts/CodeGeneratorJS.pm:
932         * bridge/runtime_object.cpp:
933         (JSC::RuntimeObjectImp::RuntimeObjectImp):
934         * bridge/runtime_object.h:
935
936 2009-09-28  Nate Chapin  <japhet@chromium.org>
937
938         Reviewed by Dimitri Glazkov.
939
940         Allow V8 to handle x/y parameters in a WebKitPoint constructor.
941         https://bugs.webkit.org/show_bug.cgi?id=29823
942
943         Fixes V8's handling of LayoutTests/fast/dom/Window/webkitConvertPoint.html
944
945         * bindings/v8/custom/V8WebKitPointConstructor.cpp: Allow for x/y parameters in constructor.
946
947 2009-09-28  Mark Rowe  <mrowe@apple.com>
948
949         Fix the build by doing something approximating reasonableness in the Xcode project.
950
951         * WebCore.xcodeproj/project.pbxproj:
952
953 2009-09-28  Simon Hausmann  <hausmann@webkit.org>
954
955         Prospective Tiger build fix.
956
957         * WebCore.xcodeproj/project.pbxproj: Try to use unique IDs for the new files.
958
959 2009-09-28  Pavel Feldman  <pfeldman@chromium.org>
960
961         Reviewed by Timothy Hatcher.
962
963         Web Inspector: Add explicit frontend event for commit load.
964
965         https://bugs.webkit.org/show_bug.cgi?id=29814
966
967         * inspector/InspectorController.cpp:
968         (WebCore::InspectorController::didCommitLoad):
969         * inspector/InspectorFrontend.cpp:
970         (WebCore::InspectorFrontend::didCommitLoad):
971         * inspector/InspectorFrontend.h:
972         * inspector/front-end/DOMAgent.js:
973         (WebInspector.DOMAgent.prototype._setDocument):
974         * inspector/front-end/inspector.js:
975         (WebInspector.addResource):
976         (WebInspector.didCommitLoad):
977
978 2009-09-28  Yaar Schnitman  <yaar@chromium.org>
979
980         Reviewed by Dimitri Glazkov.
981
982         Chromium port - recognize we are being built independently
983         of chromium and look for dependencies under webkit/chromium rather
984         than chromium/src.
985
986         https://bugs.webkit.org/show_bug.cgi?id=29722
987
988         * WebCore.gyp/WebCore.gyp: See above. Also removed a few files from
989           the sources list, since they are not supposed to be built here.
990
991 2009-09-28  Jakub Wieczorek  <faw217@gmail.com>
992
993         Reviewed by Simon Hausmann.
994
995         [Qt] Implement XSLT support with QtXmlPatterns.
996         https://bugs.webkit.org/show_bug.cgi?id=28303
997
998         * GNUmakefile.am:
999         * WebCore.gypi:
1000         * WebCore.pro:
1001         * WebCore.vcproj/WebCore.vcproj:
1002         * WebCoreSources.bkl:
1003         * dom/Document.cpp:
1004         (WebCore::Document::Document):
1005         (WebCore::Document::~Document):
1006         (WebCore::Document::setTransformSource):
1007         * dom/Document.h:
1008         (WebCore::Document::transformSource):
1009         * dom/TransformSource.h: Added.
1010         (WebCore::TransformSource::platformSource):
1011         * dom/TransformSourceLibxslt.cpp: Added.
1012         (WebCore::TransformSource::TransformSource): Wraps a libxml2 document.
1013         (WebCore::TransformSource::~TransformSource):
1014         * dom/TransformSourceQt.cpp: Added.
1015         (WebCore::TransformSource::TransformSource): Wraps a plain string.
1016         (WebCore::TransformSource::~TransformSource):
1017         * dom/XMLTokenizerLibxml2.cpp:
1018         (WebCore::XMLTokenizer::doEnd):
1019         * dom/XMLTokenizerQt.cpp:
1020         (WebCore::XMLTokenizer::doEnd):
1021         (WebCore::XMLTokenizer::parseProcessingInstruction):
1022         * xml/XSLStyleSheet.h:
1023         (WebCore::XSLStyleSheet::sheetString):
1024         * xml/XSLStyleSheetLibxslt.cpp:
1025         (WebCore::XSLStyleSheet::document):
1026         * xml/XSLStyleSheetQt.cpp: Added.
1027         * xml/XSLTProcessor.h:
1028         * xml/XSLTProcessorLibxslt.cpp:
1029         (WebCore::xmlDocPtrFromNode):
1030         * xml/XSLTProcessorQt.cpp: Added.
1031         (WebCore::XSLTMessageHandler::XSLTMessageHandler): A subclass of QAbstractMessageHandler.
1032         (WebCore::XSLTMessageHandler::handleMessage): Forwards all processor messages to the Console.
1033         (WebCore::XSLTProcessor::transformToString): Uses QXmlQuery.
1034
1035 2009-09-28  Andrew Scherkus  <scherkus@chromium.org>
1036
1037         Reviewed by Eric Carlson.
1038
1039         Delegate implementation of rendererIsNeeded() for media control elements to RenderTheme.
1040
1041         https://bugs.webkit.org/show_bug.cgi?id=28689
1042
1043         Covered by LayoutTests/media/video-no-audio.html
1044
1045         * rendering/MediaControlElements.cpp: Removed subclass implementations of rendererIsNeeded().
1046         (WebCore::MediaControlElement::rendererIsNeeded): Include calling shouldRenderMediaControlPart().
1047         (WebCore::MediaControlInputElement::rendererIsNeeded): Include calling shouldRenderMediaControlPart().
1048         * rendering/MediaControlElements.h:
1049         * rendering/RenderTheme.cpp:
1050         (WebCore::RenderTheme::shouldRenderMediaControlPart): New method.  Contains logic moved from subclass implementations of rendererIsNeeded().
1051         * rendering/RenderTheme.h:
1052         * rendering/RenderThemeChromiumSkia.cpp:
1053         (WebCore::RenderThemeChromiumSkia::shouldRenderMediaControlPart): Override to always render mute button.
1054         * rendering/RenderThemeChromiumSkia.h:
1055
1056 2009-09-28  Jian Li  <jianli@chromium.org>
1057
1058         Reviewed by David Levin.
1059
1060         [chromium] DragData::asURL should return file URL.
1061         https://bugs.webkit.org/show_bug.cgi?id=29109
1062
1063         Tested by LayoutTests/fast/events/drag-to-navigate.html.
1064
1065         * platform/FileSystem.h:
1066         * platform/chromium/ChromiumBridge.h:
1067         * platform/chromium/DragDataChromium.cpp:
1068         (WebCore::DragData::asURL):
1069         * platform/chromium/FileSystemChromium.cpp:
1070         (WebCore::getAbsolutePath):
1071         (WebCore::isDirectory):
1072         (WebCore::filePathToURL):
1073
1074 2009-09-28  Dimitri Glazkov  <dglazkov@chromium.org>
1075
1076         Reviewed by David Levin.
1077
1078         [V8] Add a special case to handle index arguments, because we need to be
1079         able to see if they're < 0.
1080         https://bugs.webkit.org/show_bug.cgi?id=29810
1081
1082         Test: LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.html
1083
1084         * bindings/scripts/CodeGeneratorV8.pm: Added special case (matching CodeGeneratorJS.pm)
1085           for index arguments.
1086
1087 2009-09-28  Dan Bernstein  <mitz@apple.com>
1088
1089         Reviewed by Darin Adler.
1090
1091         Extend the MediaWiki/KHTMLFixes.css workaround to cover older MediaWiki versions
1092         https://bugs.webkit.org/show_bug.cgi?id=29792
1093
1094         * html/HTMLLinkElement.cpp:
1095         (WebCore::HTMLLinkElement::setCSSStyleSheet): If site specific hacks are
1096         enabled, check if the linked style sheet is one of two versions of the
1097         MediaWiki KHTMLFixes.css. If so, remove the offending rule.
1098
1099 2009-09-28  Dimitri Glazkov  <dglazkov@chromium.org>
1100
1101         Reviewed by Adam Barth.
1102
1103         [V8] Fix an error in type logic in CodeGeneratorV8.pm, where
1104         unsigned ints are accidentally used as signed.
1105         https://bugs.webkit.org/show_bug.cgi?id=29810
1106
1107         Test: LayoutTests/fast/forms/textarea-maxlength.html
1108
1109         * bindings/scripts/CodeGeneratorV8.pm: Made sure "unsigned long" in IDL is
1110           properly generates on "unsigned" return value.
1111
1112 2009-09-28  Jakub Wieczorek  <faw217@gmail.com>
1113
1114         Reviewed by Simon Hausmann.
1115
1116         Rename XSLStyleSheet.cpp to XSLStyleSheetLibxslt.cpp.
1117         https://bugs.webkit.org/show_bug.cgi?id=28303
1118
1119         In preparation for adding XSLT support with QtXmlPatterns to the Qt
1120         port, rename XSLStyleSheet.cpp to XSLStyleSheetLibxslt.cpp as we will
1121         have our own implementation which most likely will not share any code
1122         with the current one.
1123
1124         Additionally, fix some coding style issues.
1125
1126         * GNUmakefile.am:
1127         * WebCore.gypi:
1128         * WebCore.vcproj/WebCore.vcproj:
1129         * WebCore.xcodeproj/project.pbxproj:
1130         * WebCoreSources.bkl:
1131         * xml/XSLStyleSheet.cpp: Renamed to XSLStyleSheetLibxslt.cpp.
1132         * xml/XSLStyleSheetLibxslt.cpp: Added.
1133
1134 2009-09-28  Simon Hausmann  <simon.hausmann@nokia.com>
1135
1136         Prospective build fix for r48812.
1137
1138         Forgot to remove the inline reset() implementation when reverting the indentation
1139         changes in the file.
1140
1141         * xml/XSLTProcessor.h:
1142
1143 2009-09-28  Pavel Feldman  <pfeldman@chromium.org>
1144
1145         Reviewed by nobody (trivial follow up fix), Joseph Pecoraro LGTM-ed.
1146
1147         Web Inspector: Follow up to r48809.
1148         InspectorController.wrapObject should only be called on the inspectable page side.
1149
1150         https://bugs.webkit.org/show_bug.cgi?id=17429
1151
1152         * inspector/front-end/EventListenersSidebarPane.js:
1153         (WebInspector.EventListenersSidebarPane.prototype.update.callback):
1154         (WebInspector.EventListenersSidebarPane.prototype.update):
1155         (WebInspector.EventListenersSection):
1156         (WebInspector.EventListenersSection.prototype.update):
1157         (WebInspector.EventListenerBar):
1158         (WebInspector.EventListenerBar.prototype.update):
1159
1160 2009-09-28  Jakub Wieczorek  <faw217@gmail.com>
1161
1162         Reviewed by Simon Hausmann.
1163
1164         Move the libxslt specific part of XSLTProcessor to a separate file.
1165         https://bugs.webkit.org/show_bug.cgi?id=28303
1166
1167         In preparation for adding XSLT support with QtXmlPatterns to the Qt
1168         port, move the libxslt part of the XSLTProcessor implementation into
1169         another file and leave the part that can be reused and shared.
1170
1171         Additionally, fix some coding style issues.
1172
1173         * GNUmakefile.am:
1174         * WebCore.gypi:
1175         * WebCore.vcproj/WebCore.vcproj:
1176         * WebCore.xcodeproj/project.pbxproj:
1177         * WebCoreSources.bkl:
1178         * xml/XSLTProcessor.cpp:
1179         (WebCore::XSLTProcessor::createDocumentFromSource): Remove trailing whitespaces.
1180         (WebCore::createFragmentFromSource): Remove trailing whitespaces.
1181         (WebCore::XSLTProcessor::transformToFragment): Remove trailing whitespaces.
1182         (WebCore::XSLTProcessor::reset): Moved out of the class definition.
1183         * xml/XSLTProcessorLibxslt.cpp: Added.
1184         (WebCore::XSLTProcessor::genericErrorFunc): Moved.
1185         (WebCore::XSLTProcessor::parseErrorFunc): Moved.
1186         (WebCore::docLoaderFunc): Moved.
1187         (WebCore::setXSLTLoadCallBack): Moved.
1188         (WebCore::writeToVector): Moved.
1189         (WebCore::saveResultToString): Moved.
1190         (WebCore::xsltParamArrayFromParameterMap): Moved.
1191         (WebCore::freeXsltParamArray): Moved.
1192         (WebCore::xsltStylesheetPointer): Moved.
1193         (WebCore::xmlDocPtrFromNode): Moved.
1194         (WebCore::resultMIMEType): Moved.
1195         (WebCore::XSLTProcessor::transformToString): Moved.
1196
1197 2009-09-28  Charles Wei  <charles.wei@torchmobile.com.cn>
1198
1199         Reviewed by Nikolas Zimmermann.
1200
1201         Fix the crash of SVG that crashes when use a non-exist symbol
1202         https://bugs.webkit.org/show_bug.cgi?id=27693
1203
1204         Test: svg/custom/use-non-existing-symbol-crash.svg
1205
1206         * svg/SVGUseElement.cpp:
1207         (WebCore::shadowTreeContainsChangedNodes):
1208
1209 2009-09-28  Joseph Pecoraro  <joepeck@webkit.org>
1210
1211         Reviewed by Timothy Hatcher.
1212
1213         Inspector Should Show Event Listeners/Handlers Registered on each Node
1214         https://bugs.webkit.org/show_bug.cgi?id=17429
1215         
1216           Extracted a method from dispatchEvent to get the event ancestor chain
1217         
1218         * dom/Node.cpp:
1219         (WebCore::Node::eventAncestors): the extracted method
1220         (WebCore::Node::dispatchGenericEvent): use eventAncestors
1221         * dom/Node.h:
1222
1223           Asynchronous Flow For the Inspector, Backend -> DOM Agent -> Frontend
1224           The DOMAgent's getEventListenersForNode handles the logic of finding
1225           all the relevant listeners in the event flow.
1226
1227         * inspector/InspectorBackend.cpp:
1228         (WebCore::InspectorBackend::getEventListenersForNode):
1229         * inspector/InspectorBackend.h:
1230         * inspector/InspectorBackend.idl:
1231         * inspector/InspectorDOMAgent.cpp:
1232         (WebCore::InspectorDOMAgent::getEventListenersForNode):
1233         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1234         (WebCore::InspectorDOMAgent::buildObjectForNode): added localName
1235         * inspector/InspectorDOMAgent.h:
1236         (WebCore::EventListenerInfo::EventListenerInfo):
1237         * inspector/InspectorFrontend.cpp:
1238         (WebCore::InspectorFrontend::didGetEventListenersForNode):
1239         * inspector/InspectorFrontend.h:
1240         (WebCore::InspectorFrontend::scriptState):
1241         * inspector/front-end/DOMAgent.js: added localName to WebInspector.DOMNode from payload
1242         (WebInspector.EventListeners.getEventListenersForNodeAsync.mycallback):
1243         (WebInspector.EventListeners.getEventListenersForNodeAsync):
1244
1245           New Sidebar Pane in the Element's Panel
1246           Includes Gear Menu for filtering the Event Listeners on the
1247           "Selected Node Only" or "All Nodes"
1248
1249         * inspector/front-end/ElementsPanel.js: Handles refreshing the Pane when necessary
1250         (WebInspector.ElementsPanel.this.treeOutline.focusedNodeChanged):
1251         (WebInspector.ElementsPanel):
1252         (WebInspector.ElementsPanel.prototype.updateEventListeners):
1253         * inspector/front-end/EventListenersSidebarPane.js: Added. 
1254         (WebInspector.EventListenersSidebarPane): The 1st level in the Pane
1255         (WebInspector.EventListenersSidebarPane.prototype.update.callback):
1256         (WebInspector.EventListenersSidebarPane.prototype.update):
1257         (WebInspector.EventListenersSection): The 2nd level in the Pane
1258         (WebInspector.EventListenersSection.prototype.update): filters on Preference
1259         (WebInspector.EventListenersSection.prototype.addListener):
1260         (WebInspector.EventListenerBar): The 3rd level in the Pane
1261         (WebInspector.EventListenerBar.prototype._getNodeDisplayName):
1262         (WebInspector.EventListenerBar.prototype._getFunctionDisplayName):
1263         (WebInspector.EventListenersSidebarPane.prototype._changeSetting): For the Gear Menu
1264         
1265           Consolidated "appropriateSelectorForNode"
1266
1267         * inspector/front-end/StylesSidebarPane.js:
1268         * inspector/front-end/utilities.js:
1269
1270           Miscellaneous Updates
1271
1272         * English.lproj/localizedStrings.js: "Event Listeners", "No Event Listeners", "Selected Node Only", "All Nodes"
1273         * WebCore.gypi: included the new inspector files
1274         * WebCore.vcproj/WebCore.vcproj: included source files that were missing
1275         * inspector/front-end/Images/grayConnectorPoint.png: Added. Thanks to Timothy Hatcher.
1276         * inspector/front-end/Images/whiteConnectorPoint.png: Added. Thanks to Timothy Hatcher.
1277         * inspector/front-end/inspector.js: Preferences for the Gear Menu Event Listeners filter
1278         * inspector/front-end/inspector.css: reused as much as possible
1279         * inspector/front-end/inspector.html: include the new script
1280         * inspector/front-end/WebKit.qrc: included the new inspector files
1281
1282 2009-09-27  Sam Weinig  <sam@webkit.org>
1283
1284         Reviewed by Dan Bernstein.
1285
1286         Fix for https://bugs.webkit.org/show_bug.cgi?id=29760
1287         Implement CSSOM Range.getClientRects/getBoundingClientRect 
1288
1289         Tests: fast/dom/Range/getBoundingClientRect-getClientRects-relative-to-viewport.html
1290                fast/dom/Range/getBoundingClientRect.html
1291                fast/dom/Range/getClientRects.html
1292
1293         * dom/Range.cpp:
1294         (WebCore::Range::getClientRects):
1295         (WebCore::Range::getBoundingClientRect):
1296         (WebCore::adjustFloatQuadsForScrollAndAbsoluteZoom):
1297         (WebCore::Range::getBorderAndTextQuads):
1298         * dom/Range.h:
1299         * dom/Range.idl:
1300         Implement Range.getClientRects/getBoundingClientRect.
1301
1302         * dom/Element.cpp:
1303         * rendering/RenderObject.h: 
1304         (WebCore::adjustForAbsoluteZoom):
1305         (WebCore::adjustIntRectForAbsoluteZoom):
1306         (WebCore::adjustFloatPointForAbsoluteZoom):
1307         (WebCore::adjustFloatQuadForAbsoluteZoom):
1308         Move point/quad adjustment methods from Element.cpp to RenderObject.h
1309         so that Range.cpp can use them as well.
1310
1311 2009-09-27  Simon Hausmann  <hausmann@webkit.org>
1312
1313         Unreviewed fix for WebInspector with Qt build.
1314
1315         Simply re-generate the Qt resource file by running
1316         WebKitTools/Scripts/generate-qt-inspector-resource
1317
1318         * inspector/front-end/WebKit.qrc:
1319
1320 2009-09-27  Pavel Feldman  <pfeldman@chromium.org>
1321
1322         Reviewed by nobody (trivial ChangeLog fix).
1323
1324         Restore WebCore/ChangeLog truncated in r48778.
1325
1326 2009-09-27  Pavel Feldman  <pfeldman@chromium.org>
1327
1328         Reviewed by Timothy Hatcher.
1329
1330         Web Inspector: DOM store is being unbound twice, leading to assertion failure.
1331
1332         https://bugs.webkit.org/show_bug.cgi?id=29770
1333
1334         * inspector/InspectorController.cpp:
1335         (WebCore::InspectorController::didOpenDatabase):
1336         (WebCore::InspectorController::didUseDOMStorage):
1337         * inspector/InspectorDOMStorageResource.cpp:
1338         (WebCore::InspectorDOMStorageResource::unbind):
1339
1340 2009-09-26  Pavel Feldman  <pfeldman@chromium.org>
1341
1342         Reviewed by Timothy Hatcher.
1343
1344         Web Inspector: Do not track DOM changes while inspector window is closed.
1345
1346         https://bugs.webkit.org/show_bug.cgi?id=29769
1347
1348         * inspector/InspectorController.cpp:
1349         (WebCore::InspectorController::inspectedWindowScriptObjectCleared):
1350         (WebCore::InspectorController::populateScriptObjects):
1351         (WebCore::InspectorController::resetScriptObjects):
1352         (WebCore::InspectorController::didCommitLoad):
1353         * inspector/InspectorController.h:
1354         * inspector/InspectorDOMAgent.cpp:
1355         (WebCore::InspectorDOMAgent::setDocument):
1356         * inspector/InspectorDOMAgent.h:
1357         * loader/FrameLoader.cpp:
1358         (WebCore::FrameLoader::dispatchWindowObjectAvailable):
1359         * page/android/InspectorControllerAndroid.cpp:
1360         (WebCore::InspectorController::inspectedWindowScriptObjectCleared):
1361
1362 2009-09-26  Pavel Feldman  <pfeldman@chromium.org>
1363
1364         Reviewed by Timothy Hatcher.
1365
1366         Web Inspector: [REGRESSION] Double Clicking Resources Fails to Open in New Window
1367
1368         https://bugs.webkit.org/show_bug.cgi?id=29762
1369
1370         * inspector/front-end/InjectedScript.js:
1371         (InjectedScript.setStyleText):
1372         (InjectedScript.openInInspectedWindow):
1373         * inspector/front-end/InjectedScriptAccess.js:
1374         * inspector/front-end/ResourcesPanel.js:
1375         (WebInspector.ResourceSidebarTreeElement.prototype.ondblclick):
1376
1377 2009-09-26  David Kilzer  <ddkilzer@apple.com>
1378
1379         Part 2 of 2: <http://webkit.org/b/29753> DerivedSources.make broken for non-Mac targets
1380
1381         Reviewed by Darin Adler.
1382
1383         Fix ENABLE_ORIENTATION_EVENTS for non-Mac platforms.
1384
1385         * DerivedSources.make: Moved Platform.h check for
1386         ENABLE_ORIENTATION_EVENTS into Mac-only section and added
1387         default of ENABLE_ORIENTATION_EVENTS = 0 to non-Mac section.
1388         Added ifndef test to make it possible to override both
1389         ENABLE_DASHBOARD_SUPPORT and ENABLE_ORIENTATION_EVENTS external
1390         to the makefile.  Moved addition of ENABLE_ORIENTATION_EVENTS to
1391         ADDITIONAL_IDL_DEFINES to common section.
1392         * GNUmakefile.am: Added support for ENABLE_ORIENTATION_EVENTS if
1393         it is ever used.
1394         * WebCore.pro: Ditto.
1395
1396 2009-09-26  Kent Tamura  <tkent@chromium.org>
1397
1398         Reviewed by David Kilzer.
1399
1400         Move placeholder-related code to HTMLTextFormControlElement from
1401         HTMLInputElement, WMLInputElement, InputElement, and
1402         HTMLTextAreaElement.
1403         https://bugs.webkit.org/show_bug.cgi?id=28703
1404
1405         * dom/InputElement.cpp:
1406         (WebCore::InputElement::dispatchFocusEvent):
1407         (WebCore::InputElement::dispatchBlurEvent):
1408         (WebCore::InputElement::setValueFromRenderer):
1409         * dom/InputElement.h:
1410         * html/HTMLFormControlElement.cpp:
1411         (WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement):
1412         (WebCore::HTMLTextFormControlElement::~HTMLTextFormControlElement):
1413         (WebCore::HTMLTextFormControlElement::dispatchFocusEvent):
1414         (WebCore::HTMLTextFormControlElement::dispatchBlurEvent):
1415         (WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible):
1416         (WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
1417         * html/HTMLFormControlElement.h:
1418         (WebCore::HTMLTextFormControlElement::handleFocusEvent):
1419         (WebCore::HTMLTextFormControlElement::handleBlurEvent):
1420         * html/HTMLInputElement.cpp:
1421         (WebCore::HTMLInputElement::HTMLInputElement):
1422         (WebCore::HTMLInputElement::handleFocusEvent):
1423         (WebCore::HTMLInputElement::handleBlurEvent):
1424         (WebCore::HTMLInputElement::parseMappedAttribute):
1425         (WebCore::HTMLInputElement::createRenderer):
1426         (WebCore::HTMLInputElement::setValue):
1427         (WebCore::HTMLInputElement::setValueFromRenderer):
1428         * html/HTMLInputElement.h:
1429         (WebCore::HTMLInputElement::supportsPlaceholder):
1430         (WebCore::HTMLInputElement::isEmptyValue):
1431         * html/HTMLIsIndexElement.cpp:
1432         (WebCore::HTMLIsIndexElement::parseMappedAttribute):
1433         * html/HTMLTextAreaElement.cpp:
1434         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement):
1435         (WebCore::HTMLTextAreaElement::createRenderer):
1436         * html/HTMLTextAreaElement.h:
1437         (WebCore::HTMLTextAreaElement::supportsPlaceholder):
1438         (WebCore::HTMLTextAreaElement::isEmptyValue):
1439         * rendering/RenderTextControl.cpp:
1440         (WebCore::RenderTextControl::RenderTextControl):
1441         * rendering/RenderTextControl.h:
1442         * rendering/RenderTextControlMultiLine.cpp:
1443         (WebCore::RenderTextControlMultiLine::RenderTextControlMultiLine):
1444         * rendering/RenderTextControlMultiLine.h:
1445         * rendering/RenderTextControlSingleLine.cpp:
1446         (WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
1447         (WebCore::RenderTextControlSingleLine::updateFromElement):
1448         * rendering/RenderTextControlSingleLine.h:
1449         * wml/WMLInputElement.cpp:
1450         (WebCore::WMLInputElement::setValue):
1451         (WebCore::WMLInputElement::createRenderer):
1452         * wml/WMLInputElement.h:
1453
1454 2009-09-26  Shu Chang  <Chang.Shu@nokia.com>
1455
1456         Reviewed by Alexey Proskuryakov.
1457
1458         Optimize the code so only the text from start to end is scanned.
1459         https://bugs.webkit.org/show_bug.cgi?id=29092
1460
1461         On a platform with webkit+Qt+Symbian, the parsing time for a 600K text
1462         file improved from 400ms to 40ms (10x faster).
1463
1464         * dom/Text.cpp:
1465         (WebCore::Text::createWithLengthLimit):
1466
1467 2009-09-26  Xiaomei Ji  <xji@chromium.org>
1468
1469         Reviewed by Eric Seidel.
1470
1471         This Patch fixes [chromium] the drop-down is always left-aligned even
1472         for RTL element.
1473         https://bugs.webkit.org/show_bug.cgi?id=29612
1474
1475         For auto-complete, the items in drop-down should be right-aligned if
1476         the directionality of <input> field is RTL.
1477         For <select><option>, the items in drop-down should be right-aligned
1478         if the directionality of <select> is RTL.
1479
1480         No automatic test is possible. Manual tests are added.
1481
1482         * manual-tests/autofill_alignment.html: Added.
1483         * manual-tests/select_alignment.html: Added.
1484         * platform/chromium/PopupMenuChromium.cpp:
1485         (WebCore::PopupListBox::paintRow): Adjust the starting x-axis of text to
1486         be paint if it should be right-aligned.
1487
1488 2009-09-25  Dan Bernstein  <mitz@apple.com>
1489
1490         Reviewed by Sam Weinig.
1491
1492         REGRESSION (r48775) FontList.plist written by TOT WebKit causes Safari 4
1493         to crash on launch
1494         https://bugs.webkit.org/show_bug.cgi?id=29759
1495
1496         * platform/graphics/win/FontDatabase.cpp:
1497         (WebCore::writeFontDatabaseToPlist): Reverted to saving the CG font DB
1498         property list at the root of FontList.plist, but with an additional
1499         key for the last value of the Fonts registry key.
1500         (WebCore::populateFontDatabase): Pass the FontList.plist in its entirety
1501         to populatFontDatabaseFromPlist.
1502
1503 2009-09-25  Kevin Ollivier  <kevino@theolliviers.com>
1504
1505         Build fix. Adding missing header files.
1506
1507         * bindings/js/JSNamedNodeMapCustom.cpp:
1508
1509 2009-09-25  David Kilzer  <ddkilzer@apple.com>
1510
1511         Part 1 of 2: <http://webkit.org/b/29753> DerivedSources.make broken for non-Mac targets
1512
1513         Reviewed by Darin Adler.
1514
1515         * DerivedSources.make: Move tests for ENABLE_CONTEXT_MENUS,
1516         ENABLE_DRAG_SUPPORT and ENABLE_INSPECTOR into Mac-only section.
1517
1518 2009-09-25  Adam Barth  <abarth@webkit.org>
1519
1520         Reviewed by Darin Adler.
1521
1522         Load blocks during unload should not affect targeted loads
1523         https://bugs.webkit.org/show_bug.cgi?id=29747
1524
1525         Move the check of the unload state after checking for targeted links.
1526
1527         Test: fast/loader/unload-hyperlink-targeted.html
1528
1529         * loader/FrameLoader.cpp:
1530         (WebCore::FrameLoader::loadURL):
1531
1532 2009-09-25  Kenneth Russell  <kbr@google.com>
1533
1534         Reviewed by Dimitri Glazkov.
1535
1536         [Chromium] Add initial V8 bindings for WebGL
1537         https://bugs.webkit.org/show_bug.cgi?id=29664
1538
1539         * WebCore.gypi:
1540         * bindings/scripts/CodeGeneratorV8.pm:
1541         * bindings/v8/DOMObjectsInclude.h:
1542         * bindings/v8/DerivedSourcesAllInOne.cpp:
1543         * bindings/v8/V8DOMWrapper.cpp:
1544         (WebCore::V8DOMWrapper::getTemplate):
1545         * bindings/v8/V8Index.cpp:
1546         * bindings/v8/V8Index.h:
1547         * bindings/v8/custom/V8CanvasArrayBufferCustom.cpp: Added.
1548         (WebCore::CALLBACK_FUNC_DECL):
1549         * bindings/v8/custom/V8CanvasArrayCustom.h: Added.
1550         (WebCore::constructCanvasArray):
1551         * bindings/v8/custom/V8CanvasByteArrayCustom.cpp: Added.
1552         (WebCore::CALLBACK_FUNC_DECL):
1553         (WebCore::INDEXED_PROPERTY_GETTER):
1554         (WebCore::INDEXED_PROPERTY_SETTER):
1555         * bindings/v8/custom/V8CanvasFloatArrayCustom.cpp: Added.
1556         (WebCore::CALLBACK_FUNC_DECL):
1557         (WebCore::INDEXED_PROPERTY_GETTER):
1558         (WebCore::INDEXED_PROPERTY_SETTER):
1559         * bindings/v8/custom/V8CanvasIntArrayCustom.cpp: Added.
1560         (WebCore::CALLBACK_FUNC_DECL):
1561         (WebCore::INDEXED_PROPERTY_GETTER):
1562         (WebCore::INDEXED_PROPERTY_SETTER):
1563         * bindings/v8/custom/V8CanvasRenderingContext3DCustom.cpp: Added.
1564         (WebCore::jsArrayToFloatArray):
1565         (WebCore::jsArrayToIntArray):
1566         (WebCore::CALLBACK_FUNC_DECL):
1567         (WebCore::):
1568         (WebCore::vertexAttribAndUniformHelperf):
1569         (WebCore::uniformHelperi):
1570         (WebCore::uniformMatrixHelper):
1571         * bindings/v8/custom/V8CanvasShortArrayCustom.cpp: Added.
1572         (WebCore::CALLBACK_FUNC_DECL):
1573         (WebCore::INDEXED_PROPERTY_GETTER):
1574         (WebCore::INDEXED_PROPERTY_SETTER):
1575         * bindings/v8/custom/V8CanvasUnsignedByteArrayCustom.cpp: Added.
1576         (WebCore::CALLBACK_FUNC_DECL):
1577         (WebCore::INDEXED_PROPERTY_GETTER):
1578         (WebCore::INDEXED_PROPERTY_SETTER):
1579         * bindings/v8/custom/V8CanvasUnsignedIntArrayCustom.cpp: Added.
1580         (WebCore::CALLBACK_FUNC_DECL):
1581         (WebCore::INDEXED_PROPERTY_GETTER):
1582         (WebCore::INDEXED_PROPERTY_SETTER):
1583         * bindings/v8/custom/V8CanvasUnsignedShortArrayCustom.cpp: Added.
1584         (WebCore::CALLBACK_FUNC_DECL):
1585         (WebCore::INDEXED_PROPERTY_GETTER):
1586         (WebCore::INDEXED_PROPERTY_SETTER):
1587         * bindings/v8/custom/V8CustomBinding.h:
1588         * bindings/v8/custom/V8DocumentCustom.cpp:
1589         (WebCore::CALLBACK_FUNC_DECL):
1590         * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
1591         (WebCore::CALLBACK_FUNC_DECL):
1592         * platform/graphics/GraphicsContext3D.h:
1593
1594 2009-09-25  Jeremy Orlow  <jorlow@chromium.org>
1595
1596         This is breaking Chromium try bots, so I'm counting this as a build fix.
1597
1598         Add more svn:ignore exceptions.  On different platforms, these files are
1599         generated with different case for WebCore.
1600
1601         * WebCore.gyp: Changed property svn:ignore.
1602
1603 2009-09-25  Alexey Proskuryakov  <ap@apple.com>
1604
1605         Reverting r48767, as it broke Windows build in a non-trivial way.
1606
1607         * bindings/js/JSAbstractWorkerCustom.cpp:
1608         (WebCore::JSAbstractWorker::addEventListener):
1609         (WebCore::JSAbstractWorker::removeEventListener):
1610         * bindings/js/JSDOMApplicationCacheCustom.cpp:
1611         (WebCore::JSDOMApplicationCache::addEventListener):
1612         (WebCore::JSDOMApplicationCache::removeEventListener):
1613         * bindings/js/JSDOMGlobalObject.cpp:
1614         (WebCore::JSDOMGlobalObject::createJSAttributeEventListener):
1615         * bindings/js/JSDOMWindowCustom.cpp:
1616         (WebCore::JSDOMWindow::addEventListener):
1617         (WebCore::JSDOMWindow::removeEventListener):
1618         * bindings/js/JSEventListener.cpp:
1619         (WebCore::JSEventListener::JSEventListener):
1620         (WebCore::JSEventListener::jsFunction):
1621         (WebCore::JSEventListener::markJSFunction):
1622         (WebCore::JSEventListener::handleEvent):
1623         (WebCore::JSEventListener::reportError):
1624         * bindings/js/JSEventListener.h:
1625         (WebCore::JSEventListener::create):
1626         * bindings/js/JSEventSourceCustom.cpp:
1627         (WebCore::JSEventSource::addEventListener):
1628         (WebCore::JSEventSource::removeEventListener):
1629         * bindings/js/JSLazyEventListener.cpp:
1630         (WebCore::JSLazyEventListener::JSLazyEventListener):
1631         (WebCore::JSLazyEventListener::jsFunction):
1632         (WebCore::JSLazyEventListener::parseCode):
1633         * bindings/js/JSLazyEventListener.h:
1634         (WebCore::JSLazyEventListener::create):
1635         * bindings/js/JSMessagePortCustom.cpp:
1636         (WebCore::JSMessagePort::addEventListener):
1637         (WebCore::JSMessagePort::removeEventListener):
1638         * bindings/js/JSNodeCustom.cpp:
1639         (WebCore::JSNode::addEventListener):
1640         (WebCore::JSNode::removeEventListener):
1641         * bindings/js/JSSVGElementInstanceCustom.cpp:
1642         (WebCore::JSSVGElementInstance::addEventListener):
1643         (WebCore::JSSVGElementInstance::removeEventListener):
1644         * bindings/js/JSWorkerContextCustom.cpp:
1645         (WebCore::JSWorkerContext::addEventListener):
1646         (WebCore::JSWorkerContext::removeEventListener):
1647         * bindings/js/JSXMLHttpRequestCustom.cpp:
1648         (WebCore::JSXMLHttpRequest::addEventListener):
1649         (WebCore::JSXMLHttpRequest::removeEventListener):
1650         * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
1651         (WebCore::JSXMLHttpRequestUpload::addEventListener):
1652         (WebCore::JSXMLHttpRequestUpload::removeEventListener):
1653         * bindings/js/ScriptEventListener.cpp:
1654         (WebCore::createAttributeEventListener):
1655         * bindings/objc/ObjCEventListener.h:
1656         * bindings/objc/ObjCEventListener.mm:
1657         (WebCore::ObjCEventListener::handleEvent):
1658         * bindings/scripts/CodeGeneratorJS.pm:
1659         * dom/EventListener.h:
1660         (WebCore::EventListener::reportError):
1661         (WebCore::EventListener::jsFunction):
1662         * dom/EventTarget.cpp:
1663         (WebCore::EventTarget::fireEventListeners):
1664         * inspector/InspectorDOMAgent.cpp:
1665         (WebCore::InspectorDOMAgent::handleEvent):
1666         * inspector/InspectorDOMAgent.h:
1667         * inspector/InspectorDOMStorageResource.cpp:
1668         (WebCore::InspectorDOMStorageResource::handleEvent):
1669         * inspector/InspectorDOMStorageResource.h:
1670         * loader/ImageDocument.cpp:
1671         (WebCore::ImageEventListener::handleEvent):
1672         * svg/animation/SVGSMILElement.cpp:
1673         (WebCore::ConditionEventListener::handleEvent):
1674         * workers/WorkerContext.cpp:
1675         (WebCore::WorkerContext::reportException):
1676
1677 2009-09-24  Tony Chang  <tony@chromium.org>
1678
1679         Reviewed by David Levin.
1680
1681         Add a gyp variable to allow building a debug webcore without debug
1682         symbols.  This allows for faster compile, link, and gdb times.
1683
1684         https://bugs.webkit.org/show_bug.cgi?id=29721
1685
1686         No new tests, build config change.
1687
1688         * WebCore.gyp/WebCore.gyp:
1689
1690 2009-09-25  Darin Fisher  <darin@chromium.org>
1691
1692         Reviewed by Dimitri Glazkov.
1693
1694         Declare RegisteredEventListener as a class instead of a struct.
1695         This fixes a warning in the Chromium build.
1696
1697         * dom/RegisteredEventListener.h:
1698
1699 2009-09-25  Dan Bernstein  <mitz@apple.com>
1700
1701         Reviewed by Jon Honeycutt.
1702
1703         WebCore part of
1704         <rdar://problem/7211635> 2 byte characters are displayed as garbaged
1705         <rdar://problem/7212626> garbled/gibberish text (off-by-one)
1706
1707         When the Windows Fonts directory contains more than one font file for a
1708         given font name, which of the fonts gets assigned to the name in the
1709         Core Graphics font database was determined arbitrarily and did not
1710         always match the font GDI used for the same font name. The mismatch
1711         caused character-to-glyph mapping to use one font and glyph rendering to
1712         use another.
1713
1714         The fix is to update the Core Graphics font database from the registry
1715         entries (that reflect the name-to-font mapping that GDI uses) after
1716         populating it with the result of scanning the Fonts directory. As a
1717         consequence, the directory needs to be scanned at startup every time the
1718         registry key changes, so the last value of the registry key is kept
1719         in the property list on disk so that it could be compared to the current
1720         value on startup.
1721
1722         * platform/graphics/win/FontDatabase.cpp:
1723         (WebCore::populateFontDatabaseFromPlist): Now takes a property list as
1724         a parameter and avoids round-tripping through XML by calling
1725         wkAddFontsFromPlist() instead of wkAddFontsFromPlistRepresentation().
1726         (WebCore::fontFilenamesFromRegistryKey):
1727         (WebCore::cgFontDBKey):
1728         (WebCore::writeFontDatabaseToPlist): Now takes the CG font DB property
1729         list and a property list with the font filenames from the registry and
1730         writes a dictionary with those property lists as values.
1731         (WebCore::fontFilenamesFromRegistry): Added. Returns an array with the
1732         values in the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
1733         registry key.
1734         (WebCore::populateFontDatabase): Changed to read the contents of the
1735         Fonts registry key and compare it with the last-saved value from the
1736         property list, and to call wkAddFontsFromRegistry() after populating the
1737         CG font DB from the file system. Uses wkCreateFontsPlist() instead of
1738         wkCreateFontsPlistRepresentation() to avoid round-tripping through XML.
1739
1740 2009-09-25  Geoffrey Garen  <ggaren@apple.com>
1741
1742         Reviewed by Darin Adler.
1743
1744         Inlined some object creation code, including lexicalGlobalObject access
1745         https://bugs.webkit.org/show_bug.cgi?id=29750
1746
1747         * bindings/js/JSInspectorBackendCustom.cpp:
1748         (WebCore::JSInspectorBackend::currentCallFrame):
1749         * inspector/JavaScriptDebugServer.cpp:
1750         (WebCore::JavaScriptDebugServer::hasBreakpoint): Updated for JavaScriptCore
1751         API changes.
1752
1753 2009-09-25  Dave Hyatt  <hyatt@apple.com>
1754
1755         Reviewed by Anders Carlsson.
1756
1757         https://bugs.webkit.org/show_bug.cgi?id=24399
1758         Make @import work in user stylesheets.  The first bug was that the URL wasn't being set on the
1759         user sheets themselves, so relative @import URLs couldn't resolve properly.  The second bug
1760         was that the loads would be denied.  This is fixed by using the requestUserCSSStyleSheet method
1761         instead of the normal request method.  In order to know when to do this, CSSStyleSheets now have
1762         a propagated boolean, m_isUserStyleSheet, that lets them know if they are user stylesheets or not.
1763
1764         * css/CSSImportRule.cpp:
1765         (WebCore::CSSImportRule::insertedIntoParent):
1766         * css/CSSStyleSheet.cpp:
1767         (WebCore::CSSStyleSheet::CSSStyleSheet):
1768         * css/CSSStyleSheet.h:
1769         (WebCore::CSSStyleSheet::setIsUserStyleSheet):
1770         (WebCore::CSSStyleSheet::isUserStyleSheet):
1771         * dom/Document.cpp:
1772         (WebCore::Document::pageUserSheet):
1773         (WebCore::Document::pageGroupUserSheets):
1774
1775 2009-09-25  Simon Fraser  <simon.fraser@apple.com>
1776
1777         Reviewed by Darin Adler.
1778
1779         ASSERTION FAILED: !repaintContainer || repaintContainer == this
1780         https://bugs.webkit.org/show_bug.cgi?id=29755
1781         
1782         It's possible for RenderObject::container() to return an object that is higher
1783         in the hierarchy than the repaintContainer that is being used to repaint an
1784         object. For example, this can happen when running an accelerated opacity
1785         transition on an element with a position:absolute parent, and a position:absolute child.
1786         
1787         In this case we need to detect when RenderObject::container() will skip over
1788         repaintContainer, and in that case adjust the coords to shift into repaintContainer's space.
1789
1790         Test: compositing/repaint/opacity-between-absolute.html
1791
1792         * rendering/RenderBox.cpp:
1793         (WebCore::RenderBox::mapLocalToContainer):
1794         (WebCore::RenderBox::computeRectForRepaint):
1795         * rendering/RenderInline.cpp:
1796         (WebCore::RenderInline::computeRectForRepaint):
1797         * rendering/RenderObject.cpp:
1798         (WebCore::RenderObject::container):
1799         * rendering/RenderObject.h:
1800
1801 2009-09-25  Simon Fraser  <simon.fraser@apple.com>
1802
1803         Reviewed by Darin Adler.
1804
1805         Crash with hardware accelerated rotation of a PDF image in a data URL
1806         <rdar://problem/7250378>
1807         
1808         PDF images don't return a color space from CGImageGetColorSpace(),
1809         so we need to null-check the return value before use.
1810
1811         Test: compositing/color-matching/pdf-image-match.html
1812
1813         * platform/graphics/mac/GraphicsLayerCA.mm:
1814         (WebCore::GraphicsLayerCA::setContentsToImage):
1815
1816 2009-09-25  Darin Adler  <darin@apple.com>
1817
1818         Reviewed by Geoffrey Garen.
1819
1820         Null-deref when first access to an Attr node is after its Element is destroyed
1821         https://bugs.webkit.org/show_bug.cgi?id=29748
1822
1823         Test: fast/dom/Attr/access-after-element-destruction.html
1824
1825         * bindings/js/JSAttrCustom.cpp:
1826         (WebCore::JSAttr::markChildren): Added. Keeps the ownerElement alive as
1827         long as the Attr is alive.
1828
1829         * bindings/js/JSNamedNodeMapCustom.cpp:
1830         (WebCore::JSNamedNodeMap::markChildren): Added. Keeps the Element alive as
1831         long as the NamedNodeMap is alive.
1832
1833         * dom/Attr.idl: Added CustomMarkFunction attribute.
1834
1835         * dom/NamedAttrMap.cpp:
1836         (WebCore::NamedNodeMap::getAttributeItem): Tweaked formatting.
1837         (WebCore::NamedNodeMap::detachFromElement): Call clearAttributes so we don't
1838         have attributes hanging around that might need an Attr node created; that way
1839         we won't crash with a null-dereference trying to deal with one of them. This
1840         can't happen when working with JavaScript since the Element will be kept
1841         alive due to the change above.
1842         (WebCore::NamedNodeMap::addAttribute): Fix function name in comment.
1843         (WebCore::NamedNodeMap::removeAttribute): Removed unneeded "+ 1" and added
1844         missing braces.
1845
1846         * dom/NamedAttrMap.h: Made the element function public so it can be used by
1847         the JavaScript binding to keep the Element alive.
1848
1849         * dom/NamedNodeMap.idl: Added CustomMarkFunction attribute.
1850
1851 2009-09-24  Alexey Proskuryakov  <ap@apple.com>
1852
1853         Reviewed by Darin Adler and Sam Weinig.
1854
1855         Onclick not fired for an element copied with cloneContents() or cloneNode()
1856         https://bugs.webkit.org/show_bug.cgi?id=25130
1857
1858         The change here is that JS event listeners don't keep a reference to a global object from
1859         where they were created, and instead take it as a parameter when parsing source code. Also,
1860         the listener creation won't fail just because it happens for an element in a frameless
1861         document.
1862         Thus, moving nodes between documents no longer results in having incorrect registered
1863         lazy event listeners on them.
1864
1865         Tests: fast/events/attribute-listener-cloned-from-frameless-doc-context-2.html
1866                fast/events/attribute-listener-cloned-from-frameless-doc-context.html
1867                fast/events/attribute-listener-cloned-from-frameless-doc.xhtml
1868                fast/events/attribute-listener-extracted-from-frameless-doc-context-2.html
1869                fast/events/attribute-listener-extracted-from-frameless-doc-context.html
1870
1871         * bindings/js/JSEventListener.cpp:
1872         (WebCore::JSEventListener::JSEventListener): Don't take a reference to JSDOMGlobalObject.
1873         (WebCore::JSEventListener::jsFunction): Take ScriptExecutionContext as a parameter for
1874         getting to JSDOMGlobalObject. It's not used in base class, but is in JSLazyEventListner.
1875         (WebCore::JSEventListener::markJSFunction): Don't mark the global object.
1876         (WebCore::JSEventListener::handleEvent): Get global object from ScriptExecutionContext.
1877         (WebCore::JSEventListener::reportError): Ditto.
1878
1879         * bindings/js/JSEventListener.h: (WebCore::JSEventListener::create): Don't keep a reference
1880         to JSDOMGlobalObject.
1881
1882         * bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::parseCode): Listener
1883         creation was split between this function and ScriptEventListener; moved it here, as JS
1884         global object can be different now.
1885
1886         * bindings/js/JSLazyEventListener.h: (WebCore::JSLazyEventListener::create): Keep source URL,
1887         which can not be determined at parsing time.
1888
1889         * bindings/js/ScriptEventListener.cpp: (WebCore::createAttributeEventListener): Moved code
1890         for listener creation to JSLazyEventListener. XSSAuditor code remains here, because tests
1891         expect that errors are logged at document parsing time, and because I don't know what other
1892         side effects moving it vould have.
1893
1894         * dom/EventListener.h: handleEvent() and reportError() now take ScriptExecutionContext,
1895         because JSC needs a global context here.
1896
1897         * bindings/js/JSAbstractWorkerCustom.cpp:
1898         (WebCore::JSAbstractWorker::addEventListener):
1899         (WebCore::JSAbstractWorker::removeEventListener):
1900         * bindings/js/JSDOMApplicationCacheCustom.cpp:
1901         (WebCore::JSDOMApplicationCache::addEventListener):
1902         (WebCore::JSDOMApplicationCache::removeEventListener):
1903         * bindings/js/JSDOMGlobalObject.cpp:
1904         (WebCore::JSDOMGlobalObject::createJSAttributeEventListener):
1905         * bindings/js/JSDOMWindowCustom.cpp:
1906         (WebCore::JSDOMWindow::addEventListener):
1907         (WebCore::JSDOMWindow::removeEventListener):
1908         * bindings/js/JSEventSourceCustom.cpp:
1909         (WebCore::JSEventSource::addEventListener):
1910         (WebCore::JSEventSource::removeEventListener):
1911         * bindings/js/JSMessagePortCustom.cpp:
1912         (WebCore::JSMessagePort::addEventListener):
1913         (WebCore::JSMessagePort::removeEventListener):
1914         * bindings/js/JSNodeCustom.cpp:
1915         (WebCore::JSNode::addEventListener):
1916         (WebCore::JSNode::removeEventListener):
1917         * bindings/js/JSSVGElementInstanceCustom.cpp:
1918         (WebCore::JSSVGElementInstance::addEventListener):
1919         (WebCore::JSSVGElementInstance::removeEventListener):
1920         * bindings/js/JSWorkerContextCustom.cpp:
1921         (WebCore::JSWorkerContext::addEventListener):
1922         (WebCore::JSWorkerContext::removeEventListener):
1923         * bindings/js/JSXMLHttpRequestCustom.cpp:
1924         (WebCore::JSXMLHttpRequest::addEventListener):
1925         (WebCore::JSXMLHttpRequest::removeEventListener):
1926         * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
1927         (WebCore::JSXMLHttpRequestUpload::addEventListener):
1928         (WebCore::JSXMLHttpRequestUpload::removeEventListener):
1929         * bindings/objc/ObjCEventListener.h:
1930         * bindings/objc/ObjCEventListener.mm:
1931         (WebCore::ObjCEventListener::handleEvent):
1932         * bindings/scripts/CodeGeneratorJS.pm:
1933         * dom/EventTarget.cpp:
1934         (WebCore::EventTarget::fireEventListeners):
1935         * inspector/InspectorDOMAgent.cpp:
1936         (WebCore::InspectorDOMAgent::handleEvent):
1937         * inspector/InspectorDOMAgent.h:
1938         * inspector/InspectorDOMStorageResource.cpp:
1939         (WebCore::InspectorDOMStorageResource::handleEvent):
1940         * inspector/InspectorDOMStorageResource.h:
1941         * loader/ImageDocument.cpp:
1942         (WebCore::ImageEventListener::handleEvent):
1943         * svg/animation/SVGSMILElement.cpp:
1944         (WebCore::ConditionEventListener::handleEvent):
1945         * workers/WorkerContext.cpp:
1946         (WebCore::WorkerContext::reportException):
1947         Don't pass global object to JSEventListener::create(), which no longer needs it.
1948         Note that some of these functions still have an early return for null global object, which
1949         can probably be removed in a later patch.
1950         Pass ScriptExecutionContext to EventListener methods that now need it.
1951
1952 2009-09-25  Enrica Casucci  <enrica@apple.com>
1953
1954         Reviewed by Darin Adler, Dan Bernstein, Adele Peterson, and others.
1955
1956         Fix for https://bugs.webkit.org/show_bug.cgi?id=29740
1957         <rdar://problem/7168738> Gmail: After changing a foreground text color, pressing return doesn't apply background to new line
1958
1959         Change the way style is preserved when inserting a new paragraph.
1960         The original code handled insertion at the beginning and at the end of a paragraph as special
1961         cases. The newly created paragraph contained a set of nodes generated starting from the
1962         computed style of the insertion node. This approach has two problems:
1963         1. if the insertion node has a non opaque background color and one of the parent element did have
1964         a solid background color the new paragraph did not have the element with the solid color in the tree.
1965         2. in some circumstances it generated more markup than the original paragraph had (a span with bold, italic,
1966         background color and some font attribute was being reproduced as span + bold + italic + font as separate tags.
1967         The new approach is to recreate in the new paragraph the same hierarchy of nodes found in the
1968         paragraph where the insertion point is.
1969
1970         Test: editing/inserting/insert-bg-font.html
1971
1972         * editing/InsertParagraphSeparatorCommand.cpp:
1973         (WebCore::InsertParagraphSeparatorCommand::getAncestorsInsideBlock): retrieves the list of all the ancestors
1974         between the insert node and the outer block.
1975         (WebCore::InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock): uses the list of ancestors to recreate
1976         in the new paragraph the same element hierarchy present in the starting paragraph.
1977         (WebCore::InsertParagraphSeparatorCommand::doApply): changed the code to handle the general case of insertion
1978         in the middle of the paragraph to use the new methods. Changed the handling of the insertion at the beginning and
1979         at the end of the paragraph to use the new methods instead of applying the calculated style.
1980         * editing/InsertParagraphSeparatorCommand.h: added methods getAncestorsInsideBlock and cloneHierarchyUnderNewBlock.
1981
1982 2009-09-25  Patrick Mueller  <Patrick_Mueller@us.ibm.com>
1983
1984         Reviewed by Timothy Hatcher.
1985
1986         Content-type parameters not taken into account when building form-data
1987         https://bugs.webkit.org/show_bug.cgi?id=28970
1988
1989         existing manual test case extended with new tests
1990
1991         * English.lproj/localizedStrings.js:
1992         * inspector/front-end/ResourceView.js:
1993         (WebInspector.ResourceView.prototype._refreshFormData):
1994         (WebInspector.ResourceView.prototype._refreshParms):
1995         * manual-tests/inspector/display-form-data.html:
1996
1997 2009-09-25  Yuan Song  <song.yuan@ericsson.com>
1998
1999         Reviewed by Darin Adler.
2000
2001         https://bugs.webkit.org/show_bug.cgi?id=14566
2002
2003         Raise SECURITY_ERR exception if an attempt is made to change document.domain to an invalid value.
2004
2005         Test: fast/js/invalid-domain-change-throws-exception.html
2006
2007         * dom/Document.cpp:
2008         (WebCore::Document::setDomain):
2009         * dom/Document.h:
2010         * dom/Document.idl:
2011
2012 2009-09-25  Adam Barth  <abarth@webkit.org>
2013
2014         Reviewed by Dimitri Glazkov.
2015
2016         [V8] Teach ScheduledAction::execute about isolated worlds
2017         https://bugs.webkit.org/show_bug.cgi?id=27703
2018
2019         When setTimeout is called with a string argument in an isolated
2020         world, we now compile the string in the isolated world.
2021
2022         Last time we tried this change, we got a lot of crashes.  This
2023         time we're using a fresh local handle as our context to avoid
2024         trouble if the peristent handle gets disposed before we leave
2025         the context.
2026
2027         Test: fast/dom/timer-clear-interval-in-handler-and-generate-error.html
2028
2029         * bindings/v8/ScheduledAction.cpp:
2030         (WebCore::ScheduledAction::execute):
2031
2032 2009-09-25  Paul Godavari  <paul@chromium.org>
2033
2034         Reviewed by Darin Fisher.
2035
2036         Fix a regression in Mac Chromium popup menus, where the user's
2037         selection was ignored and the popup became unresponsive.
2038         https://bugs.webkit.org/show_bug.cgi?id=29726
2039
2040         The fix is to notify the popup's client that the popup was hidden,
2041         even if the popup has no parent.
2042
2043         * platform/chromium/PopupMenuChromium.cpp:
2044         (WebCore::PopupListBox::hidePopup):
2045
2046 2009-09-25  Alexander Pavlov  <apavlov@chromium.org>
2047
2048         Reviewed by Dan Bernstein.
2049
2050         Enable Pasteboard::writePlainText for Chromium and fix code style nits.
2051         https://bugs.webkit.org/show_bug.cgi?id=29734
2052
2053         * platform/chromium/PasteboardChromium.cpp:
2054         (WebCore::Pasteboard::writePlainText):
2055         * platform/gtk/PasteboardGtk.cpp:
2056         (WebCore::Pasteboard::writePlainText):
2057         (WebCore::Pasteboard::writeURL):
2058         * platform/mac/PasteboardMac.mm:
2059         (WebCore::Pasteboard::writeSelection):
2060         (WebCore::Pasteboard::writePlainText):
2061         (WebCore::Pasteboard::writeURL):
2062         * platform/qt/PasteboardQt.cpp:
2063         (WebCore::Pasteboard::writePlainText):
2064
2065 2009-09-25  Yongjun Zhang  <yongjun.zhang@nokia.com>
2066
2067         Reviewed by Ariya Hidayat.
2068
2069         https://bugs.webkit.org/show_bug.cgi?id=28876
2070         [Qt] reduce peak memory consumption of text decoding.
2071
2072         Chop large input buffer into small buffers to reduce peak memory
2073         during decoding.
2074
2075         * platform/text/qt/TextCodecQt.cpp:
2076         (WebCore::TextCodecQt::decode):
2077
2078 2009-09-24  Jon Honeycutt  <jhoneycutt@apple.com>
2079
2080         Add a mechanism for automatically halting plug-ins.
2081
2082         Reviewed by Oliver Hunt and Alice Liu.
2083
2084         * GNUmakefile.am:
2085
2086         * WebCore.base.exp:
2087         Update export of Page constructor.
2088
2089         * WebCore.gypi:
2090
2091         * WebCore.pro:
2092
2093         * WebCore.vcproj/WebCore.vcproj:
2094         Add PluginHalter.{h,cpp}, PluginHalterClient.h, and
2095         HaltablePlugin.h.
2096
2097         * WebCore.xcodeproj/project.pbxproj:
2098         Add files to Mac project.
2099
2100         * loader/EmptyClients.h:
2101         Added an empty PluginHalterClient.
2102         (WebCore::EmptyPluginHalterClient::shouldHaltPlugin):
2103         Return false.
2104
2105         * page/PluginHalter.cpp: Added.
2106         (WebCore::PluginHalter::PluginHalter):
2107         (WebCore::PluginHalter::didStartPlugin):
2108         Add the object to the plug-in set. If this is the only item in the set,
2109         set m_oldestStartTime to this object's time, and start the timer.
2110         (WebCore::PluginHalter::didStopPlugin):
2111         Remove the plug-in from the set.
2112         (WebCore::PluginHalter::timerFired):
2113         Find the cut-off time as the current time minus the allowed run time;
2114         plug-ins older than this may be halted. Iterate over the plug-ins. Find
2115         the object with the oldest start time that is too young to be halted;
2116         we'll use its start time to set the timer's next fire time. For all
2117         plug-ins that are candidates to be halted, call the
2118         PluginHalterClient's shouldHaltPlugin(). If this function returns true,
2119         call the plug-in's halt() function. Remove these objects from the set
2120         of tracked plug-ins. Call startTimerIfNecessary() to restart the timer.
2121         (WebCore::PluginHalter::startTimerIfNecessary):
2122         If the timer is set to fire, or the set of tracked plug-ins is empty,
2123         return early. Set the timer to fire after the oldest plug-in has run
2124         for the allowed run time.
2125
2126         * page/PluginHalter.h: Added.
2127         (WebCore::PluginHalter::setPluginAllowedRunTime):
2128
2129         * page/PluginHalterClient.h: Added.
2130         (WebCore::PluginHalterClient::~PluginHalterClient):
2131
2132         * page/Page.cpp:
2133         (WebCore::Page::Page):
2134         Initialize m_pluginHalterClient. Call pluginHalterEnabledStateChanged()
2135         to create the PluginHalter if necessary.
2136         (WebCore::Page::pluginHalterEnabledStateChanged):
2137         If plug-in halting is enabled, create the PluginHalter. If it is
2138         disabled, clear it.
2139         (WebCore::Page::pluginAllowedRunTimeChanged):
2140         If there is a plug-in halter, call its setPluginAllowedRunTime().
2141         (WebCore::Page::didStartPlugin):
2142         If there is a plug-in halter, call its didStartPlugin().
2143         (WebCore::Page::didStopPlugin):
2144         If there is a plug-in halter, call its didStopPlugin().
2145
2146         * page/Page.h:
2147         Add a parameter to the Page constructor for the PluginHalterClient.
2148         Added declarations for didStartPlugin() and didStopPlugin(), which are
2149         called when HaltablePlugins are added to or removed from the page. Adds
2150         pluginAllowedRunTimeChanged() and pluginHalterEnabledStateChanged() to
2151         notify the Page when these settings are changed. Added members to hold
2152         the PluginHalter and the PluginHalterClient.
2153
2154         * page/Settings.cpp:
2155         (WebCore::Settings::Settings):
2156         (WebCore::Settings::setPluginHalterEnabled):
2157         If the enabled state has changed, call the Page's
2158         pluginHalterEnabledStateChanged().
2159         (WebCore::Settings::setPluginAllowedRunTime):
2160         Call the Page's pluginAllowedRunTimeChanged().
2161
2162         * page/Settings.h:
2163         (WebCore::Settings::pluginHalterEnabled):
2164         (WebCore::Settings::pluginAllowedRunTime):
2165
2166         * page/HaltablePlugin.h: Added. Defines an interface for plug-ins that
2167         can be automatically halted.
2168         (WebCore::HaltablePlugin::~HaltablePlugin):
2169
2170         * svg/graphics/SVGImage.cpp:
2171         (WebCore::SVGImage::dataChanged):
2172         Pass a dummy PluginHalterClient.
2173
2174 2009-09-24  Simon Fraser  <simon.fraser@apple.com>
2175
2176         Reviewed by Dan Bernstein.
2177
2178         REGRESSION: webkit-transform scale no longer works properly in nightly build
2179         https://bugs.webkit.org/show_bug.cgi?id=29730
2180         
2181         When the initial or final state of a scale animation does not specify a transform,
2182         use a default scale of 1, rather than zero.
2183
2184         Test: compositing/transitions/scale-transition-no-start.html
2185
2186         * platform/graphics/mac/GraphicsLayerCA.mm:
2187         (WebCore::getTransformFunctionValue):
2188
2189 2009-09-24  John Gregg  <johnnyg@google.com>
2190
2191         Reviewed by Eric Seidel.
2192
2193         isEnabled switch for notifications (experimental) in Page Settings
2194         https://bugs.webkit.org/show_bug.cgi?id=28930
2195
2196         Adds a run-time flag in Settings object that controls whether
2197         to expose desktop notifications.
2198
2199         No new test, but test code also modified to set this preference.
2200
2201         * page/DOMWindow.cpp:
2202         (WebCore::DOMWindow::webkitNotifications): check preference before returning notifications object
2203         * page/Settings.cpp:
2204         (WebCore::Settings::Settings):
2205         (WebCore::Settings::setExperimentalNotificationsEnabled):
2206         * page/Settings.h:
2207         (WebCore::Settings::experimentalNotificationsEnabled):
2208
2209 2009-09-24  Dan Bernstein  <mitz@apple.com>
2210
2211         Reviewed by Sam Weinig.
2212
2213         Fix <rdar://problem/7162000> Crash while trying to
2214         calculate the horizontal position of image
2215
2216         Test: fast/inline-block/relative-positioned-rtl-crash.html
2217
2218         * rendering/RenderBox.cpp:
2219         (WebCore::RenderBox::calcAbsoluteHorizontalReplaced): Corrected an
2220         isInline() test to isRenderInline(). This is similar to r41259.
2221
2222 2009-09-24  Jessie Berlin  <jberlin@webkit.org>
2223
2224         Reviewed by Timothy Hatcher.
2225
2226         Fix expanding profile call stacks being broken after sorting.
2227         https://bugs.webkit.org/show_bug.cgi?id=26423
2228
2229         * inspector/front-end/ProfileDataGridTree.js:
2230         (WebInspector.ProfileDataGridNode.prototype.sort):
2231         Set shouldRefreshChildren to true on collapsed nodes with children so that expanding it
2232         causes the children to be placed in the right positions.
2233
2234 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
2235
2236         Reviewed by Stephanie Lewis.
2237
2238         Fixed sudden termination console spew due to too many calls to
2239         enableSuddenTermination.
2240         
2241         <rdar://problem/7063125> 10A410: Safari logging enableSuddenTermination errors
2242
2243         * page/DOMWindow.cpp:
2244         (WebCore::removeUnloadEventListener):
2245         (WebCore::removeAllUnloadEventListeners):
2246         (WebCore::removeBeforeUnloadEventListener):
2247         (WebCore::removeAllBeforeUnloadEventListeners): Only
2248         enableSuddenTermination if the set of listeners is empty *and* this
2249         window was in the set. Otherwise, a no-op will cause us to enableSuddenTermination.
2250
2251 2009-09-24  Carol Szabo  <carol.szabo@nokia.com>
2252
2253         Reviewed by Alexey Proskuryakov.
2254
2255         WebKit returns "" instead of null when getting
2256         inexistent, forbidden or invalidly named headers.
2257         https://bugs.webkit.org/show_bug.cgi?id=29140
2258
2259         * xml/XMLHttpRequest.cpp:
2260         (WebCore::XMLHttpRequest::getResponseHeader):
2261         Changed to return null as it should according to the spec.
2262
2263 2009-09-24  Jeremy Orlow  <jorlow@chromium.org>
2264
2265         Reviewed by Dimitri Glazkov.
2266
2267         Add GYP generated files to svn:ignore
2268         https://bugs.webkit.org/show_bug.cgi?id=29724
2269
2270         Adding the following files to the svn:ignore list (all in the
2271         WebCore/WebCore.gyp directory)
2272
2273         WebCore.xcodeproj
2274         WebCore.sln
2275         WebCore.vcproj
2276         WebCore_Debug.rules
2277         WebCore_Release.rules
2278         WebCore_Release - no tcmalloc.rules
2279         WebCore_Purify.rules
2280         WebCore.mk
2281         WebCore_Debug_rules.mk
2282         WebCore_Release_rules.mk
2283         WebCore_Release - no tcmalloc_rules.mk
2284         WebCore_Purify_rules.mk
2285         WebCore.scons
2286         WebCore_main.scons
2287
2288         * WebCore.gyp: Changed property svn:ignore.
2289
2290 2009-09-24  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2291
2292         Unreviewed. Mac build fix.
2293
2294         * page/EventHandler.cpp:
2295         (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):
2296         remove unused parameter from function signature;
2297
2298 2009-09-24  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2299
2300         Reviewed by Oliver Hunt.
2301
2302         Implement correct horizontal scrollbar behavior for GTK+ also on
2303         styled scrollbars.
2304
2305         https://bugs.webkit.org/show_bug.cgi?id=29348
2306         [Gtk] Scrollwheel on horizontal scrollbars should slide horizontally
2307
2308         Test: platform/gtk/scrollbars/overflow-scrollbar-horizontal-wheel-scroll.html
2309
2310         * page/EventHandler.cpp:
2311         (WebCore::EventHandler::handleWheelEvent): on GTK+, when using the
2312         wheel with the pointer on the horizontal scrollbar, scroll
2313         horizontally;
2314         * platform/PlatformWheelEvent.h:
2315         * platform/gtk/WheelEventGtk.cpp:
2316         (WebCore::PlatformWheelEvent::swapOrientation): allow adding a
2317         vertical scroll to the horizontal one;
2318
2319 2009-09-24  Jeremy Orlow  <jorlow@chromium.org>
2320
2321         Reviewed by Eric Seidel.
2322
2323         StorageNamespace::storageArea() should take in a PassRefPtr<StorageOrigin>
2324         https://bugs.webkit.org/show_bug.cgi?id=29290
2325
2326         Modified StorageNamespace::storageArea() to take in a PassRefPtr<StorageOrigin>
2327         per http://webkit.org/coding/RefPtr.html
2328
2329         No behavior change, so no tests.
2330
2331         * storage/StorageNamespace.h:
2332         * storage/StorageNamespaceImpl.cpp:
2333         (WebCore::StorageNamespaceImpl::storageArea):
2334         * storage/StorageNamespaceImpl.h:
2335
2336 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
2337
2338         Reviewed by Sam Weinig.
2339
2340         Added back enable/disableSuddenTermination() functionality I accidentally
2341         removed in my last patch.
2342
2343         * page/DOMWindow.cpp:
2344         (WebCore::addUnloadEventListener):
2345         (WebCore::removeUnloadEventListener):
2346         (WebCore::removeAllUnloadEventListeners):
2347         (WebCore::addBeforeUnloadEventListener):
2348         (WebCore::removeBeforeUnloadEventListener):
2349         (WebCore::removeAllBeforeUnloadEventListeners):
2350         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
2351         (WebCore::DOMWindow::~DOMWindow):
2352         (WebCore::DOMWindow::addEventListener):
2353         (WebCore::DOMWindow::removeEventListener):
2354         (WebCore::DOMWindow::removeAllEventListeners):
2355
2356 2009-09-24  Sam Weinig  <sam@webkit.org>
2357
2358         Reviewed by Steve Falkenburg and Mark Rowe.
2359
2360         Don't pass -F to GCC on non-mac platforms since it is an darwin only.
2361
2362         * DerivedSources.make:
2363
2364 2009-09-24  Sam Weinig  <sam@webkit.org>
2365
2366         Fix windows build.
2367
2368         * dom/Element.idl:
2369
2370 2009-09-23  Stephen White  <senorblanco@chromium.org>
2371
2372         Reviewed by Eric Seidel.
2373
2374         Revert the relevant parts of r47925, and implement an alternate
2375         fix (localize the coordinate check to GraphicsContext::clipPath()).
2376         This fixes http://crbug.com/21174.
2377
2378         Covered by LayoutTests/svg/dynamic-updates/SVGClipPathElement-dom-clipPathUnits-attr.html.
2379
2380         * platform/graphics/skia/GraphicsContextSkia.cpp:
2381         (WebCore::GraphicsContext::clipPath):
2382         * platform/graphics/skia/PlatformContextSkia.cpp:
2383         (PlatformContextSkia::currentPathInLocalCoordinates):
2384
2385 2009-09-24  Brady Eidson  <beidson@apple.com>
2386
2387         Reviewed by Sam Weinig.
2388
2389         Merge changes from Mozilla's FTP directory parser.
2390         <rdar://problem/7227620> and https://bugs.webkit.org/show_bug.cgi?id=29294
2391
2392         FTP layout tests not possible at this time.
2393         https://bugs.webkit.org/show_bug.cgi?id=29719 tracks making them possible.
2394
2395         * loader/FTPDirectoryParser.cpp:
2396         (WebCore::ParsingFailed):
2397         (WebCore::parseOneFTPLine):
2398
2399 2009-09-24  Philippe Normand  <pnormand@igalia.com>
2400
2401         Reviewed by Gustavo Noronha.
2402
2403         [GTK] re-enable some media tests
2404         https://bugs.webkit.org/show_bug.cgi?id=29716
2405
2406         make canPlayType() return "probably" if mime-type is known
2407         and codecs string is not empty. If codecs is empty return
2408         "maybe".
2409
2410         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
2411         (WebCore::MediaPlayerPrivate::supportsType):
2412
2413 2009-09-24  Sam Weinig  <sam@webkit.org>
2414
2415         Reviewed by Dan Bernstein.
2416
2417         Fix for https://bugs.webkit.org/show_bug.cgi?id=29703
2418         Add a function to element to check whether it matches a CSS selector
2419
2420         Implement Element.webkitMatchesSelector.
2421
2422         * css/CSSSelectorList.cpp:
2423         (WebCore::forEachTagSelector):
2424         (WebCore::forEachSelector):
2425         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
2426         (WebCore::CSSSelectorList::selectorsNeedNamespaceResolution):
2427         * css/CSSSelectorList.h:
2428         Moved code to iterate the CSSSelectorList and determine if any
2429         selectors need namespace resolution from a static function in
2430         Node.cpp to CSSSelectorList so that it can be used by webkitMatchesSelector
2431         as well as querySelector/querySelectorAll.
2432
2433         * dom/Element.cpp:
2434         (WebCore::Element::webkitMatchesSelector):
2435         * dom/Element.h: 
2436         * dom/Element.idl:
2437         Implement the new function. Handles exceptional cases identically to
2438         querySelector/querySelectorAll.
2439
2440         * dom/Node.cpp:
2441         (WebCore::Node::querySelector):
2442         (WebCore::Node::querySelectorAll):
2443         Moved selectorsNeedNamespaceResolution to CSSSelectorList from here.
2444
2445 2009-09-24  Vitaly Repeshko  <vitalyr@chromium.org>
2446
2447         Reviewed by Dimitri Glazkov.
2448
2449         [V8] Fixed bindings build after http://trac.webkit.org/changeset/48701
2450         https://bugs.webkit.org/show_bug.cgi?id=29713
2451
2452         Got rid of isWindowEvent in function signatures:
2453         * bindings/v8/V8AbstractEventListener.cpp:
2454         (WebCore::V8AbstractEventListener::invokeEventHandler):
2455         (WebCore::V8AbstractEventListener::handleEvent):
2456         (WebCore::V8AbstractEventListener::getReceiverObject):
2457         * bindings/v8/V8AbstractEventListener.h:
2458         * bindings/v8/V8LazyEventListener.cpp:
2459         (WebCore::V8LazyEventListener::callListenerFunction):
2460         * bindings/v8/V8LazyEventListener.h:
2461         * bindings/v8/V8WorkerContextEventListener.cpp:
2462         (WebCore::V8WorkerContextEventListener::handleEvent):
2463         (WebCore::V8WorkerContextEventListener::callListenerFunction):
2464         (WebCore::V8WorkerContextEventListener::getReceiverObject):
2465         * bindings/v8/V8WorkerContextEventListener.h:
2466         * bindings/v8/custom/V8CustomEventListener.cpp:
2467         (WebCore::V8EventListener::callListenerFunction):
2468         * bindings/v8/custom/V8CustomEventListener.h:
2469
2470         Switched to EventTarget methods of adding/removing listeners:
2471         * bindings/v8/custom/V8DOMApplicationCacheCustom.cpp:
2472         (WebCore::toEventID):
2473         (WebCore::ACCESSOR_SETTER):
2474
2475         * dom/EventTarget.h: Some functions were incorrectly marked
2476         as JSC-specific.
2477
2478 2009-09-24  Pavel Feldman  <pfeldman@chromium.org>
2479
2480         Reviewed by Timothy Hatcher.
2481
2482         Web Inspector: Color-code watch expression errors with red.
2483
2484         https://bugs.webkit.org/show_bug.cgi?id=29707
2485
2486         * inspector/front-end/WatchExpressionsSidebarPane.js:
2487         (WebInspector.WatchExpressionsSection.prototype.update):
2488         (WebInspector.WatchExpressionTreeElement.prototype.update):
2489         * inspector/front-end/inspector.css:
2490
2491 2009-09-24  Pavel Feldman  <pfeldman@chromium.org>
2492
2493         Reviewed by Timothy Hatcher.
2494
2495         Web Inspector: Fix formatting for messages derived from resource warnings,
2496         couple of drive-by formatting fixes.
2497
2498         https://bugs.webkit.org/show_bug.cgi?id=29705
2499
2500         * inspector/InspectorFrontend.cpp:
2501         (WebCore::InspectorFrontend::addMessageToConsole):
2502         * inspector/front-end/ConsoleView.js:
2503         * inspector/front-end/InjectedScript.js:
2504         (InjectedScript._evaluateAndWrap):
2505         * inspector/front-end/WatchExpressionsSidebarPane.js:
2506         (WebInspector.WatchExpressionsSection.prototype.update):
2507
2508 2009-09-22  Pavel Feldman  <pfeldman@chromium.org>
2509
2510         Reviewed by Timothy Hatcher.
2511
2512         WebInspector: Implement InspectorController::copyNode(id).
2513
2514         https://bugs.webkit.org/show_bug.cgi?id=28357
2515
2516         * inspector/InspectorBackend.cpp:
2517         (WebCore::InspectorBackend::copyNode):
2518         * inspector/InspectorBackend.h:
2519         * inspector/InspectorBackend.idl:
2520         * inspector/front-end/ElementsPanel.js:
2521         (WebInspector.ElementsPanel.prototype.handleCopyEvent):
2522
2523 2009-09-24  Oliver Hunt  <oliver@apple.com>
2524
2525         Reviewed by NOBODY(rollout)
2526
2527         Roll out r48712 as it is incorrect.
2528
2529         Overriding getPropertyNames is incorrect.
2530
2531         * bridge/runtime_array.cpp:
2532         * bridge/runtime_array.h:
2533
2534 2009-09-24  Xan Lopez  <xlopez@igalia.com>
2535
2536         Revert r48697, since it broke key handling notification to GTK+.
2537
2538         * platform/gtk/KeyEventGtk.cpp:
2539         (WebCore::keyIdentifierForGdkKeyCode):
2540         (WebCore::singleCharacterString):
2541
2542 2009-09-24  Philippe Normand  <pnormand@igalia.com>
2543
2544         Reviewed by Xan Lopez.
2545
2546         [GTK] GStreamer MediaPlayer is unable to correctly querry duration
2547         https://bugs.webkit.org/show_bug.cgi?id=24639
2548
2549         check duration returned by gst_element_query_duration() only
2550         when using GStreamer < 0.10.23.
2551
2552         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
2553         (WebCore::MediaPlayerPrivate::duration):
2554
2555 2009-09-24  Benjamin Poulain  <benjamin.poulain@nokia.com>
2556
2557         Reviewed by Eric Seidel.
2558
2559         The indices of RuntimeArray should be enumerated like for a regular array.
2560         https://bugs.webkit.org/show_bug.cgi?id=29005
2561
2562         * bridge/runtime_array.cpp:
2563         (JSC::RuntimeArray::getPropertyNames):
2564         * bridge/runtime_array.h:
2565
2566 2009-09-23  Alexander Pavlov  <apavlov@chromium.org>
2567
2568         Reviewed by Eric Seidel.
2569
2570         Introduce Pasteboard::writePlaintext(const String&) so that copying
2571         of the inspected elements HTML will be possible in WebInspector.
2572         https://bugs.webkit.org/show_bug.cgi?id=29634
2573
2574         * platform/Pasteboard.h:
2575         * platform/android/TemporaryLinkStubs.cpp:
2576         (Pasteboard::writePlainText):
2577         * platform/chromium/ChromiumBridge.h:
2578         * platform/chromium/PasteboardChromium.cpp:
2579         (WebCore::Pasteboard::writePlainText):
2580         * platform/gtk/PasteboardGtk.cpp:
2581         (WebCore::Pasteboard::writePlainText):
2582         * platform/haiku/PasteboardHaiku.cpp:
2583         (WebCore::Pasteboard::writePlainText):
2584         * platform/mac/PasteboardMac.mm:
2585         (WebCore::Pasteboard::writePlainText):
2586         * platform/qt/PasteboardQt.cpp:
2587         (WebCore::Pasteboard::writePlainText):
2588         * platform/win/PasteboardWin.cpp:
2589         (WebCore::Pasteboard::writeSelection):
2590         (WebCore::Pasteboard::writePlainText):
2591         * platform/wince/PasteboardWince.cpp:
2592         (WebCore::Pasteboard::writePlainText):
2593         * platform/wx/PasteboardWx.cpp:
2594         (WebCore::Pasteboard::writeSelection):
2595         (WebCore::Pasteboard::writePlainText):
2596         (WebCore::Pasteboard::writeURL):
2597
2598 2009-09-24  Oswald Buddenhagen  <oswald.buddenhagen@nokia.com>
2599
2600         Reviewed by Simon Hausmann.
2601
2602         Fix QApp::translate() calls to provide the correct class name without
2603         a trailing comma.
2604
2605         * platform/qt/Localizations.cpp:
2606         (WebCore::localizedMediaTimeDescription):
2607
2608 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
2609
2610         More build fix: Removed JSSharedWorkerContextCustom.cpp from project
2611         files, since it no longer exists in the repository.
2612
2613         * GNUmakefile.am:
2614         * WebCore.gypi:
2615         * WebCore.pro:
2616         * WebCore.vcproj/WebCore.vcproj:
2617
2618 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
2619
2620         Windows build fix: Declare set/unsetPendingActivity public, so
2621         SharedWorkerScriptLoader can call them.
2622
2623         * dom/ActiveDOMObject.h:
2624
2625 2009-09-24  Geoffrey Garen  <ggaren@apple.com>
2626
2627         Fixed a bit of the Windows build.
2628
2629         * workers/SharedWorker.idl: Declare a custom mark function. (I accidentally
2630         removed this in my last patch.)
2631         * WebCore.xcodeproj/project.pbxproj: Added JSSharedWorkerCustom.cpp back
2632         to the build. (I accidentally removed this in my last patch.)
2633
2634 2009-09-23  Geoffrey Garen  <ggaren@apple.com>
2635
2636         32-bit build fix: restore previous cast that I thought was unnecessary.
2637
2638         * xml/XMLHttpRequest.cpp:
2639         (WebCore::XMLHttpRequest::didSendData):
2640         (WebCore::XMLHttpRequest::didReceiveData):
2641
2642 2009-09-23  Geoffrey Garen  <ggaren@apple.com>
2643
2644         Reviewed by Sam Weinig.
2645
2646         Bring a little sanity to this crazy EventTarget world of ours
2647         https://bugs.webkit.org/show_bug.cgi?id=29701
2648
2649         Lots of EventTarget refactoring to achieve a single shared implementation
2650         that fixes some of the performance and correctness bugs of the many individual
2651         implementations, and makes reasoning about EventTargets and EventListeners
2652         much easier.
2653         
2654         The basic design is this:
2655             - EventTarget manages a set of EventListeners.
2656             - onXXX EventListener attributes forward to standard EventTarget APIs.
2657             - Since the onXXX code is repetitive, it is usually done with macros
2658               of the form DEFINE_ATTRIBUTE_EVENT_LISTENER(attributeName).
2659             - EventTarget provides a shared implementation of dispatchEvent,
2660               which subclasses with special event dispatch rules, like Node, override.
2661             - To support Node, which lazily instantiates its EventTarget data,
2662               EventTarget has no data members, and instead makes a virtual call
2663               to get its data from wherever its subclass chose to store it.
2664               
2665         Code that used to call dispatchEvent, passing an ExceptionCode paratmeter,
2666         even though no exception could be thrown, has been changed not to do so,
2667         to improve clarity and performance.
2668         
2669         Code that used to call a special dispatchXXXEvent function, which just
2670         turned around and called dispatchEvent, has been changed to call
2671         dispatchEvent, to improve clarity and performance.
2672
2673         * WebCore.base.exp:
2674         * WebCore.xcodeproj/project.pbxproj: Another day in the life of a WebKit
2675         engineer.
2676
2677         * bindings/js/JSDOMBinding.cpp:
2678         (WebCore::isObservableThroughDOM): Updated for Node API change. Added
2679         "is not in the document but is firing event listeners" as a condition
2680         that makes a Node observable in the DOM, so that event listeners firing
2681         on removed nodes are not destroyed midstream. (This was a long-standing
2682         bug that was somewhat hidden by the old implementation's habit of
2683         copying the RegisteredEventListener vector before firing events, which
2684         would keep almost all the relevant objects from being destroyed.)
2685
2686         * bindings/js/JSEventListener.cpp:
2687         (WebCore::JSEventListener::handleEvent): Removed the isWindowEvent flag
2688         because it was one of the most elaborately planned no-ops in the history
2689         of software crime, and one of the reasons clients thought they needed more
2690         than one dispatchEvent function even though they didn't.
2691         * bindings/js/JSEventListener.h:
2692
2693         * bindings/js/JSDOMWindowCustom.cpp:
2694         (WebCore::JSDOMWindow::markChildren):
2695         (WebCore::JSMessagePort::markChildren):
2696         * bindings/js/JSNodeCustom.cpp:
2697         (WebCore::JSNode::markChildren):
2698         * bindings/js/JSAbstractWorkerCustom.cpp:
2699         * bindings/js/JSDOMApplicationCacheCustom.cpp:
2700         * bindings/js/JSDedicatedWorkerContextCustom.cpp:
2701         * bindings/js/JSEventSourceCustom.cpp:
2702         * bindings/js/JSMessagePortCustom.cpp:
2703         * bindings/js/JSSharedWorkerContextCustom.cpp: Removed.
2704         * bindings/js/JSWebSocketCustom.cpp:
2705         * bindings/js/JSWorkerContextCustom.cpp:
2706         (WebCore::JSWorkerContext::markChildren):
2707         * bindings/js/JSWorkerCustom.cpp:
2708         * bindings/js/JSXMLHttpRequestCustom.cpp:
2709         (WebCore::JSXMLHttpRequest::markChildren):
2710         * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
2711         (WebCore::JSXMLHttpRequestUpload::markChildren): EventListener marking is
2712         now autogenerated. Classes that still have custom mark functions for other
2713         reasons now call a shared EventTarget API to mark their EventListeners.
2714
2715         * bindings/objc/ObjCEventListener.h:
2716         * bindings/objc/ObjCEventListener.mm:
2717         (WebCore::ObjCEventListener::handleEvent): Bye bye isWindowEvent.
2718
2719         * bindings/scripts/CodeGeneratorJS.pm: Autogeneration support for
2720         marking and invalidating event listeners.
2721
2722         * dom/CharacterData.cpp:
2723         (WebCore::CharacterData::dispatchModifiedEvent):
2724         * dom/ContainerNode.cpp:
2725         (WebCore::ContainerNode::insertBefore):
2726         (WebCore::ContainerNode::replaceChild):
2727         (WebCore::willRemoveChild):
2728         (WebCore::ContainerNode::appendChild):
2729         (WebCore::dispatchChildInsertionEvents):
2730         (WebCore::dispatchChildRemovalEvents):
2731         * dom/Document.cpp:
2732         (WebCore::Document::removeAllEventListeners):
2733         (WebCore::Document::implicitClose):
2734         (WebCore::Document::setFocusedNode):
2735         (WebCore::Document::dispatchWindowEvent):
2736         (WebCore::Document::dispatchWindowLoadEvent):
2737         (WebCore::Document::finishedParsing):
2738         * dom/Document.h: Use dispatchEvent directly.
2739
2740         * dom/Element.h: Moved a few event listener attributes down from Node,
2741         since they don't apply to all Nodes, only Elements.
2742
2743         * dom/EventListener.h: Removed isWindowEvent parameter.
2744
2745         * dom/EventNames.h: Added the "display" event name, so it works correctly
2746         with attribute macros, and for performance.
2747
2748         * dom/EventTarget.cpp:
2749         (WebCore::forbidEventDispatch):
2750         (WebCore::allowEventDispatch):
2751         (WebCore::eventDispatchForbidden): Made this code (embarrasingly) thread
2752         safe, since it's now called on multiple threads. (Currently, we only forbid
2753         event dispatch on the main thread. If we ever want to forbid event dispatch
2754         on secondary threads, we can improve it then.)
2755
2756         (WebCore::EventTarget::addEventListener):
2757         (WebCore::EventTarget::removeEventListener):
2758         (WebCore::EventTarget::setAttributeEventListener):
2759         (WebCore::EventTarget::getAttributeEventListener):
2760         (WebCore::EventTarget::clearAttributeEventListener):
2761         (WebCore::EventTarget::dispatchEvent):
2762         (WebCore::EventTarget::fireEventListeners):
2763         (WebCore::EventTarget::getEventListeners):
2764         (WebCore::EventTarget::removeAllEventListeners):
2765         * dom/EventTarget.h:
2766         (WebCore::FiringEventEndIterator::FiringEventEndIterator):
2767         (WebCore::EventTarget::ref):
2768         (WebCore::EventTarget::deref):
2769         (WebCore::EventTarget::markEventListeners):
2770         (WebCore::EventTarget::invalidateEventListeners):
2771         (WebCore::EventTarget::isFiringEventListeners):
2772         (WebCore::EventTarget::hasEventListeners): The ONE TRUE IMPLEMENTATION of
2773         EventTarget APIs, crafted from an amalgam of all the different versions
2774         we used to have. The most significant change here is that we no longer
2775         make a copy of an EventListener vector before firing the events in the
2776         vector -- instead, we use a reference to the original vector, along with
2777         a notification mechanism for the unlikely case when an EventListener is
2778         removed from the vector. This substantially reduces malloc, copying, and
2779         refcount overhead, and complexity.
2780
2781         * dom/InputElement.cpp:
2782         (WebCore::InputElement::setValueFromRenderer):
2783         * dom/MessageEvent.h:
2784         (WebCore::MessageEvent::create): Use dispatchEvent directly.
2785
2786         * dom/MessagePort.cpp:
2787         (WebCore::MessagePort::dispatchMessages):
2788         (WebCore::MessagePort::eventTargetData):
2789         (WebCore::MessagePort::ensureEventTargetData):
2790         * dom/MessagePort.h:
2791         (WebCore::MessagePort::setOnmessage):
2792         (WebCore::MessagePort::onmessage):
2793         * dom/MessagePort.idl: Removed custom EventTarget implementation.
2794
2795         * dom/MutationEvent.h:
2796         (WebCore::MutationEvent::create): Added some default values so callers
2797         can construct MutationEvents more easily, without calling a custom dispatch
2798         function.
2799
2800         * dom/Node.cpp:
2801         (WebCore::Node::addEventListener):
2802         (WebCore::Node::removeEventListener):
2803         (WebCore::Node::eventTargetData):
2804         (WebCore::Node::ensureEventTargetData):
2805         (WebCore::Node::handleLocalEvents):
2806         (WebCore::Node::dispatchEvent):
2807         (WebCore::Node::dispatchGenericEvent):
2808         (WebCore::Node::dispatchSubtreeModifiedEvent):
2809         (WebCore::Node::dispatchUIEvent):
2810         (WebCore::Node::dispatchKeyEvent):
2811         (WebCore::Node::dispatchMouseEvent):
2812         (WebCore::Node::dispatchWheelEvent):
2813         (WebCore::Node::dispatchFocusEvent):
2814         (WebCore::Node::dispatchBlurEvent):
2815         * dom/Node.h:
2816         (WebCore::Node::preDispatchEventHandler):
2817         (WebCore::Node::postDispatchEventHandler):
2818         * dom/Node.idl:
2819         * dom/NodeRareData.h:
2820         (WebCore::NodeRareData::eventTargetData):
2821         (WebCore::NodeRareData::ensureEventTargetData): Use the shared EventTarget
2822         interface, and call dispatchEvent directly instead of custom dispatchXXXEvent
2823         functions that just forwarded to dispatchEvent.
2824
2825         * dom/RegisteredEventListener.cpp:
2826         * dom/RegisteredEventListener.h:
2827         (WebCore::RegisteredEventListener::RegisteredEventListener):
2828         (WebCore::operator==): This is just a simple struct now, since we no longer
2829         do a complicated copy / refCount / isRemoved dance just to honor the rule
2830         that an EventListener can be removed during event dispatch.
2831
2832         * history/CachedFrame.cpp:
2833         (WebCore::CachedFrameBase::restore): Removed another custom dispatchEvent.
2834
2835         * html/HTMLBodyElement.cpp:
2836         * html/HTMLBodyElement.h: Use the shared EventTarget API.
2837
2838         * html/HTMLFormControlElement.cpp:
2839         (WebCore::HTMLFormControlElement::dispatchFormControlChangeEvent):
2840         (WebCore::HTMLFormControlElement::checkValidity):
2841         * html/HTMLFormElement.cpp:
2842         (WebCore::HTMLFormElement::handleLocalEvents):
2843         (WebCore::HTMLFormElement::prepareSubmit):
2844         (WebCore::HTMLFormElement::reset):
2845         * html/HTMLFormElement.h: Use the standard dispatchEvent API.
2846
2847         * html/HTMLFrameSetElement.cpp:
2848         * html/HTMLFrameSetElement.h: Use the shared EventTarget API.
2849
2850         * html/HTMLImageLoader.cpp:
2851         (WebCore::HTMLImageLoader::dispatchLoadEvent):
2852         * html/HTMLInputElement.cpp:
2853         (WebCore::HTMLInputElement::onSearch):
2854         * html/HTMLMediaElement.cpp:
2855         (WebCore::HTMLMediaElement::loadInternal):
2856         * html/HTMLScriptElement.cpp:
2857         (WebCore::HTMLScriptElement::dispatchLoadEvent):
2858         (WebCore::HTMLScriptElement::dispatchErrorEvent):
2859         * html/HTMLSourceElement.cpp:
2860         (WebCore::HTMLSourceElement::errorEventTimerFired):
2861         * html/HTMLTokenizer.cpp:
2862         (WebCore::HTMLTokenizer::notifyFinished): Use the standard dispatchEvent API.
2863
2864         * inspector/InspectorDOMAgent.cpp:
2865         (WebCore::InspectorDOMAgent::handleEvent):
2866         * inspector/InspectorDOMAgent.h:
2867         * inspector/InspectorDOMStorageResource.cpp:
2868         (WebCore::InspectorDOMStorageResource::handleEvent):
2869         * inspector/InspectorDOMStorageResource.h:
2870         * loader/FrameLoader.cpp:
2871         (WebCore::FrameLoader::stopLoading):
2872         (WebCore::FrameLoader::canCachePageContainingThisFrame):
2873         (WebCore::FrameLoader::logCanCacheFrameDecision):
2874         (WebCore::HashChangeEventTask::performTask):
2875         (WebCore::FrameLoader::pageHidden): No more isWindowEvent.
2876
2877         * loader/ImageDocument.cpp:
2878         (WebCore::ImageEventListener::handleEvent):
2879         * loader/appcache/ApplicationCacheGroup.cpp:
2880         (WebCore::CallCacheListenerTask::performTask):
2881         * loader/appcache/ApplicationCacheHost.cpp:
2882         (WebCore::ApplicationCacheHost::notifyDOMApplicationCache):
2883         * loader/appcache/ApplicationCacheHost.h:
2884         * loader/appcache/DOMApplicationCache.cpp:
2885         (WebCore::DOMApplicationCache::eventTargetData):
2886         (WebCore::DOMApplicationCache::ensureEventTargetData):
2887         * loader/appcache/DOMApplicationCache.h:
2888         * loader/appcache/DOMApplicationCache.idl: Switched to the standard
2889         EventTarget API. As a part of this, I switched this class from using a
2890         custom internal event name enumeration to using the standard EventNames.
2891
2892         * notifications/Notification.cpp:
2893         (WebCore::Notification::eventTargetData):
2894         (WebCore::Notification::ensureEventTargetData):
2895         * notifications/Notification.h:
2896         (WebCore::Notification::scriptExecutionContext):
2897         * notifications/Notification.idl: Switched to the standard EventTarget API.
2898
2899         * page/DOMWindow.cpp:
2900         (WebCore::PostMessageTimer::event):
2901         (WebCore::windowsWithUnloadEventListeners):
2902         (WebCore::windowsWithBeforeUnloadEventListeners):
2903         (WebCore::allowsBeforeUnloadListeners):
2904         (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents):
2905         (WebCore::DOMWindow::pendingUnloadEventListeners):
2906         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents): Changed the "pending"
2907         unload / beforeunload listener tracker just to track which windows had
2908         such listeners, instead of actually keeping a copy of the listeners. Now,
2909         this code can use the standard EventTarget API.
2910
2911         (WebCore::DOMWindow::~DOMWindow):
2912         (WebCore::DOMWindow::postMessageTimerFired):
2913         (WebCore::DOMWindow::addEventListener):
2914         (WebCore::DOMWindow::removeEventListener):
2915         (WebCore::DOMWindow::dispatchLoadEvent):
2916         (WebCore::DOMWindow::dispatchEvent):
2917         (WebCore::DOMWindow::removeAllEventListeners):
2918         (WebCore::DOMWindow::captureEvents):
2919         (WebCore::DOMWindow::releaseEvents):
2920         (WebCore::DOMWindow::eventTargetData):
2921         (WebCore::DOMWindow::ensureEventTargetData):
2922         * page/DOMWindow.h:
2923         * page/DOMWindow.idl: Use the standard EventTarget APIs.
2924
2925         * page/EventHandler.cpp:
2926         (WebCore::EventHandler::canMouseDownStartSelect):
2927         (WebCore::EventHandler::canMouseDragExtendSelect):
2928         (WebCore::EventHandler::sendResizeEvent):
2929         (WebCore::EventHandler::sendScrollEvent): Use dispatchEvent directly.
2930
2931         * page/EventSource.cpp:
2932         (WebCore::EventSource::endRequest):
2933         (WebCore::EventSource::didReceiveResponse):
2934         (WebCore::EventSource::parseEventStreamLine):
2935         (WebCore::EventSource::stop):
2936         (WebCore::EventSource::createMessageEvent):
2937         (WebCore::EventSource::eventTargetData):
2938         (WebCore::EventSource::ensureEventTargetData):
2939         * page/EventSource.h:
2940         * page/EventSource.idl: Use the standard EventTarget APIs.
2941
2942         * page/FocusController.cpp:
2943         (WebCore::dispatchEventsOnWindowAndFocusedNode):
2944         (WebCore::FocusController::setFocusedFrame):
2945         * page/Frame.cpp:
2946         (WebCore::Frame::shouldClose):
2947         * page/Frame.h:
2948         * page/Page.cpp:
2949         (WebCore::networkStateChanged):
2950         * page/animation/AnimationController.cpp:
2951         (WebCore::AnimationControllerPrivate::updateStyleIfNeededDispatcherFired):
2952         * rendering/RenderListBox.cpp:
2953         (WebCore::RenderListBox::valueChanged):
2954         * rendering/RenderTextControl.cpp:
2955         (WebCore::RenderTextControl::selectionChanged):
2956         * rendering/RenderTextControlMultiLine.cpp:
2957         (WebCore::RenderTextControlMultiLine::subtreeHasChanged): Use dispatchEvent.
2958
2959         * svg/SVGElement.cpp:
2960         (WebCore::hasLoadListener): Rewritten for new EventTarget API.
2961
2962         * svg/SVGElementInstance.cpp:
2963         (WebCore::dummyEventTargetData):
2964         (WebCore::SVGElementInstance::addEventListener):
2965         (WebCore::SVGElementInstance::removeEventListener):
2966         (WebCore::SVGElementInstance::removeAllEventListeners):
2967         (WebCore::SVGElementInstance::dispatchEvent):
2968         (WebCore::SVGElementInstance::eventTargetData):
2969         (WebCore::SVGElementInstance::ensureEventTargetData): Use the EventTarget API.
2970
2971         * svg/SVGElementInstance.h:
2972         * svg/SVGImageLoader.cpp:
2973         (WebCore::SVGImageLoader::dispatchLoadEvent):
2974         * svg/SVGScriptElement.cpp:
2975         (WebCore::SVGScriptElement::dispatchErrorEvent): Use dispatchEvent directly.
2976
2977         * svg/SVGUseElement.cpp:
2978         (WebCore::SVGUseElement::transferEventListenersToShadowTree): Updated for
2979         new EventTarget API.
2980
2981         * svg/animation/SVGSMILElement.cpp:
2982         (WebCore::ConditionEventListener::handleEvent): No more isWindowEvent.
2983
2984         * websockets/WebSocket.cpp:
2985         (WebCore::ProcessWebSocketEventTask::create):
2986         (WebCore::ProcessWebSocketEventTask::performTask):
2987         (WebCore::ProcessWebSocketEventTask::ProcessWebSocketEventTask):
2988         (WebCore::WebSocket::didConnect):
2989         (WebCore::WebSocket::didReceiveMessage):
2990         (WebCore::WebSocket::didClose):
2991         (WebCore::WebSocket::eventTargetData):
2992         (WebCore::WebSocket::ensureEventTargetData):
2993         * websockets/WebSocket.h:
2994         * websockets/WebSocket.idl:
2995         * workers/AbstractWorker.cpp:
2996         (WebCore::AbstractWorker::eventTargetData):
2997         (WebCore::AbstractWorker::ensureEventTargetData):
2998         * workers/AbstractWorker.h:
2999         * workers/AbstractWorker.idl:
3000         * workers/DedicatedWorkerContext.cpp:
3001         * workers/DedicatedWorkerContext.h:
3002         * workers/DedicatedWorkerContext.idl:
3003         * workers/DefaultSharedWorkerRepository.cpp:
3004         (WebCore::SharedWorkerConnectTask::performTask):
3005         (WebCore::SharedWorkerScriptLoader::load):
3006         (WebCore::SharedWorkerScriptLoader::notifyFinished):
3007         * workers/SharedWorker.idl:
3008         * workers/SharedWorkerContext.cpp:
3009         (WebCore::createConnectEvent):
3010         * workers/SharedWorkerContext.h:
3011         * workers/SharedWorkerContext.idl:
3012         * workers/Worker.cpp:
3013         (WebCore::Worker::notifyFinished):
3014         * workers/Worker.h:
3015         * workers/Worker.idl:
3016         * workers/WorkerContext.cpp:
3017         (WebCore::WorkerContext::eventTargetData):
3018         (WebCore::WorkerContext::ensureEventTargetData):
3019         * workers/WorkerContext.h:
3020         * workers/WorkerContext.idl:
3021         * workers/WorkerMessagingProxy.cpp:
3022         (WebCore::MessageWorkerContextTask::performTask):
3023         (WebCore::MessageWorkerTask::performTask):
3024         (WebCore::WorkerExceptionTask::performTask):
3025         * xml/XMLHttpRequest.cpp:
3026         (WebCore::XMLHttpRequest::callReadyStateChangeListener):
3027         (WebCore::XMLHttpRequest::createRequest):
3028         (WebCore::XMLHttpRequest::abort):
3029         (WebCore::XMLHttpRequest::networkError):
3030         (WebCore::XMLHttpRequest::abortError):
3031         (WebCore::XMLHttpRequest::didSendData):
3032         (WebCore::XMLHttpRequest::didReceiveData):
3033         (WebCore::XMLHttpRequest::eventTargetData):
3034         (WebCore::XMLHttpRequest::ensureEventTargetData):
3035         * xml/XMLHttpRequest.h:
3036         * xml/XMLHttpRequest.idl:
3037         * xml/XMLHttpRequestProgressEvent.h:
3038         (WebCore::XMLHttpRequestProgressEvent::create):
3039         * xml/XMLHttpRequestUpload.cpp:
3040         (WebCore::XMLHttpRequestUpload::eventTargetData):
3041         (WebCore::XMLHttpRequestUpload::ensureEventTargetData):
3042         * xml/XMLHttpRequestUpload.h:
3043         * xml/XMLHttpRequestUpload.idl: Use new EventTarget API.
3044
3045 2009-09-23  Kent Tamura  <tkent@chromium.org>
3046
3047         Reviewed by Darin Adler.
3048
3049         - Support for maxLength of <textarea>
3050         - Move numGraphemeClusters() and numCharactersInGraphemeClusters() from InputElement to String.
3051         https://bugs.webkit.org/show_bug.cgi?id=29292
3052
3053         Test: fast/forms/textarea-maxlength.html
3054
3055         * dom/InputElement.cpp:
3056         (WebCore::InputElement::sanitizeUserInputValue):
3057         (WebCore::InputElement::handleBeforeTextInsertedEvent):
3058         * html/HTMLTextAreaElement.cpp:
3059         (WebCore::HTMLTextAreaElement::defaultEventHandler):
3060         (WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent):
3061         (WebCore::HTMLTextAreaElement::sanitizeUserInputValue):
3062         (WebCore::HTMLTextAreaElement::maxLength):
3063         (WebCore::HTMLTextAreaElement::setMaxLength):
3064         * html/HTMLTextAreaElement.h:
3065         * html/HTMLTextAreaElement.idl:
3066         * platform/text/PlatformString.h:
3067         * platform/text/String.cpp:
3068         (WebCore::String::numGraphemeClusters):
3069         (WebCore::String::numCharactersInGraphemeClusters):
3070
3071 2009-09-23  Martin Robinson  <martin.james.robinson@gmail.com>
3072
3073         Reviewed by Xan Lopez.
3074
3075         [GTK] REGRESSION: BitmapImage::getGdkPixbuf fails for non-square images
3076         https://bugs.webkit.org/show_bug.cgi?id=29654
3077
3078         Give GDK_Backspace key events the proper text properties.
3079
3080         Instead of adding new tests, this change removes existing tests
3081         from Gtk's skipped list.
3082
3083         * platform/gtk/KeyEventGtk.cpp:
3084         (WebCore::keyIdentifierForGdkKeyCode):
3085         (WebCore::singleCharacterString):
3086
3087 2009-09-23  Sam Weinig  <sam@webkit.org>
3088
3089         Reviewed by Adam Barth.
3090
3091         Fix for https://bugs.webkit.org/show_bug.cgi?id=26989
3092         Should allow navigation of top-level openers
3093         <rdar://problem/7034025>
3094
3095         Allow navigation of cross-origin window.opener if it is top-level frame.
3096
3097         Test: http/tests/security/frameNavigation/cross-origin-opener.html
3098
3099         * loader/FrameLoader.cpp:
3100         (WebCore::FrameLoader::shouldAllowNavigation):
3101
3102 2009-09-23  Marshall Culpepper  <mculpepper@appcelerator.com>
3103
3104         Reviewed by Eric Seidel.
3105
3106         Added $(WebKitLibrariesDir)/include/cairo so cairo.h is found by
3107         default when the necessary dependencies are extracted into the
3108         WebKitLibrariesDir.
3109         https://bugs.webkit.org/show_bug.cgi?id=29661
3110
3111         * WebCore.vcproj/WebCoreCairo.vsprops:
3112
3113 2009-09-23  Darin Adler  <darin@apple.com>
3114
3115         Reviewed by Sam Weinig.
3116
3117         Crash when website does a history.back() followed by an alert()
3118         https://bugs.webkit.org/show_bug.cgi?id=29686
3119         rdar://problem/6984996
3120
3121         When loading is deferred, we need to defer timer-based loads
3122         too, not just networking-driven loads. Otherwise we can get
3123         syncronouse navigation while running a script, which leads to
3124         crashes and other badness.
3125
3126         This patch includes a manual test; an automated test may be
3127         possible some time in the future.
3128
3129         * dom/Document.cpp:
3130         (WebCore::Document::processHttpEquiv): Use scheduleLocationChange
3131         instead of scheduleHTTPRedirection to implement the navigation
3132         needed for x-frame-options.
3133
3134         * loader/FrameLoader.cpp:
3135         (WebCore::FrameLoader::FrameLoader): Updated for data members with
3136         new names and new data members.
3137         (WebCore::FrameLoader::setDefersLoading): When turning deferral
3138         off, call startRedirectionTimer and startCheckCompleteTimer, since
3139         either of them might have been fired and ignored while defersLoading
3140         was true.
3141         (WebCore::FrameLoader::clear): Updated for replacement of the
3142         m_checkCompletedTimer and m_checkLoadCompleteTimer timers.
3143         (WebCore::FrameLoader::allAncestorsAreComplete): Added.
3144         (WebCore::FrameLoader::checkCompleted): Added code to set
3145         m_shouldCallCheckCompleted to false. Changed code that calls
3146         startRedirectionTimer to call it unconditionally, since that
3147         function now knows when to do work and doesn't expect callers
3148         to handle that any more.
3149         (WebCore::FrameLoader::checkTimerFired): Added. Replaces the old
3150         timer fired callbacks. Calls checkCompleted and checkLoadComplete
3151         as appropriate, but not when defersLoading is true.
3152         (WebCore::FrameLoader::startCheckCompleteTimer): Added. Replaces
3153         the two different calls to start timers before. Only starts the
3154         timers if they are needed.
3155         (WebCore::FrameLoader::scheduleCheckCompleted): Changed to call
3156         startCheckCompleteTimer after setting boolean.
3157         (WebCore::FrameLoader::scheduleCheckLoadComplete): Ditto.
3158         (WebCore::FrameLoader::scheduleHistoryNavigation): Removed
3159         canGoBackOrForward check. The logic works more naturally when
3160         we don't do anything until the timer fires.
3161         (WebCore::FrameLoader::redirectionTimerFired): Do nothing if
3162         defersLoading is true. Also moved canGoBackOrForward check here.
3163         (WebCore::FrameLoader::scheduleRedirection): Changed code that
3164         calls startRedirectionTimer to do so unconditionally. That
3165         function now handles the rules about when to start the timer
3166         rather than expecting the caller to do so.
3167         (WebCore::FrameLoader::startRedirectionTimer): Added code to
3168         handle the case where there is no redirection scheduled,
3169         where the timer is already active, or where this is a classic
3170         redirection and there is an ancestor that has not yet completed
3171         loading.
3172         (WebCore::FrameLoader::completed): Call startRedirectionTimer
3173         here directly instead of calling a cover named parentCompleted.
3174         Hooray! One less function in the giant FrameLoader class!
3175         (WebCore::FrameLoader::checkLoadComplete): Added code to set
3176         m_shouldCallCheckLoadComplete to false.
3177
3178         * loader/FrameLoader.h: Replaced the two functions
3179         checkCompletedTimerFired and checkLoadCompleteTimerFired with
3180         one function, checkTimerFired. Removed the parentCompleted
3181         function. Added the startCheckCompleteTimer and
3182         allAncestorsAreComplete functions. Replaced the
3183         m_checkCompletedTimer and m_checkLoadCompleteTimer data
3184         members with m_checkTimer, m_shouldCallCheckCompleted, and
3185         m_shouldCallCheckLoadComplete.
3186
3187         * manual-tests/go-back-after-alert.html: Added.
3188         * manual-tests/resources/alert-and-go-back.html: Added.
3189
3190 2009-09-23  David Kilzer  <ddkilzer@apple.com>
3191
3192         <http://webkit.org/b/29660> Move "Generate 64-bit Export File" build phase script into DerivedSources.make
3193
3194         Reviewed by Mark Rowe.
3195
3196         The "Generate 64-bit Export File" build phase script generated
3197         the WebCore.LP64.exp export file used to link 64-bit WebCore.
3198         Instead of having a separate build phase script, move its
3199         generation into DerivedSources.make where WebCore.exp is
3200         generated.
3201
3202         * DerivedSources.make: Added a rule to make WebCore.LP64.exp.
3203         Added code to append WebCore.PluginHostProcess.exp to
3204         $(WEBCORE_EXPORT_DEPENDENCIES) when WTF_USE_PLUGIN_HOST_PROCESS
3205         is set to 1.
3206         * WebCore.PluginHostProcess.exp: Renamed from WebCore/WebCore.LP64.exp.
3207         * WebCore.xcodeproj/project.pbxproj: Removed the "Generate
3208         64-bit Export File" build phase script. Renamed WebCore.LP64.exp
3209         to WebCore.PluginHostProcess.exp.
3210
3211 2009-09-23  Peter Kasting  <pkasting@google.com>
3212
3213         Reviewed by Dimitri Glazkov.
3214
3215         https://bugs.webkit.org/show_bug.cgi?id=29694
3216         [Chromium] Eliminate dependency on gfx::Rect from ImageSkia.
3217
3218         * platform/graphics/skia/ImageSkia.cpp:
3219         (WebCore::drawResampledBitmap):
3220
3221 2009-09-22  Timothy Hatcher  <timothy@apple.com>
3222
3223         Prevent scrolling multiple elements during latched wheel events.
3224
3225         Reviewed by Anders Carlsson.
3226
3227         * page/EventHandler.cpp:
3228         (WebCore::scrollAndAcceptEvent):
3229         (WebCore::EventHandler::clear):
3230         (WebCore::EventHandler::handleWheelEvent):
3231         * page/EventHandler.h:
3232         * rendering/RenderBox.cpp:
3233         (WebCore::RenderBox::scroll):
3234         * rendering/RenderBox.h:
3235
3236 2009-09-23  Daniel Bates  <dbates@webkit.org>
3237
3238         Reviewed by Adam Barth.
3239
3240         https://bugs.webkit.org/show_bug.cgi?id=29523
3241         
3242         Fixes an issue where a JavaScript URL that was URL-encoded twice can bypass the
3243         XSSAuditor.
3244         
3245         The method FrameLoader::executeIfJavaScriptURL decodes the URL escape 
3246         sequences in a JavaScript URL before it is eventually passed to the XSSAuditor.
3247         Because the XSSAuditor also decodes the URL escape sequences as part of its
3248         canonicalization, the double decoding of a JavaScript URL would
3249         not match the canonicalization of the input parameters.
3250
3251         Tests: http/tests/security/xssAuditor/iframe-javascript-url-url-encoded.html
3252                http/tests/security/xssAuditor/javascript-link-url-encoded.html
3253
3254         * bindings/js/ScriptController.cpp:
3255         (WebCore::ScriptController::evaluate): Moved call to 
3256         XSSAuditor::canEvaluateJavaScriptURL into FrameLoader::executeIfJavaScriptURL.
3257         * bindings/v8/ScriptController.cpp:
3258         (WebCore::ScriptController::evaluate): Ditto.
3259         * loader/FrameLoader.cpp:
3260         (WebCore::FrameLoader::executeIfJavaScriptURL): Modified to call 
3261         XSSAuditor::canEvaluateJavaScriptURL on the JavaScript URL before it is
3262         decoded.
3263
3264 2009-09-22  Dave Hyatt  <hyatt@apple.com>
3265
3266         Reviewed by John Sullivan.
3267
3268         https://bugs.webkit.org/show_bug.cgi?id=29657
3269         Columns don't break properly in positioned elements with a fixed height.  Make sure that
3270         a block is still considered to have columns even when the column count is 1 if the column
3271         width is non-auto.
3272     
3273         Added fast/multicol/positioned-with-constrained-height.html
3274
3275         * rendering/RenderBlock.cpp:
3276         (WebCore::RenderBlock::setDesiredColumnCountAndWidth):
3277
3278 2009-09-23  Holger Hans Peter Freyther  <zecke@selfish.org>
3279
3280         Rubber-stamped by Simon Hausmann.
3281
3282         Add a null check for the Document*. In the mirror benchmarking
3283         application a crash from a call from JavaScript was observed.
3284
3285         I was not able to come up with a test case for this issue.
3286
3287         * platform/qt/CookieJarQt.cpp:
3288         (WebCore::cookieJar):
3289
3290 2009-09-23  Simon Hausmann  <simon.hausmann@nokia.com>
3291
3292         Reviewed by Tor Arne Vestbø.
3293
3294         Fix the Qt/Windows build, after the introduction of
3295         the page client.
3296
3297         * plugins/win/PluginViewWin.cpp:
3298         (windowHandleForPageClient):
3299         (WebCore::PluginView::getValue):
3300         (WebCore::PluginView::forceRedraw):
3301         (WebCore::PluginView::platformStart):
3302
3303 2009-09-23  Gustavo Noronha Silva  <gns@gnome.org>
3304
3305         Reviewed by Xan Lopez.
3306
3307         [GTK] media tests failing after their rework
3308         https://bugs.webkit.org/show_bug.cgi?id=29532
3309
3310         Correctly advertise the mime types used by the common formats used
3311         in the tests.
3312
3313         Tests that regressed, and will pass again:
3314
3315            media/video-canvas-source.html
3316            media/video-controls.html
3317            media/video-currentTime-set2.html
3318            media/video-dom-autoplay.html
3319            media/video-dom-src.html
3320            media/video-error-abort.html
3321            media/video-load-networkState.html
3322            media/video-load-readyState.html
3323            media/video-muted.html
3324            media/video-no-autoplay.html
3325            media/video-pause-empty-events.html
3326            media/video-play-empty-events.html
3327            media/video-seekable.html
3328            media/video-seeking.html
3329            media/video-size.html
3330            media/video-source-type-params.html
3331            media/video-source-type.html
3332            media/video-source.html
3333            media/video-src-change.html
3334            media/video-src-invalid-remove.html
3335            media/video-src-remove.html
3336            media/video-src-set.html
3337            media/video-src-source.html
3338            media/video-src.html
3339            media/video-timeupdate-during-playback.html
3340            media/video-volume.html
3341
3342         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
3343         (WebCore::mimeTypeCache):
3344
3345 2009-09-22  Charles Wei  <charles.wei@torchmobile.com.cn>
3346
3347         Reviewed by Eric Seidel.
3348
3349         Fix the crash problem with absolte positioned children in foreignobject
3350         htts://bugs.webkit.org/show_bug.cgi?id=26342
3351
3352         Test: svg/custom/foreignobject-crash-with-absolute-positioned-children.svg
3353
3354         * rendering/RenderForeignObject.h:
3355         (WebCore::RenderForeignObject::isSVGForeignObject):
3356         * rendering/RenderObject.cpp:
3357         (WebCore::RenderObject::containingBlock):
3358         * rendering/RenderObject.h:
3359         (WebCore::RenderObject::isSVGForeignObject):
3360
3361 2009-09-22  Drew Wilson  <atwilson@google.com>
3362
3363         Reviewed by David Levin.
3364
3365         SharedWorkers "name" attribute is now optional.
3366         https://bugs.webkit.org/show_bug.cgi?id=28897
3367
3368         Test: fast/workers/shared-worker-name.html
3369
3370         * bindings/js/JSSharedWorkerConstructor.cpp:
3371         (WebCore::constructSharedWorker):
3372         Default 'name' attribute to empty string if it is not provided.
3373         * bindings/v8/custom/V8SharedWorkerCustom.cpp:
3374         (WebCore::CALLBACK_FUNC_DECL):
3375         Default 'name' attribute to empty string if it is not provided.
3376         * workers/DefaultSharedWorkerRepository.cpp:
3377         (WebCore::SharedWorkerProxy::matches):
3378         Now matches URLs if names are empty strings.
3379         (WebCore::DefaultSharedWorkerRepository::getProxy):
3380         Pass URL in to SharedWorkerProxy::matches().
3381
3382 2009-09-22  Dimitri Glazkov  <dglazkov@chromium.org>
3383
3384         Unreviewed, another build fix.
3385
3386         [Chromium] Add another missing include.
3387         https://bugs.webkit.org/show_bug.cgi?id=29536
3388
3389         * inspector/InspectorController.cpp: Added DOMWindow.h include.
3390
3391 2009-09-22  Dimitri Glazkov  <dglazkov@chromium.org>
3392
3393         Unreviewed, build fix.
3394
3395         [Chromium] Add missing include.
3396         https://bugs.webkit.org/show_bug.cgi?id=29536
3397
3398         * inspector/InspectorDOMStorageResource.cpp: Added DOMWindow.h include.
3399
3400 2009-09-22  Darin Adler  <darin@apple.com>
3401
3402         Reviewed by Sam Weinig.
3403
3404         Tighten up the ScheduledRedirection machinery to prepare for a bug fix
3405         https://bugs.webkit.org/show_bug.cgi?id=29663
3406
3407         * loader/FrameLoader.cpp:
3408         (WebCore::ScheduledRedirection::ScheduledRedirection): Added a boolean,
3409         initialized to false, to keep track if the redirection has been
3410         communicated to the client.
3411         (WebCore::FrameLoader::stopLoading): Tweaked a comment.
3412         (WebCore::FrameLoader::cancelRedirection): Removed code to clear
3413         m_scheduledRedirection.clear since stopRedirectionTimer does that now.
3414         (WebCore::FrameLoader::allChildrenAreComplete): Added.
3415         (WebCore::FrameLoader::checkCompleted): Use allChildrenAreComplete
3416         function for clarity.
3417         (WebCore::FrameLoader::checkCallImplicitClose): Ditto.
3418         (WebCore::FrameLoader::scheduleRedirection): Changed to take a PassOwnPtr.
3419         (WebCore::FrameLoader::startRedirectionTimer): Added code to set the
3420         toldClient flag and not call clientRedirected a second time if it is set.
3421         (WebCore::FrameLoader::stopRedirectionTimer): Changed so this can be safely
3422         called multiple times and it will call clientRedirectCancelledOrFinished
3423         only once.
3424
3425         * loader/FrameLoader.h: Changed scheduleRedirection to be a PassOwnPtr.
3426         Added allChildrenAreComplete function.
3427
3428 2009-09-22  Yury Semikhatsky  <yurys@chromium.org>
3429
3430         Reviewed by Timothy Hatcher.
3431
3432         WebInspector: Migrate Databases tab to InjectedScript /
3433         serialized interaction.
3434
3435         DOMStorage interaction is now serialized into JSON messages
3436         and doesn't require quarantined objects.
3437         
3438         https://bugs.webkit.org/show_bug.cgi?id=28873
3439
3440         * dom/EventListener.h:
3441         (WebCore::EventListener::):
3442         * inspector/InspectorBackend.cpp:
3443         (WebCore::InspectorBackend::selectDOMStorage):
3444         (WebCore::InspectorBackend::getDOMStorageEntries):
3445         (WebCore::InspectorBackend::setDOMStorageItem):
3446         (WebCore::InspectorBackend::removeDOMStorageItem):
3447         * inspector/InspectorBackend.h:
3448         * inspector/InspectorBackend.idl:
3449         * inspector/InspectorController.cpp:
3450         (WebCore::InspectorController::didCommitLoad):
3451         (WebCore::InspectorController::selectDOMStorage):
3452         (WebCore::InspectorController::getDOMStorageEntries):
3453         (WebCore::InspectorController::setDOMStorageItem):
3454         (WebCore::InspectorController::removeDOMStorageItem):
3455         (WebCore::InspectorController::getDOMStorageResourceForId):
3456         * inspector/InspectorController.h:
3457         * inspector/InspectorDOMStorageResource.cpp:
3458         (WebCore::InspectorDOMStorageResource::InspectorDOMStorageResource):
3459         (WebCore::InspectorDOMStorageResource::bind):
3460         (WebCore::InspectorDOMStorageResource::unbind):
3461         (WebCore::InspectorDOMStorageResource::startReportingChangesToFrontend):
3462         (WebCore::InspectorDOMStorageResource::handleEvent):
3463         (WebCore::InspectorDOMStorageResource::operator==):
3464         * inspector/InspectorDOMStorageResource.h:
3465         (WebCore::InspectorDOMStorageResource::cast):
3466         (WebCore::InspectorDOMStorageResource::id):
3467         (WebCore::InspectorDOMStorageResource::domStorage):
3468         * inspector/InspectorFrontend.cpp:
3469         (WebCore::InspectorFrontend::selectDOMStorage):
3470         (WebCore::InspectorFrontend::didGetDOMStorageEntries):
3471         (WebCore::InspectorFrontend::didSetDOMStorageItem):
3472         (WebCore::InspectorFrontend::didRemoveDOMStorageItem):
3473         (WebCore::InspectorFrontend::updateDOMStorage):
3474         * inspector/InspectorFrontend.h:
3475         * inspector/front-end/DOMStorage.js:
3476         (WebInspector.DOMStorage):
3477         (WebInspector.DOMStorage.prototype.get id):
3478         (WebInspector.DOMStorage.prototype.get domStorage):
3479         (WebInspector.DOMStorage.prototype.get isLocalStorage):
3480         (WebInspector.DOMStorage.prototype.getEntriesAsync):
3481         (WebInspector.DOMStorage.prototype.setItemAsync):
3482         (WebInspector.DOMStorage.prototype.removeItemAsync):
3483         * inspector/front-end/DOMStorageDataGrid.js:
3484         (WebInspector.DOMStorageDataGrid):
3485         (WebInspector.DOMStorageDataGrid.prototype._startEditingColumnOfDataGridNode):
3486         (WebInspector.DOMStorageDataGrid.prototype._startEditing):
3487         (WebInspector.DOMStorageDataGrid.prototype._editingCommitted):
3488         (WebInspector.DOMStorageDataGrid.prototype._editingCancelled):
3489         (WebInspector.DOMStorageDataGrid.prototype.deleteSelectedRow):
3490         * inspector/front-end/DOMStorageItemsView.js:
3491         (WebInspector.DOMStorageItemsView.prototype.update):
3492         (WebInspector.DOMStorageItemsView.prototype._showDOMStorageEntries):
3493         (WebInspector.DOMStorageItemsView.prototype._dataGridForDOMStorageEntries):
3494         * inspector/front-end/StoragePanel.js:
3495         (WebInspector.StoragePanel.prototype.show):
3496         (WebInspector.StoragePanel.prototype.reset):
3497         (WebInspector.StoragePanel.prototype.selectDOMStorage):
3498         (WebInspector.StoragePanel.prototype.updateDOMStorage):
3499         (WebInspector.StoragePanel.prototype._domStorageForId):
3500         * inspector/front-end/inspector.js:
3501         (WebInspector.addDOMStorage):
3502         (WebInspector.updateDOMStorage):
3503
3504 2009-09-22  Sam Weinig  <sam@webkit.org>
3505
3506         Reviewed by Alexey Proskuryakov.
3507
3508         Fix for XMLHttpRequest.abort() should destroy the response text.
3509         https://bugs.webkit.org/show_bug.cgi?id=29658
3510         <rdar://problem/5301430>
3511
3512         Clearing the response text after calling XMLHttpRequest.abort() is necessary
3513         per spec and matches Firefox. It is also a potential memory win.
3514
3515         Test: http/tests/xmlhttprequest/abort-should-destroy-responseText.html
3516
3517         * xml/XMLHttpRequest.cpp:
3518         (WebCore::XMLHttpRequest::abort): Clear the response text making sure to
3519         keep the actual ResourceReponse around so that the response status and response
3520         status text are kept around.
3521
3522 2009-09-22  Dimitri Glazkov  <dglazkov@chromium.org>
3523
3524         No review, rolling out r48639.
3525         http://trac.webkit.org/changeset/48639
3526
3527         * bindings/v8/V8GCController.cpp:
3528         (WebCore::ObjectGrouperVisitor::visitDOMWrapper):
3529
3530 2009-09-22  Dumitru Daniliuc  <dumi@chromium.org>
3531
3532         Reviewed by Dimitri Glazkov.
3533
3534         Changing the transaction coordinator to (re-)allow multiple read
3535         transactions on the same database to run concurrently (without
3536         risking a deadlock this time).
3537
3538         https://bugs.webkit.org/show_bug.cgi?id=29115
3539
3540         Tests: storage/read-and-write-transactions-dont-run-together.html
3541                storage/read-transactions-running-concurrently.html
3542
3543         * storage/SQLTransaction.h:
3544         (WebCore::SQLTransaction::isReadOnly): Returns the type of the
3545         transaction.
3546         * storage/SQLTransactionCoordinator.cpp:
3547         (WebCore::SQLTransactionCoordinator::acquireLock): Changed to
3548         allow multiple read transactions on the same DB to run
3549         concurrently.
3550         (WebCore::SQLTransactionCoordinator::releaseLock): Changed to
3551         allow multiple read transactions on the same DB to run
3552         concurrently.
3553         (WebCore::SQLTransactionCoordinator::shutdown): Renamed the map.
3554         * storage/SQLTransactionCoordinator.h:
3555
3556 2009-09-22  Peter Kasting  <pkasting@google.com>
3557
3558         Reviewed by David Levin.
3559
3560         https://bugs.webkit.org/show_bug.cgi?id=29652
3561         Support true system colors for CSS system colors in Chromium/Win.
3562
3563         * rendering/RenderThemeChromiumWin.cpp:
3564         (WebCore::cssValueIdToSysColorIndex):
3565         (WebCore::RenderThemeChromiumWin::systemColor):
3566         * rendering/RenderThemeChromiumWin.h:
3567
3568 2009-09-22  Beth Dakin  <bdakin@apple.com>
3569
3570         Reviewed by Dave Hyatt.
3571
3572         Fix for <rdar://problem/6925121> SAP: Wrong width calculation in 
3573         table with fixed layout
3574         -and corresponding-
3575         https://bugs.webkit.org/show_bug.cgi?id=29501
3576
3577         New Tests:
3578         * fast/table/fixed-table-with-percent-inside-percent-table.html: Added.
3579         * fast/table/fixed-table-with-percent-width-inside-auto-table.html: Added.
3580         * fast/table/fixed-table-with-percent-width-inside-div.html: Added.
3581         * fast/table/fixed-table-with-percent-width-inside-extra-large-div.html: Added.
3582         * fast/table/fixed-table-with-percent-width-inside-fixed-width-table.html: Added.
3583         * fast/table/fixed-table-with-small-percent-width.html: Added.
3584
3585         This new quirk is very similar to an existing one that was 
3586         implemented in revision 4316.
3587         * rendering/FixedTableLayout.cpp:
3588         (WebCore::FixedTableLayout::calcPrefWidths):
3589
3590 2009-09-22  Brian Weinstein  <bweinstein@apple.com>
3591
3592         Reviewed by Timothy Hatcher.
3593
3594         List HTTP status code with response headers in resources tab of Web Inspector.
3595         http://webkit.org/b/19945
3596
3597         This patch adds a new top level list in the resources tab, HTTP Information, that 
3598         for now, contains the Request Method (GET, POST, etc.) and the Status Code (200, 404, etc.).
3599         Additionally, it adds a colored dot next to the requested URL to show the status 
3600         (green for success, orange for redirect, red for error).
3601
3602         * English.lproj/localizedStrings.js:
3603         * inspector/front-end/ImageView.js:
3604         (WebInspector.ImageView):
3605         * inspector/front-end/Images/errorRedDot.png: Added.
3606         * inspector/front-end/Images/successGreenDot.png: Added.
3607         * inspector/front-end/Images/warningOrangeDot.png: Added.
3608         * inspector/front-end/Resource.js:
3609         (WebInspector.Resource.StatusTextForCode):
3610         * inspector/front-end/ResourceView.js:
3611         (WebInspector.ResourceView):
3612         (WebInspector.ResourceView.prototype._refreshURL):
3613         (WebInspector.ResourceView.prototype._refreshHTTPInformation):
3614         * inspector/front-end/inspector.css:
3615
3616 2009-09-22  Brady Eidson  <beidson@apple.com>
3617
3618         Reviewed by Darin Adler.
3619
3620         Back list isn't properly updated for fragment changes after a redirect.
3621         <rdar://problem/6142803> and https://bugs.webkit.org/show_bug.cgi?id=20355
3622
3623         Test: fast/loader/fragment-after-redirect-gets-back-entry.html
3624
3625         * loader/FrameLoader.cpp:
3626         (WebCore::FrameLoader::loadURL): Properly reset the policy FrameLoadType before
3627           consulting the policy delegate for fragment scrolling.
3628
3629 2009-09-22  Darin Fisher  <darin@chromium.org>
3630
3631         Reviewed by Dimitri Glazkov.
3632
3633         Drop down selects get stuck in the non-visible state and cannot be opened.
3634         https://bugs.webkit.org/show_bug.cgi?id=29645
3635
3636         All paths that lead to hiding the popup menu must call popupDidHide on
3637         the PopupMenuClient.  This change makes it so by moving all of the
3638         hiding logic to PopupListBox::hidePopup.
3639
3640         * platform/chromium/PopupMenuChromium.cpp:
3641         (WebCore::PopupContainer::hidePopup):
3642         (WebCore::PopupListBox::hidePopup):
3643         * platform/chromium/PopupMenuChromium.h:
3644
3645 2009-09-22  Patrick Mueller  <Patrick_Mueller@us.ibm.com>
3646