Fix the Qt build.
[WebKit-https.git] / WebCore / ChangeLog
1 2008-03-22  Mark Rowe  <mrowe@apple.com>
2
3         Qt build fix.
4
5         * bridge/qt/qt_runtime.cpp:
6         (KJS::Bindings::valueRealType):
7
8 2008-03-22  Eric Seidel  <eric@webkit.org>
9
10         Reviewed by mjs.
11
12         Unify handling of NAMESPACE_ERR and fix Acid3 test 25
13         http://bugs.webkit.org/show_bug.cgi?id=16693
14
15         Test: fast/dom/DOMImplementation/createDocumentType-err.html
16
17         * dom/DOMImplementation.cpp:
18         (WebCore::DOMImplementation::createDocumentType):
19         (WebCore::DOMImplementation::createDocument):
20         * dom/DOMImplementation.idl:
21         * dom/Document.cpp:
22         (WebCore::Document::hasPrefixNamespaceMismatch):
23         (WebCore::Document::createElementNS):
24         (WebCore::Document::parseQualifiedName):
25         (WebCore::Document::createAttributeNS):
26         * dom/Document.h:
27         * dom/Element.cpp:
28         (WebCore::Element::setAttributeNS):
29         * editing/FormatBlockCommand.cpp:
30         (WebCore::FormatBlockCommand::doApply):
31
32 2008-03-22  Eric Seidel  <eric@webkit.org>
33
34         Reviewed by mjs.
35
36         Fix createElementNS to throw exceptions for invalid qualified names
37         Fixes Acid3 sub-test 23
38         http://bugs.webkit.org/show_bug.cgi?id=16833
39
40         Tests: fast/dom/Document/createAttributeNS-namespace-err.html
41                fast/dom/Document/createElementNS-namespace-err.html
42
43         * dom/Document.cpp:
44         (WebCore::Document::createElement):
45         (WebCore::hasNamespaceError):
46         (WebCore::Document::createElementNS):
47         (WebCore::Document::createAttributeNS):
48         * dom/Document.idl:
49
50 2008-03-21  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
51
52         Reviewed by Oliver Hunt.
53
54         Bug 13693: REGRESSION (r13615): Acid2 Test Eyes render improperly after a page refresh
55         <http://bugs.webkit.org/show_bug.cgi?id=13693>
56
57         Do not create bogus history items for unloaded <object> elements, because they
58         cause fallback content to be ignored on reload.
59
60         * loader/FrameLoader.cpp:
61         (WebCore::FrameLoader::createHistoryItemTree):
62
63 2008-03-21  Dan Bernstein  <mitz@apple.com>
64
65         Reviewed by Oliver Hunt.
66
67         - fix http://bugs.webkit.org/show_bug.cgi?id=17988
68           REGRESSION (r31114-31132): Crash in InlineBox::isDirty() opening chowhound.com
69
70         Test: fast/css-generated-content/empty-content-with-float-crash.html
71
72         * rendering/bidi.cpp:
73         (WebCore::RenderBlock::layoutInlineChildren): Added a null check for
74         the case where the block contains no in-flow elements but still lays
75         out as a line flow, which can happen as a result of empty generated
76         content.
77
78 2008-03-21  Sam Weinig  <sam@webkit.org>
79
80         Reviewed by Oliver Hunt.
81
82         Fix <rdar://problem/5788451>
83         toDataURL not implemented for Windows (need mapping of MIME type to UTI)
84
85         Hard code support for just PNG's on windows, the minimum the spec requires.
86
87         * platform/MIMETypeRegistry.cpp:
88         (WebCore::initializeSupportedImageMIMETypesForEncoding):
89         * platform/graphics/cg/ImageBufferCG.cpp:
90         (WebCore::utiFromMIMEType):
91         (WebCore::ImageBuffer::toDataURL):
92
93 2008-03-21  Matt Lilek  <webkit@mattlilek.com>
94
95         Not reviewed, Mac build fix.
96
97         * bindings/objc/WebScriptObject.mm:
98         (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
99         * bridge/jni/jni_utility.cpp:
100         (KJS::Bindings::convertValueToJValue):
101         * bridge/objc/objc_runtime.mm:
102         (ObjcFallbackObjectImp::callAsFunction):
103
104 2008-03-21  Adam Roben  <aroben@apple.com>
105
106         Attempt to fix the Mac build
107
108         * bindings/objc/DOMUtility.mm:
109         (KJS::createDOMWrapper):
110
111 2008-03-21  Adam Roben  <aroben@apple.com>
112
113         Rename static info members to s_info
114
115         This avoids conflicts with custom "info" methods, such as the one that
116         will soon be added to Console.
117
118         Reviewed by Ada Chan and Sam Weinig.
119
120 2008-03-21  David Hyatt  <hyatt@apple.com>
121
122         <rdar://problem/5808863> Zooming should not let non-zero border width become zero
123
124         Make sure zoomed values that begin >= 1 are not allowed to fall below 1.
125
126         Reviewed by adele
127
128         * css/CSSPrimitiveValue.cpp:
129         (WebCore::CSSPrimitiveValue::computeLengthDouble):
130         * loader/CachedImage.cpp:
131         (WebCore::CachedImage::imageSize):
132         (WebCore::CachedImage::imageRect):
133
134 2008-03-21  Kevin McCullough  <kmccullough@apple.com>
135
136         Reviewed by Sam.
137
138         -<rdar://problem/5712804> XMLHttpRequests do not show response contents, preview images (14313)
139         -<rdar://problem/5712931> XMLHttpRequests should be shown separately and grouped (14315)
140         -<rdar://problem/5732836> XMLHttpRequest: Inspector should show network activity/XHR in Console (17233)
141         - Instrument the InspectorController to cache XHR resrouces since they are not cached by WebCore.
142         The resources will be kept in the same map as all other resources so they will have the exact
143         same lifecycle. 
144
145         * ChangeLog:
146         * page/InspectorController.cpp:
147         (WebCore::InspectorCachedXMLHttpRequestResource::type):
148         (WebCore::InspectorCachedXMLHttpRequestResource::setType):
149         (WebCore::InspectorCachedXMLHttpRequestResource::data):
150         (WebCore::InspectorCachedXMLHttpRequestResource::setData):
151         (WebCore::InspectorCachedXMLHttpRequestResource::encoding):
152         (WebCore::InspectorCachedXMLHttpRequestResource::setEncoding):
153         (WebCore::InspectorCachedXMLHttpRequestResource::create):
154         (WebCore::InspectorCachedXMLHttpRequestResource::InspectorCachedXMLHttpRequestResource):
155         * xml/XMLHttpRequest.cpp:
156         (WebCore::XMLHttpRequest::send):
157
158 2008-03-21  Rodney Dawes  <dobey@wayofthemonkey.com>
159
160         Reviewed by Holger.
161
162         http://bugs.webkit.org/show_bug.cgi?id=17981
163
164         Remove WebCore/ForwardingHeaders from cppflags as it is not needed,
165         and causes build problems with GTK+.
166
167         * GNUmakefile.am:
168
169 2008-03-21  Dan Bernstein  <mitz@apple.com>
170
171         Reviewed by Adele Peterson.
172
173         - fix http://bugs.webkit.org/show_bug.cgi?id=17966
174           REGRESSION (r31114-r31132): Clearing via br behaves unpredictably
175
176         Test: fast/block/float/br-with-clear.html
177
178         * rendering/bidi.cpp:
179         (WebCore::RenderBlock::layoutInlineChildren): Fixed the logic for the
180         very special case of an all-lines-clean block that ends with a float-
181         clearing <br> by looking for the <br> at the end of the line rather
182         than at its beginning.
183
184 2008-03-21  Adam Roben  <aroben@apple.com>
185
186         Don't allow any newly-scheduled plugin requests to be serviced when JS is paused
187
188         This is a followup to r31199.
189
190         Reviewed by Tim Hatcher.
191
192         * plugins/PluginView.cpp:
193         (WebCore::PluginView::requestTimerFired): Added an assertion that JS
194         is not paused.
195         (WebCore::PluginView::scheduleRequest): Don't start the request timer
196         if JS is paused. This is the bug fix.
197         (WebCore::PluginView::setJavaScriptPaused): Replaced the use of
198         m_requestTimerWasActive with a check to see if we have any pending
199         requests. m_requestTimerWasActive would not be accurate if a new
200         request had been scheduled while JS was paused.
201         (WebCore::PluginView::PluginView): Removed initialization of
202         m_requestTimerWasActive.
203         * plugins/PluginView.h: Removed m_requestTimerWasActive.
204
205 2008-03-20  Dan Bernstein  <mitz@apple.com>
206
207         Reviewed by Anders Carlsson.
208
209         - fix an assertion failure due to a line being marked dirty during
210           computeVerticalPositionsForLine() due to temporary box destruction
211
212         Test: fast/inline/clean-after-removing-temp-boxes.html
213
214         * rendering/RenderText.cpp:
215         (WebCore::RenderText::setTextWithOffset): Added code to dirty lines
216         when this method is called on an empty text node, which has no line
217         boxes.
218         * rendering/bidi.cpp:
219         (WebCore::RenderBlock::computeVerticalPositionsForLine): Mark the line
220         clean in the end.
221
222 2008-03-20  Anders Carlsson  <andersca@apple.com>
223
224         Reviewed by Maciej.
225
226         Make some member variables private.
227         
228         * loader/ResourceLoader.cpp:
229         (WebCore::ResourceLoader::ResourceLoader):
230         * loader/ResourceLoader.h:
231
232 2008-03-20  Anders Carlsson  <andersca@apple.com>
233
234         Reviewed by Maciej.
235
236         Get rid of m_originalURL in ResourceLoader.
237
238         * loader/ResourceLoader.cpp:
239         (WebCore::ResourceLoader::load):
240         Don't store m_originalURL.
241         
242         * loader/ResourceLoader.h:
243         * loader/SubresourceLoader.cpp:
244         (WebCore::SubresourceLoader::willSendRequest):
245         Use the url of the current request instead of the original URL.
246
247 2008-03-20  Anders Carlsson  <andersca@apple.com>
248
249         Reviewed by Maciej.
250
251         Small loader cleanups.
252         
253         * loader/MainResourceLoader.cpp:
254         (WebCore::MainResourceLoader::willSendRequest):
255         No need to call setRequest here, ResourceLoader::willSendRequest takes care of that. 
256         Also, there is no need to check that newRequest is null here, because we assert earlier that it is not.
257         
258         * loader/ResourceLoader.h:
259         Get rid of setRequest, it is no longer needed.
260
261 2008-03-20  Anders Carlsson  <andersca@apple.com>
262
263         Get rid of a couple of unnecessary class declarations.
264         
265         * loader/SubresourceLoader.h:
266
267 2008-03-20  David Hyatt  <hyatt@apple.com>
268
269         Add a new value to background-clip, "text", that allows backgrounds to be clipped to foreground text (and
270         associated text decorations like shadows and underlines).
271
272         Reviewed by Beth
273
274         * css/CSSParser.cpp:
275         (WebCore::CSSParser::parseBackgroundProperty):
276         * css/CSSPrimitiveValueMappings.h:
277         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
278         (WebCore::CSSPrimitiveValue::operator EBackgroundBox):
279         * platform/graphics/GraphicsContext.cpp:
280         (WebCore::GraphicsContext::clipToImageBuffer):
281         * platform/graphics/GraphicsContext.h:
282         * platform/graphics/cg/GraphicsContextCG.cpp:
283         (WebCore::GraphicsContext::clipToImageBuffer):
284         * rendering/InlineBox.cpp:
285         (WebCore::InlineBox::paint):
286         * rendering/InlineFlowBox.cpp:
287         (WebCore::InlineFlowBox::paintBackgrounds):
288         (WebCore::InlineFlowBox::paintBackground):
289         (WebCore::InlineFlowBox::paintBoxDecorations):
290         * rendering/InlineFlowBox.h:
291         * rendering/InlineTextBox.cpp:
292         (WebCore::InlineTextBox::paint):
293         * rendering/RenderBlock.cpp:
294         (WebCore::RenderBlock::paintColumns):
295         (WebCore::RenderBlock::paintObject):
296         (WebCore::RenderBlock::paintFloats):
297         * rendering/RenderBlock.h:
298         * rendering/RenderBox.cpp:
299         (WebCore::RenderBox::paintRootBoxDecorations):
300         (WebCore::RenderBox::paintBoxDecorations):
301         (WebCore::RenderBox::paintBackgrounds):
302         (WebCore::RenderBox::paintBackground):
303         (WebCore::RenderBox::paintBackgroundExtended):
304         * rendering/RenderBox.h:
305         * rendering/RenderFieldset.cpp:
306         (WebCore::RenderFieldset::paintBoxDecorations):
307         * rendering/RenderFlow.cpp:
308         (WebCore::RenderFlow::paintLines):
309         * rendering/RenderObject.h:
310         (WebCore::):
311         (WebCore::RenderObject::paintBackgroundExtended):
312         * rendering/RenderStyle.h:
313         (WebCore::):
314         * rendering/RenderTable.cpp:
315         (WebCore::RenderTable::paintBoxDecorations):
316         * rendering/RenderTableCell.cpp:
317         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
318
319 2008-03-20  Adam Roben  <aroben@apple.com>
320
321         Allow pausing/blocking of JS execution by plugins
322
323         Part of Bug 17133: Should support pausing JavaScript execution without
324         hanging the process
325
326         <http://bugs.webkit.org/show_bug.cgi?id=17133>
327         <rdar://problem/5719551>
328
329         This patch doesn't affect Mac, which doesn't use the shared PluginView
330         code.
331
332         Note that this patch doesn't prevent plugins from executing JS via an
333         NPObject they've already gotten hold of. It just blocks obtaining new
334         NPObjects and pauses any requests to evaluate javascript: URIs. This
335         is probably good enough for now because most plugins seem to always
336         obtain the Window object each time they want to execute JS.
337
338         Reviewed by Tim Hatcher.
339
340         * plugins/PluginView.cpp:
341         (WebCore::PluginView::getValue): Return an error if JS is paused.
342         (WebCore::PluginView::setJavaScriptPaused): Stop the request timer if
343         we're pausing, and resume it if we're unpausing.
344         (WebCore::PluginView::PluginView): Initialize new members.
345         * plugins/PluginView.h:
346
347 2008-03-20  Adam Roben  <aroben@apple.com>
348
349         Allow pausing of callOnMainThread callbacks
350
351         Part of Bug 17133: Should support pausing JavaScript execution without
352         hanging the process
353
354         <http://bugs.webkit.org/show_bug.cgi?id=17133>
355         <rdar://problem/5719551>
356
357         Reviewed by Tim Hatcher.
358
359         * platform/MainThread.cpp:
360         (WebCore::dispatchFunctionsFromMainThread): If callbacks are paused,
361         don't dispatch the functions.
362         (WebCore::setMainThreadCallbacksPaused): Added. If we're being
363         unpaused, call scheduleDispatchFunctionsOnMainThread so that any
364         queued callbacks will get dispatched in the near future.
365         * platform/MainThread.h:
366
367 2008-03-20  Adam Roben  <aroben@apple.com>
368
369         Allow blocking of JS event handlers/javascript: URIs per-Frame
370
371         Part of Bug 17133: Should support pausing JavaScript execution without
372         hanging the process
373
374         <http://bugs.webkit.org/show_bug.cgi?id=17133>
375         <rdar://problem/5719551>
376
377         Two new methods are added to KJSProxy: setPaused and isPaused. When
378         setPaused(true) is called, JS event handlers are blocked and
379         javascript: URIs will not be evaluated.
380
381         Reviewed by Tim Hatcher.
382
383         * bindings/js/kjs_events.cpp:
384         (WebCore::JSAbstractEventListener::handleEvent):
385           - Removed some old KJS_DEBUGGER code
386           - Don't run the handler if the KJSProxy is paused.
387         * bindings/js/kjs_proxy.cpp:
388         (WebCore::KJSProxy::KJSProxy): Initialize new member.
389         * bindings/js/kjs_proxy.h: Added new methods.
390         * loader/FrameLoader.cpp:
391         (WebCore::FrameLoader::executeScript): Don't execute the script if the
392         KJSProxy is paused.
393
394 2008-03-20  Jon Honeycutt  <jhoneycutt@apple.com>
395
396         Reviewed by Anders.
397
398         Fix Windows warning / leak: warning C4150: deletion of pointer to
399         incomplete type 'WebCore::PluginRequest'; no destructor called
400
401         * plugins/PluginView.cpp: Move PluginRequest class to PluginView.h so
402         Windows PluginView destructor can use WTF::deleteAllValues to clean up
403         m_requests.
404         * plugins/PluginView.h:
405         (WebCore::PluginRequest::PluginRequest):
406         (WebCore::PluginRequest::frameLoadRequest):
407         (WebCore::PluginRequest::notifyData):
408         (WebCore::PluginRequest::sendNotification):
409         (WebCore::PluginRequest::shouldAllowPopups):
410
411 2008-03-20  Mark Rowe  <mrowe@apple.com>
412
413         Reviewed by Sam Weinig.
414
415         Ensure that the defines in FEATURE_DEFINES are sorted so that they will match the default settings of build-webkit.
416         This will prevent the world from being rebuilt if you happen to switch between building in Xcode and with build-webkit on the
417         command-line.
418
419         * Configurations/WebCore.xcconfig:
420
421 2008-03-20  Jon Honeycutt  <jhoneycutt@apple.com>
422
423         Reviewed by Anders.
424
425         <rdar://problem/5809600> REGRESSION:
426         http/tests/plugins/cross-frame-object-access.html hangs Windows Layout
427         Tests
428
429         r30897 changed the way we conditionalize this feature.
430
431         * plugins/PluginView.cpp:
432         (WebCore::PluginView::getValue): Test ENABLE(NETSCAPE_PLUGIN_API)
433         instead of USE(NPOBJECT).
434         (WebCore::PluginView::bindingInstance): Same.
435
436 2008-03-20  Adam Roben  <aroben@apple.com>
437
438         Highlight nodes when you hover over them in the Console
439
440         Part of Bug 16532: Inspector should highlight nodes in page when
441         hovering over nodes in Inspector's interface
442
443         <http://bugs.webkit.org/show_bug.cgi?id=16532>
444         <rdar://problem/5712896>
445
446         Reviewed by Tim Hatcher.
447
448         * page/inspector/ConsolePanel.js:
449         (WebInspector.ConsolePanel._formatnode): Add mouseover/mouseout event
450         listeners to highlight the node and clear the highlight.
451
452 2008-03-20  Adam Roben  <aroben@apple.com>
453
454         Highlight nodes in the page when you hover over their DOM breadcrumbs
455
456         Part of Bug 16532: Inspector should highlight nodes in page when
457         hovering over nodes in Inspector's interface
458
459         <http://bugs.webkit.org/show_bug.cgi?id=16532>
460         <rdar://problem/5712896>
461
462         Reviewed by Tim Hatcher.
463
464         * page/inspector/DocumentPanel.js:
465         (WebInspector.DocumentPanel): Add an mouseout event listener to the
466         breadcrumbs element to clear the highlighted node.
467         (WebInspector.DocumentPanel.updateBreadcrumbs): Change the mouseover
468         event listener to highlight the node represented by the hovered
469         breadcrumb.
470
471 2008-03-20  Adam Roben  <aroben@apple.com>
472
473         Highlight nodes in the page when you hover over them in the DOM tree
474
475         Part of Bug 16532: Inspector should highlight nodes in page when
476         hovering over nodes in Inspector's interface
477
478         <http://bugs.webkit.org/show_bug.cgi?id=16532>
479         <rdar://problem/5712896>
480
481         The inspected node is no longer highlighted (unless, of course, you
482         hover over it).
483
484         Reviewed by Tim Hatcher.
485
486         * page/inspector/DocumentPanel.js:
487         (WebInspector.DocumentPanel):
488           - Don't highlight the focused node when the DOM tree is shown
489           - Added mousemove/mouseout event listeners to set/clear the
490             highlighted node. These are added to the root of the DOM tree
491             instead of to each individual list item to avoid flashing as the
492             mouse moves between nodes.
493         (WebInspector.DocumentPanel.set focusedDOMNode): Don't highlight the
494         focused node.
495         (WebInspector.DocumentPanel._onmousemove): Highlight the node under
496         the mouse.
497
498 2008-03-20  Adam Roben  <aroben@apple.com>
499
500         Show nodes' content/padding/border/margin boxes in the node highlight
501
502         Part of Bug 17221: Node highlight should show node metrics
503
504         <http://bugs.webkit.org/show_bug.cgi?id=17221>
505         <rdar://problem/5732822>
506
507         Outstanding issues:
508           1) We don't show padding/border/margins for inlines
509           2) We don't show any numeric metrics, we just draw the boxes
510           3) We'll probably want to tweak the look of the highlight some, at
511              least to make the boxes better distinguishable
512
513         Reviewed by Tim Hatcher.
514
515         * page/InspectorController.cpp:
516         (WebCore::drawOutlinedRect): Added. Just draws a single rect.
517         (WebCore::drawHighlightForBoxes): Added. Takes the rects we calculated
518         for the node and draws the highlight.
519         (WebCore::InspectorController::drawNodeHighlight): Calculates the
520         content/padding/border/margin boxes for blocks and passes them off to
521         drawHighlightForBoxes. The behavior for inlines is for now unchanged.
522
523 2008-03-20  Adam Roben  <aroben@apple.com>
524
525         Fix RenderContainer's override of addLineBoxRects to match RenderObject's
526
527         RenderContainer::addLineBoxRects was never getting called because its
528         parameters didn't match those of RenderObject::addLineBoxRects.
529
530         Reviewed by Mitz Pettel.
531
532         No test possible.
533
534         * rendering/RenderContainer.cpp: Added an optional bool
535         useSelectionHeight parameter to match RenderObject's method.
536         * rendering/RenderContainer.h: Ditto.
537
538 2008-03-20  Marco Barisione  <marco.barisione@collabora.co.uk>
539
540         Reviewed by Alp Toker.
541
542         http://bugs.webkit.org/show_bug.cgi?id=17946
543         [GTK] Widgets are not clipped
544
545         * platform/gtk/RenderThemeGtk.cpp:
546         (WebCore::paintMozWidget): pass the clipping rectangle to
547         moz_gtk_widget_paint() instead of just the widget rectangle.
548
549 2008-03-20  David Hyatt  <hyatt@apple.com>
550
551         Fix for http://bugs.webkit.org/show_bug.cgi?id=9279
552
553         Make :hover work with the adjacent sibling selector.  This fix makes all forms of dynamic changes
554         (class name changes, :hover, :focus, etc.) work properly when used with the + selector.
555
556         Reviewed by weinig
557
558         Added fast/css/dynamic-sibling-selector.html
559
560         * dom/Element.cpp:
561         (WebCore::Element::recalcStyle):
562
563 2008-03-20  Aaron Golden  <aegolden@gmail.com>
564
565         Reviewed by Darin and David Kilzer.
566
567         Addresses <http://bugs.webkit.org/show_bug.cgi?id=15263>, which caused certain marquees to not display.
568
569         Test: fast/html/marquee-scroll.html
570
571         * html/HTMLMarqueeElement.cpp:
572         (WebCore::HTMLMarqueeElement::parseMappedAttribute):
573
574 2008-03-20  Adam Roben  <aroben@apple.com>
575
576         Export InspectorController::drawNodeHighlight
577
578         Reviewed by Tim Hatcher.
579
580         * WebCore.base.exp: Also sorted this file.
581
582 2008-03-19  Stephanie Lewis  <slewis@apple.com>
583
584         Rubber-stamped by Anders.
585
586         Fix Windows Build
587
588         * platform/cf/SharedBufferCF.cpp:
589         (WebCore::SharedBuffer::createCFData):
590
591 2008-03-19  Stephanie Lewis <slewis@apple.com>
592
593         Rubber-stamped by Anders.
594
595         Fix Windows Build
596
597         * platform/SharedBuffer.h:
598
599 2008-03-19  Justin Garcia  <justin.garcia@apple.com>
600
601         Reviewed by Oliver.
602         
603         <rdar://problem/5780697> Copying content with CSS property values that are percentages can cause fidelity issues
604          
605         Elements with height: x%; overflow: visible; overlap what's below them when they are copied from
606         a document in quirksmode and pasted into to one in standards mode.  This fix uses the computed 
607         the value for a property if its value is a percentage.
608         
609         * css/CSSMutableStyleDeclaration.cpp:
610         (WebCore::CSSMutableStyleDeclaration::addParsedProperty): Added so that we don't have to use
611         setProperty from appendStartMarkup.  We already have a parsed property value, so we shouldn't
612         use setProperty, since it takes in a String.  If we did, we would have to call CSSValue::cssText()
613         for a String only to re-parse it in setProperty.  This wasn't extremely important now, but it will 
614         be as we compute more properties to fix the rest of the copy/paste fidelity bugs.
615         * css/CSSMutableStyleDeclaration.h:
616         * editing/markup.cpp:
617         (WebCore::appendStartMarkup): Compute values for properties that have percentage values.  We could
618         perhaps narrow this special case to only include properties that are effected by quirksmode.
619
620 2008-03-19  Sam Weinig  <sam@webkit.org>
621
622         Reviewed by Anders Carlsson.
623
624         Fix for <rdar://problem/5785694>
625         Crash occurs at KJS::Collector::collect() when loading web clip widgets with a PAC file
626
627         Make the activeExecStates stack per JSGlobalObject instead of static to ensure
628         thread safety.
629
630         * bindings/objc/WebScriptObject.mm:
631         (+[WebScriptObject throwException:]): Change to throw an exception on the current
632         GlobalObject instead of the top of the static activeExecStates stack.
633         (-[WebScriptObject setException:]): Change to use the top of the rootObjects GlobalObject
634         instead of the top of the static activeExecStates stack.
635
636         * bridge/c/c_instance.cpp:
637         * bridge/c/c_instance.h:
638         * bridge/jni/jni_instance.cpp:
639         (JavaInstance::virtualBegin):
640         (JavaInstance::virtualEnd):
641         * bridge/jni/jni_instance.h:
642         * bridge/objc/objc_instance.h:
643         * bridge/objc/objc_instance.mm:
644         (ObjcInstance::~ObjcInstance):
645         (ObjcInstance::virtualBegin):
646         (ObjcInstance::virtualEnd):
647         * bridge/runtime.cpp:
648         (KJS::Bindings::Instance::setDidExecuteFunction):
649         (KJS::Bindings::Instance::didExecuteFunction):
650         (KJS::Bindings::Instance::setCurrentGlobalObject): Added.
651         (KJS::Bindings::Instance::currentGlobalObject): Added.
652         (KJS::Bindings::Instance::begin):
653         (KJS::Bindings::Instance::end):
654         * bridge/runtime.h:
655         (KJS::Bindings::Instance::virtualBegin): Renamed from begin().
656         (KJS::Bindings::Instance::virtualEnd): Renamed from end().
657         We now store the currently active globalObject everytime we cross the runtime
658         object boundary.  To do this, we take advantage of the existing begin/end
659         methods that are called when crossing this boundary, making begin set the current
660         globalObject and then call the old begin, now called virtualBegin.
661
662 2008-03-19  Brady Eidson  <beidson@apple.com>
663
664         Reviewed by Anders
665
666         Change SharedBuffer so the wrapping platform data aspect can be shared with all CoreFoundation platforms
667         (Mac and Windows instead of just Mac)
668
669         * WebCore.vcproj/WebCore.vcproj: Add SharedBufferCF.cpp
670         * WebCore.xcodeproj/project.pbxproj: Ditto
671
672         * platform/SharedBuffer.cpp:
673         * platform/SharedBuffer.h: Change the private c'tor from NSData to CFDataRef, other PLATFORM tweaks
674
675         * platform/cf/SharedBufferCF.cpp: Added.
676         (WebCore::SharedBuffer::SharedBuffer):
677         (WebCore::SharedBuffer::createCFData): Non-Mac version of createCFData
678         (WebCore::SharedBuffer::hasPlatformData):
679         (WebCore::SharedBuffer::platformData):
680         (WebCore::SharedBuffer::platformDataSize):
681         (WebCore::SharedBuffer::maybeTransferPlatformData):
682         (WebCore::SharedBuffer::clearPlatformData):
683
684         * platform/mac/SharedBufferMac.mm:
685         (WebCore::SharedBuffer::wrapNSData): Use the CFDataRef constructor via toll-free bridging
686         (WebCore::SharedBuffer::createCFData): Mac-specific version of createCFData
687
688 2008-03-19  Oliver Hunt  <oliver@apple.com>
689
690         Reviewed by Antti.
691
692         Bug 17954: Canvas arc() with radius of 0 throws exception
693         http://bugs.webkit.org/show_bug.cgi?id=17954
694
695         Simple fix -- use >= instead of > when validating the radius.
696
697         * html/CanvasRenderingContext2D.cpp:
698         (WebCore::CanvasRenderingContext2D::arc):
699
700 2008-03-19  Justin Garcia  <justin.garcia@apple.com>
701
702         Reviewed by Oliver.
703
704         <rdar://problem/5794920> Acid3: Assertion failure in VisiblePosition::previous when clicking on results (17004)
705         
706         The position inside an empty inline-block was a candidate, but upstream and downstream
707         would move across it without stopping.  This confused canonicalPosition, since no more
708         than two candidates should have the same upstream/downstream (be visually equivalent).
709         
710         Code was added intentionally in isCandidate to make VisiblePositions inside empty 
711         inline-blocks, so we need to make upstream/downstream understand that.
712
713         * dom/Position.cpp:
714         (WebCore::endsOfNodeAreVisuallyDistinctPositions): upstream and downstream used to only
715         stop when entering or leaving a non-inline element (referred to as a "block").  We must also 
716         avoid entering or leaving an empty inline-block.  This will allow a VisiblePosition there, to 
717         match up with what the code in isCandidate intended.
718         (WebCore::enclosingVisualBoundary): Removed enclosingBlock and replaced it with this.
719         (WebCore::Position::upstream): Added better comments, called the new functions.
720         (WebCore::Position::downstream): Ditto.
721         * dom/Position.h:
722
723 2008-03-19  Dan Bernstein  <mitz@apple.com>
724
725         Rubber-stamped by John Sullivan.
726
727         - change CSS property and value keyword constants from all-caps with
728           underscores to intra-caps.
729
730         * css/makeprop.pl:
731         * css/makevalues.pl:
732         * All files using the constants
733
734 2008-03-19  Adam Roben  <aroben@apple.com>
735
736         Make clicking anywhere in a row in the DOM tree select that row's node
737
738         We now have mousedown and dblclick event listeners on the root of the
739         tree that forward the event to the node on the row the mouse is over.
740
741         Reviewed by Tim Hatcher.
742
743         * page/inspector/DocumentPanel.js:
744         (WebInspector.DocumentPanel): Added a dblclick and mousedown event
745         listeners to the root of the tree.
746         (WebInspector.DocumentPanel._treeElementFromEvent): Added. Finds the
747         tree element for the row underneath the mouse.
748         (WebInspector.DocumentPanel._ondblclick): Added. Sends the dblclick
749         event on to the tree element in the current row.
750         (WebInspector.DocumentPanel._onmousedown): Added. Selects the tree
751         element in the current row.
752         * page/inspector/treeoutline.js:
753         (TreeOutline.treeElementFromPoint): Added.
754         (TreeElement.treeElementSelected): Changed to call
755         TreeElement.isEventWithinDisclosureTriangle, and added an early return.
756         (TreeElement.treeElementToggled): Ditto.
757         (TreeElement.isEventWithinDisclosureTriangle): Added.
758         * page/inspector/utilities.js:
759         (Node.enclosingNodeOrSelfWithNodeNameInArray): Added.
760         (Node.enclosingNodeOrSelfWithNodeName): Now just calls
761         enclosingNodeOrSelfWithNodeNameInArray.
762         (Elemnt.get totalOffsetLeft): Added.
763         (Elemnt.get totalOffsetTop): Added.
764
765 2008-03-19  Dan Bernstein  <mitz@apple.com>
766
767         Reviewed by Sam Weinig.
768
769         - fix assertion failure in RenderBlock::determineStartPosition() at http://www.wired.com/techbiz/it/magazine/16-04/bz_apple
770
771         Test: fast/repaint/line-flow-with-floats-10.html
772
773         * rendering/bidi.cpp:
774         (WebCore::RenderBlock::determineStartPosition): Removed bogus assertion.
775         If the float's top margin has changed and it has not been repositioned
776         yet, we do not have its new y position.
777
778 2008-03-19  David Hyatt  <hyatt@apple.com>
779
780         New implementation of full page zoom.  Because of how much doesn't transform when zooming, and because
781         of the need to obey viewport constraints, I decided to take a completely different approach.  Now CSS
782         lengths and intrinsic sizes are simply adjusted by the zoom factor.  This approach works much better and
783         avoids pixel cracks more than the old approach.   In addition widgets "just work", namely plugins zoom
784         and scrollbars do not.
785
786         This patch also implements the IE zoom CSS property.  This property allows fine-grained control over
787         zooming at the element level.  It takes values of normal | <number> | <percentage> to match WinIE.  In
788         addition, in the vein of text-size-adjust for text zooming, I have extended the zoom property with an
789         extra value, reset.  The reset keyword can be used to prevent a section of the page from scaling at all
790         when a zoom is applied.
791
792         Reviewed by olliej
793
794         * css/CSSComputedStyleDeclaration.cpp:
795         (WebCore::):
796         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
797         Support the new 'zoom' property for getComputedStyle.
798
799         * css/CSSParser.cpp:
800         (WebCore::CSSParser::parseValue):
801         Code that parses the 'zoom' property.
802
803         * css/CSSPrimitiveValue.cpp:
804         (WebCore::CSSPrimitiveValue::computeLengthInt):
805         (WebCore::CSSPrimitiveValue::computeLengthIntForLength):
806         (WebCore::CSSPrimitiveValue::computeLengthShort):
807         (WebCore::CSSPrimitiveValue::computeLengthFloat):
808         (WebCore::CSSPrimitiveValue::computeLengthDouble):
809         * css/CSSPrimitiveValue.h:
810         Extend all of the computeLength methods to take a multiplier so that lengths can be adjusted by the
811         zoom factor.
812
813         * css/CSSPropertyNames.in:
814         Add the new zoom property to the list of properties we understand.
815
816         * css/CSSStyleSelector.cpp:
817         (WebCore::CSSStyleSelector::applyDeclarations):
818         (WebCore::CSSStyleSelector::applyProperty):
819         (WebCore::CSSStyleSelector::mapBackgroundSize):
820         (WebCore::CSSStyleSelector::mapBackgroundXPosition):
821         (WebCore::CSSStyleSelector::mapBackgroundYPosition):
822         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
823         * css/CSSStyleSelector.h:
824         (WebCore::CSSStyleSelector::setStyle):
825         Pass in the zoom factor when computing all lengths in CSS.
826
827         * css/CSSValueKeywords.in:
828         Add support for the 'reset' keyword of the zoom property.
829
830         * dom/Document.cpp:
831         (WebCore::Document::recalcStyle):
832         Set the 'zoom' CSS property on the RenderView.  This is how we implement full page zoom.
833
834         * html/CanvasRenderingContext2D.cpp:
835         (WebCore::size):
836         Make sure the back end canvas size ignores zooming when rendering images.
837
838         * html/HTMLImageElement.cpp:
839         (WebCore::HTMLImageElement::width):
840         (WebCore::HTMLImageElement::height):
841         (WebCore::HTMLImageElement::naturalWidth):
842         (WebCore::HTMLImageElement::naturalHeight):
843         Use the unzoomed width/height if we have no style information in HTMLImageElement.cpp.
844
845         * loader/CachedImage.cpp:
846         (WebCore::CachedImage::ref):
847         (WebCore::CachedImage::imageSize):
848         (WebCore::CachedImage::imageRect):
849         * loader/CachedImage.h:
850         (WebCore::CachedImage::canRender):
851         Force access to the CachedImage metrics to take a multiplier so that people have to think about
852         the zoom factor.  The "intrinsic size" of the image then takes that into account.
853
854         * loader/ImageDocument.cpp:
855         (WebCore::ImageTokenizer::finish):
856         (WebCore::ImageDocument::scale):
857         (WebCore::ImageDocument::resizeImageToFit):
858         (WebCore::ImageDocument::imageChanged):
859         (WebCore::ImageDocument::restoreImageSize):
860         (WebCore::ImageDocument::imageFitsInWindow):
861         Make sure image documents respect the zoom.
862
863         * page/AnimationController.cpp:
864         (WebCore::ImplicitAnimation::animate):
865         Make the 'zoom' CSS property work with CSS transitions.
866
867         * page/Frame.h:
868         (WebCore::Frame::pageZoomFactor):
869         (WebCore::Frame::textZoomFactor):
870         Add accessors for obtaining the pageZoom vs. textZoom.
871
872         * page/FrameView.cpp:
873         (WebCore::FrameView::adjustViewSize):
874         Remove the old zoom implementation that used transforms.
875
876         * page/mac/WebCoreAXObject.mm:
877         (-[WebCoreAXObject accessibilityIsIgnored]):
878         Pass in the zoom factor.
879
880         * rendering/InlineFlowBox.cpp:
881         (WebCore::InlineFlowBox::paintBackground):
882         (WebCore::InlineFlowBox::paintBoxDecorations):
883         Pass in the zoom factor when testing for size.
884
885         * rendering/RenderBox.cpp:
886         (WebCore::RenderBox::calculateBackgroundSize):
887         (WebCore::RenderBox::imageChanged):
888         (WebCore::RenderBox::paintBackgroundExtended):
889         (WebCore::RenderBox::calcHeight):
890         * rendering/RenderFrameSet.cpp:
891         (WebCore::RenderFrameSet::layout):
892         * rendering/RenderHTMLCanvas.cpp:
893         (WebCore::RenderHTMLCanvas::canvasSizeChanged):
894         * rendering/RenderHTMLCanvas.h:
895         (WebCore::RenderHTMLCanvas::renderName):
896         (WebCore::RenderHTMLCanvas::intrinsicSizeChanged):
897         * rendering/RenderImage.cpp:
898         (WebCore::RenderImage::setImageSizeForAltText):
899         (WebCore::RenderImage::imageChanged):
900         (WebCore::RenderImage::calcReplacedWidth):
901         (WebCore::RenderImage::calcReplacedHeight):
902         * rendering/RenderImage.h:
903         (WebCore::RenderImage::intrinsicSizeChanged):
904         * rendering/RenderListMarker.cpp:
905         (WebCore::RenderListMarker::layout):
906         (WebCore::RenderListMarker::imageChanged):
907         (WebCore::RenderListMarker::getRelativeMarkerRect):
908         * rendering/RenderObject.cpp:
909         (WebCore::RenderObject::mustRepaintBackgroundOrBorder):
910         (WebCore::RenderObject::paintBorder):
911         Pass in the zoom factor when testing for size.
912
913         * rendering/RenderReplaced.cpp:
914         (WebCore::RenderReplaced::RenderReplaced):
915         (WebCore::RenderReplaced::setStyle):
916         (WebCore::RenderReplaced::intrinsicSizeChanged):
917         * rendering/RenderReplaced.h:
918         Added a new call when the zoom factor changes, intrinsicSizeChanged().  Replaced element subclasses
919         respond to this via overrides.
920
921         * rendering/RenderStyle.cpp:
922         (WebCore::StyleVisualData::StyleVisualData):
923         (WebCore::StyleInheritedData::StyleInheritedData):
924         (WebCore::StyleInheritedData::operator==):
925         (WebCore::RenderStyle::diff):
926         * rendering/RenderStyle.h:
927         (WebCore::StyleVisualData::operator==):
928         (WebCore::RenderStyle::zoom):
929         (WebCore::RenderStyle::zoomInEffect):
930         (WebCore::RenderStyle::setZoom):
931         (WebCore::RenderStyle::setZoomInEffect):
932         (WebCore::RenderStyle::initialZoom):
933         Support for 'zoom' in the RenderStyle.  "zoomInEffect" represents the computed zoom taking into account
934         all the zooms specified on ancestors.
935
936         * rendering/RenderTableCol.cpp:
937         (WebCore::RenderTableCol::imageChanged):
938         * rendering/RenderTableRow.cpp:
939         (WebCore::RenderTableRow::imageChanged):
940         * rendering/RenderTableSection.cpp:
941         (WebCore::RenderTableSection::imageChanged):
942         * rendering/RenderVideo.h:
943         (WebCore::RenderVideo::intrinsicSizeChanged):
944         Pass in the zoom factor.
945
946         * rendering/RenderView.cpp:
947         (WebCore::RenderView::calcHeight):
948         (WebCore::RenderView::calcWidth):
949         (WebCore::RenderView::layout):
950         (WebCore::RenderView::viewHeight):
951         (WebCore::RenderView::viewWidth):
952         * rendering/RenderView.h:
953         (WebCore::RenderView::zoomFactor):
954         Back out the old implementation.
955
956 2008-03-19  Adam Roben  <aroben@apple.com>
957
958         Rename firstParent* methods to enclosingNode*
959
960         Rubberstamped by John Sullivan.
961
962         * page/inspector/ConsolePanel.js:
963         * page/inspector/DocumentPanel.js:
964         * page/inspector/NetworkPanel.js:
965         * page/inspector/inspector.js:
966         * page/inspector/utilities.js:
967
968 2008-03-19  Dan Bernstein  <mitz@apple.com>
969
970         Reviewed by John Sullivan.
971
972         - fix <rdar://problem/5805070> CrashTracer: [USER] 33 crashes in Safari at com.apple.WebCore: WebCore::FrameView::layout + 431
973
974         Test: fast/dynamic/subtree-parent-static-y.html
975
976         * rendering/RenderObject.cpp:
977         (WebCore::RenderObject::markContainingBlocksForLayout): Avoid calling
978         this method on the parent if the parent is the new layout subtree root,
979         which would result in marking all the way to the top, when it should
980         actually do nothing.
981
982 2008-03-19  Mark Rowe  <mrowe@apple.com>
983
984         Reviewed by Oliver Hunt.
985
986         Use WTF::Unicode abstraction rather than using ICU functions directly.
987
988         * html/PreloadScanner.cpp:
989         (WebCore::PreloadScanner::tokenize):
990
991 2008-03-19  Mark Rowe  <mrowe@apple.com>
992
993         Attempt to fix the Gtk build.
994
995         * platform/network/curl/ResourceHandleCurl.cpp:
996         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate):
997
998 2008-03-18  Darin Adler  <darin@apple.com>
999
1000         Reviewed by Maciej.
1001
1002         - Speed up JavaScript built-in properties by changing the
1003           hash table to take advantage of the identifier objects
1004
1005         5% speedup for Acid3 test 26
1006
1007         * bindings/js/JSDOMWindowBase.cpp:
1008         (WebCore::JSDOMWindowBase::getOwnPropertySlot): Update for change to HashTable.
1009         (WebCore::JSDOMWindowBase::put): Ditto.
1010         * bindings/js/JSDOMWindowCustom.cpp:
1011         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Ditto.
1012         * bindings/js/JSHTMLInputElementBase.cpp:
1013         (WebCore::JSHTMLInputElementBase::getOwnPropertySlot): Ditto.
1014         * bindings/js/JSHistoryCustom.cpp:
1015         (WebCore::JSHistory::customGetOwnPropertySlot): Ditto.
1016         * bindings/js/JSLocation.cpp:
1017         (WebCore::JSLocation::customGetOwnPropertySlot): Ditto.
1018         (WebCore::JSLocation::put): Ditto.
1019         * bindings/js/kjs_binding.cpp:
1020         (WebCore::nonCachingStaticFunctionGetter): Ditto.
1021
1022         * bindings/scripts/CodeGeneratorJS.pm: Same changes as in the
1023         create_hash_table script.
1024
1025 2008-03-18  Matt Lilek  <webkit@mattlilek.com>
1026
1027         Fix the Gtk build for real this time.
1028
1029         * platform/network/curl/AuthenticationChallenge.h:
1030
1031 2008-03-18  Sam Weinig  <sam@webkit.org>
1032
1033         Reviewed by Anders Carlsson.
1034
1035         Fix for http://bugs.webkit.org/show_bug.cgi?id=17057
1036         REGRESSION: Frequent random crashes in WebCore::JSNodeList::indexGetter
1037         <rdar://problem/5725058>
1038
1039         Tests: fast/dom/NodeList/5725058-crash-scenario-1.html
1040                fast/dom/NodeList/5725058-crash-scenario-2.html
1041                fast/dom/NodeList/5725058-crash-scenario-3.html
1042
1043         * dom/ChildNodeList.cpp: 
1044         (WebCore::ChildNodeList::ChildNodeList):
1045         * dom/ChildNodeList.h:
1046         Remove rootNodeChildrenChanged() method and fix the constructor to not 
1047         pass in a needsNotifications argument to DynamicNodeList, as it no longer
1048         takes one.
1049
1050         * dom/ClassNodeList.cpp:
1051         (WebCore::ClassNodeList::ClassNodeList):
1052         Don't pass the needsNotifications argument to DynamicNodeList.
1053
1054         * dom/ContainerNode.cpp:
1055         (WebCore::ContainerNode::childrenChanged):
1056         Rename call to hasNodeLists() to hasNodeListCaches().
1057
1058         * dom/Document.cpp:
1059         (WebCore::Document::Document):
1060         (WebCore::Document::~Document): Zero out the m_document variable to signify
1061         to destructors down the destruction chain that this is a Document type node
1062         being destructed, and thus, accessing document() is prohibited.
1063         * dom/Document.h:
1064         (WebCore::Document::addNodeListCache): Renamed from addNodeList.
1065         (WebCore::Document::removeNodeListCache): Renamed from removeNodeList, adds assertion.
1066         (WebCore::Document::hasNodeListCaches): Renamed from hasNodeListCaches.
1067         Rename m_numNodeLists to m_numNodeListCaches.
1068
1069         * dom/DynamicNodeList.cpp:
1070         (WebCore::DynamicNodeList::DynamicNodeList):
1071         (WebCore::DynamicNodeList::~DynamicNodeList):
1072         (WebCore::DynamicNodeList::invalidateCache):
1073         (WebCore::DynamicNodeList::Caches::Caches):
1074         * dom/DynamicNodeList.h:
1075         (WebCore::DynamicNodeList::hasOwnCaches):
1076         Remove the needsNotifications concept from DynamicNodeList, instead, manually
1077         invalidate the cache for lists that own their own cache.
1078
1079         * dom/NameNodeList.cpp:
1080         (WebCore::NameNodeList::NameNodeList):
1081         * dom/NameNodeList.h:
1082         Remove rootNodeAttributeChanged() method and fix the constructor to not 
1083         pass in a needsNotifications argument to DynamicNodeList, as it no longer
1084         takes one.
1085
1086         * dom/Node.cpp:
1087         (WebCore::Node::~Node): Decrement the document's nodeListCache count
1088         if we had a NodeListsNodeData cache and this is not the Document being
1089         destructor, as tagged by a null m_document.
1090         (WebCore::Node::childNodes): Increment the document's nodeListCache count 
1091         if we need create the NodeListsNodeData.
1092         (WebCore::Node::registerDynamicNodeList): Increment the document's nodeListCache count 
1093         if we need create the NodeListsNodeData.  Change to invalidate all the caches, instead 
1094         of just the ChildNodeList, if document has had no NodeListCaches.
1095         (WebCore::Node::unregisterDynamicNodeList): Change to remove the cache from the m_listsWithCaches
1096         set if it is owned by the NodeList and clear the m_nodeLists if it is empty.
1097         (WebCore::Node::notifyLocalNodeListsAttributeChanged): Move logic to 
1098         NodeListsNodeData::invalidateAttributeCaches and clear the cache pointer if it is empty.
1099         (WebCore::Node::notifyLocalNodeListsChildrenChanged): Move logic to 
1100         NodeListsNodeData::invalidateCaches and clear the cache pointer if it is empty.
1101         (WebCore::Node::notifyNodeListsChildrenChanged): Cleanup.
1102         (WebCore::Node::getElementsByName): Increment the document's nodeListCache count 
1103         if we need create the NodeListsNodeData.
1104         (WebCore::Node::getElementsByClassName): Increment the document's nodeListCache count 
1105         if we need create the NodeListsNodeData.
1106
1107         (WebCore::NodeListsNodeData::invalidateCaches): Added.
1108         (WebCore::NodeListsNodeData::invalidateAttributeCaches): Added.
1109         (WebCore::NodeListsNodeData::isEmpty): Added.
1110
1111         * dom/TagNodeList.cpp:
1112         (WebCore::TagNodeList::TagNodeList):
1113         Don't pass the needsNotifications argument to DynamicNodeList.
1114
1115 2008-03-18  Matt Lilek  <webkit@mattlilek.com>
1116
1117         Not reviewed, build fix.
1118
1119         * platform/network/curl/AuthenticationChallenge.h:
1120
1121 2008-03-18  Brent Fulgham  <bfulgham@gmail.com>
1122
1123         Reviewed by Adam Roben.
1124
1125         Provide some stub implementations for things that WebKit
1126         uses for performing authentication/challenge activities.  This
1127         is in support of http://bugs.webkit.org/show_bug.cgi?id=17837
1128
1129         * platform/network/ResourceHandle.h:
1130         * platform/network/curl/AuthenticationChallenge.h:
1131         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
1132         (WebCore::AuthenticationChallenge::sourceHandle):
1133
1134 2008-03-18  Eric Seidel  <eric@webkit.org>
1135
1136         Reviewed by Oliver.
1137
1138         Fix SVGImage crash seen once, and obvious via code inspection.
1139         
1140         I was not able to find a test case for this.
1141
1142         * svg/graphics/SVGImage.cpp:
1143         (WebCore::SVGImage::setContainerSize):
1144         (WebCore::SVGImage::usesContainerSize):
1145         (WebCore::SVGImage::hasRelativeWidth):
1146         (WebCore::SVGImage::hasRelativeHeight):
1147
1148 2008-03-18  Rodney Dawes  <dobey@wayofthemonkey.com>
1149
1150         Fix Qt build after r31123.
1151
1152         Add PluginView methods to TemporaryLinkStubs.
1153
1154         * platform/qt/TemporaryLinkStubs.cpp:
1155
1156 2008-03-18  Sam Weinig  <sam@webkit.org>
1157
1158         Reviewed by Darin Adler.
1159
1160         - Speed up JavaScript prototype and constructor object creation
1161           using a static Identifier in the self() methods to avoid the
1162           cost of creating one from a c-string each time.
1163
1164         5% speedup for Acid3 test 26
1165
1166         * bindings/scripts/CodeGeneratorJS.pm:
1167
1168 2008-03-18  Antti Koivisto  <antti@apple.com>
1169
1170         Reviewed by Mark Rowe.
1171
1172         Enable preloading for other platforms besides Mac.
1173
1174         * GNUmakefile.am:
1175         * WebCore.pro:
1176         * WebCore.vcproj/WebCore.vcproj:
1177         * WebCoreSources.bkl:
1178         * html/HTMLTokenizer.cpp:
1179         * html/HTMLTokenizer.h:
1180         * html/PreloadScanner.cpp:
1181         (WebCore::PreloadScanner::tokenize):
1182
1183 2008-03-18  Dan Bernstein  <mitz@apple.com>
1184
1185         Reviewed by Adele Peterson.
1186
1187         - fix <rdar://problem/5805127> REGRESSION (r31116): Assertion failure (floatIndex < floats.size()) in RenderBlock::determineStartPosition() at digg.com
1188
1189         Test: fast/dynamic/floating-to-positioned.html
1190
1191         * rendering/RenderObject.cpp:
1192         (WebCore::RenderObject::setStyle): Added code to remove a float from
1193         object lists if its position property changes to something other than
1194         static, since then it ceases to be a float.
1195
1196 2008-03-18  Adam Roben  <aroben@apple.com>
1197
1198         Windows build fix after r31123
1199
1200         * plugins/win/PluginViewWin.cpp: Add back MozillaUserAgent.
1201
1202 2008-03-18  Dan Bernstein  <mitz@apple.com>
1203
1204         Reviewed by Darin Adler.
1205
1206         - eliminate RenderFlow::m_clear
1207
1208         * rendering/RenderBlock.cpp:
1209         (WebCore::RenderBlock::layoutBlock): Removed code to set m_clear.
1210         (WebCore::RenderBlock::newLine): Added a 'clear' parameter.
1211         * rendering/RenderBlock.h:
1212         * rendering/RenderFlow.h:
1213         (WebCore::RenderFlow::RenderFlow): Removed initialization of m_clear.
1214         * rendering/bidi.cpp:
1215         (WebCore::RenderBlock::layoutInlineChildren): Added a local 'clear'
1216         variable, passing a pointer to it to findNextLineBreak() and its value
1217         to newLine(). 
1218         (WebCore::RenderBlock::findNextLineBreak): Added a 'clear' parameter,
1219         which this method adjusts when it encounters a <br>.
1220
1221 2008-03-18  Simon Hausmann  <hausmann@webkit.org>
1222
1223         Reviewed by Holger.
1224
1225         Fix the Qt build and clean up the invoke mechanism for dispatching
1226         functions in the main thread by using QMetaObject::invokeMethod
1227         instead of posting a null event.
1228
1229         * platform/qt/MainThreadQt.cpp:
1230
1231 2008-03-18  Rodney Dawes  <dobey@wayofthemonkey.com>
1232
1233         Fix Mac build from commit of r31123.
1234
1235         Add a typedef for NSView* to PlatformWidget, remove duplicate PluginMessageThrottlerWin definition.
1236
1237         * platform/Widget.h:
1238         * WebCore.vcproj/WebCore.vcproj:
1239
1240 2008-03-18  Rodney Dawes  <dobey@wayofthemonkey.com>
1241
1242         Reviewed by Jon Honeycutt.
1243
1244         Add PluginView.cpp and npapi.cpp to build files.
1245         Copy win/PluginViewWin.cpp to PluginView.cpp for shared code.
1246         Split Windows specific code out of PluginView.cpp.
1247         Add #if USE(NPOBJECT) around dependant code.
1248         Use npruntime_internal.h instead of npapi.h.
1249         Add PlatformWidget typedef to Widget.h.
1250         Update WidgetGtk.cpp for the PlatformWidget usage.
1251         Add needed methods to TemporaryLinkStubs for GTK+ port.
1252
1253         * GNUmakefile.am:
1254         * WebCore.pro:
1255         * WebCoreSources.bkl:
1256         * WebCore.vcproj/WebCore.vcproj:
1257         * plugins/win/PluginViewWin.cpp:
1258         * plugins/PluginView.cpp:
1259         * plugins/PluginView.h:
1260         * plugins/npapi.cpp:
1261         * platform/Widget.h:
1262         * platform/gtk/WidgetGtk.cpp:
1263         * platform/gtk/TemporaryLinkStubs.cpp:
1264
1265 2008-03-17  Darin Adler  <darin@apple.com>
1266
1267         Reviewed by Maciej.
1268
1269         - speed up document property fetching (eliminate the AtomicString
1270           objects made during document property lookup)
1271
1272         3% speedup for Acid3 test 26
1273
1274         * bindings/js/JSDOMWindowBase.cpp:
1275         (WebCore::JSDOMWindowBase::getOwnPropertySlot): Use AtomicString::find to
1276         locate the AtomicString, only if already present. Also call the new faster
1277         versions of the hasNamedItem and hasElementWithId functions that don't
1278         ref/deref the AtomicStringImpl, get inlined, etc.
1279         * bindings/js/JSHTMLDocumentCustom.cpp:
1280         (WebCore::JSHTMLDocument::canGetItemsForName): Ditto.
1281         (WebCore::writeHelper): Use a Vector instead of a String to build up
1282         the string to avoid the bad performance of string append.
1283
1284         * dom/Document.cpp: Tweaked code and comments a bit. Nothing substantive.
1285         * dom/Document.h: Added new hasElementWithId function that's faster than
1286         getElementById because it doesn't ref/deref the AtomicStringImpl*, gets
1287         inlined, doesn't have to handle the 0 case, and doesn't try to return the
1288         element pointer (just a boolean).
1289
1290         * html/HTMLAppletElement.cpp:
1291         (WebCore::HTMLAppletElement::parseMappedAttribute): Use AtomicString
1292         consistently. Also renamed the data member for clarity.
1293         (WebCore::HTMLAppletElement::insertedIntoDocument): Ditto.
1294         (WebCore::HTMLAppletElement::removedFromDocument): Ditto.
1295         * html/HTMLAppletElement.h: Ditto.
1296
1297         * html/HTMLDocument.cpp:
1298         (WebCore::addItemToMap): Use AtomicString instead of String.
1299         (WebCore::removeItemFromMap): Ditto.
1300         (WebCore::HTMLDocument::addNamedItem): Updated for member name change.
1301         (WebCore::HTMLDocument::removeNamedItem): Ditto.
1302         (WebCore::HTMLDocument::addExtraNamedItem): Ditto.
1303         (WebCore::HTMLDocument::removeExtraNamedItem): Ditto.
1304         (WebCore::HTMLDocument::clear): Added. Moved code here from the JavaScript
1305         bindings. If we're going to have an empty placeholder function, there's no
1306         reason to have it in the bindings instead of here.
1307         * html/HTMLDocument.h: Added clear. Changed the named item function
1308         arguments to AtomicString insted of String. Changed the NameCountMap to
1309         use AtomicStringImpl* instead of StringImpl*. Renamed the data members
1310         to add a m_ prefix and remove the needless doc prefix. Added hasNamedItem
1311         and hasExtraNamedItem functions that are inlined and faster than the old
1312         idiom because they doesn't ref/deref the AtomicStringImpl*, get inlined,
1313         and don't have to handle the 0 case.
1314         * html/HTMLDocument.idl: Removed the [Custom] attribute on clear and took
1315         it out of the JavaScript-specific section.
1316
1317         * html/HTMLEmbedElement.cpp:
1318         (WebCore::HTMLEmbedElement::parseMappedAttribute): Use AtomicString
1319         consistently. Also renamed the data member for clarity.
1320         (WebCore::HTMLEmbedElement::insertedIntoDocument): Ditto.
1321         (WebCore::HTMLEmbedElement::removedFromDocument): Ditto.
1322         * html/HTMLFormElement.cpp:
1323         (WebCore::HTMLFormElement::insertedIntoDocument): Ditto.
1324         (WebCore::HTMLFormElement::removedFromDocument): Ditto.
1325         (WebCore::HTMLFormElement::parseMappedAttribute): Ditto.
1326         * html/HTMLFormElement.h: Ditto.
1327
1328         * html/HTMLFrameElementBase.cpp:
1329         (WebCore::HTMLFrameElementBase::openURL): Renamed m_name to m_frameName for
1330         clarity, since the frame name is not the same as the name attribute.
1331         (WebCore::HTMLFrameElementBase::parseMappedAttribute): Ditto.
1332         (WebCore::HTMLFrameElementBase::setNameAndOpenURL): Ditto.
1333         * html/HTMLFrameElementBase.h: Ditto.
1334
1335         * html/HTMLIFrameElement.cpp:
1336         (WebCore::HTMLIFrameElement::parseMappedAttribute): Use AtomicString
1337         consistently. Also renamed the data member for clarity.
1338         (WebCore::HTMLIFrameElement::insertedIntoDocument): Ditto.
1339         (WebCore::HTMLIFrameElement::removedFromDocument): Ditto.
1340         * html/HTMLIFrameElement.h: Ditto.
1341         * html/HTMLImageElement.cpp:
1342         (WebCore::HTMLImageElement::parseMappedAttribute): Ditto.
1343         (WebCore::HTMLImageElement::insertedIntoDocument): Ditto.
1344         (WebCore::HTMLImageElement::removedFromDocument): Ditto.
1345         * html/HTMLImageElement.h: Ditto.
1346         * html/HTMLObjectElement.cpp:
1347         (WebCore::HTMLObjectElement::parseMappedAttribute): Ditto.
1348         (WebCore::HTMLObjectElement::insertedIntoDocument): Ditto.
1349         (WebCore::HTMLObjectElement::removedFromDocument): Ditto.
1350         (WebCore::HTMLObjectElement::updateDocNamedItem): Ditto.
1351         * html/HTMLObjectElement.h: Ditto.
1352
1353         * html/HTMLParamElement.cpp:
1354         (WebCore::HTMLParamElement::isURLAttribute): Use equalIgnoringCase instead
1355         of callling lower().
1356
1357         * html/HTMLPlugInElement.h: Changed the type of m_name. The code that
1358         uses this is in HTMLAppletElement, HTMLEmbedElement, and HTMLObjectElement.
1359
1360         * platform/text/AtomicString.cpp:
1361         (WebCore::equal): Moved to an inline so we can share this code between a
1362         few different functions. It could move to a header too if we want to use
1363         it elsewhere.
1364         (WebCore::UCharBufferTranslator::equal): Change to use inline.
1365         (WebCore::HashAndCharactersTranslator::hash): Added.
1366         (WebCore::HashAndCharactersTranslator::equal): Added.
1367         (WebCore::HashAndCharactersTranslator::translate): Added.
1368         (WebCore::AtomicString::add): Improved the Identifier and UString overloads
1369         to use the already-computed hash code instead of rehashing the string.
1370         (WebCore::AtomicString::find): Added.
1371         * platform/text/AtomicString.h: Added a find function so we can avoid
1372         allocating memory just to look up a string in an atomic string set or map.
1373
1374         * platform/text/StringImpl.h: Added declarations needed for the
1375         AtomicString changes.
1376
1377 2008-03-17  Timothy Hatcher  <timothy@apple.com>
1378
1379         Reviewed by Mark Rowe.
1380
1381         Bug 17908: Various bugs in the Console completion code
1382         http://bugs.webkit.org/show_bug.cgi?id=17908
1383
1384         * page/inspector/ConsolePanel.js:
1385         (WebInspector.ConsolePanel.complete): Moved the code that checked for the caret being at the end
1386         of the prompt into the _caretAtEndOfPrompt helper function.
1387         (WebInspector.ConsolePanel.messagesSelectStart): Clear and redo the auto complete when the selection changes.
1388         (WebInspector.ConsolePanel._caretInsidePrompt): Fixed a logic error that always caused a false result.
1389         (WebInspector.ConsolePanel._caretAtEndOfPrompt): Added. Tests if the selection is a caret at the
1390         end of the prompt.
1391         (WebInspector.ConsolePanel._moveCaretToEndOfPrompt): Changed the offset to use the childNodes length.
1392         This makes sure the caret is at the end when there are multiple text nodes in the prompt.
1393
1394 2008-03-17  Dan Bernstein  <mitz@apple.com>
1395
1396         Rubber-stamped by Dave Hyatt.
1397
1398         - FloatingObject cleanup
1399
1400         Renamed FloatingObject's data members as follows: node -> m_renderer,
1401         startY -> m_top, endY -> m_bottom, left -> m_left, width -> m_width,
1402         and noPaint -> !m_shouldPaint, reversing the meaning of the flag.
1403
1404         Also addressed the FIXME in RenderBlock::containsFloat().
1405
1406         * rendering/RenderBlock.cpp:
1407         (WebCore::RenderBlock::repaintOverhangingFloats):
1408         (WebCore::RenderBlock::paintFloats):
1409         (WebCore::RenderBlock::insertFloatingObject):
1410         (WebCore::RenderBlock::removeFloatingObject):
1411         (WebCore::RenderBlock::positionNewFloats):
1412         (WebCore::RenderBlock::leftRelOffset):
1413         (WebCore::RenderBlock::rightRelOffset):
1414         (WebCore::RenderBlock::nextFloatBottomBelow):
1415         (WebCore::RenderBlock::floatBottom):
1416         (WebCore::RenderBlock::floatRect):
1417         (WebCore::RenderBlock::lowestPosition):
1418         (WebCore::RenderBlock::rightmostPosition):
1419         (WebCore::RenderBlock::leftmostPosition):
1420         (WebCore::RenderBlock::leftBottom):
1421         (WebCore::RenderBlock::rightBottom):
1422         (WebCore::RenderBlock::clearFloats):
1423         (WebCore::RenderBlock::addOverhangingFloats):
1424         (WebCore::RenderBlock::addIntrudingFloats):
1425         (WebCore::RenderBlock::containsFloat): Changed to return false if the
1426         floats lists exists but is empty, since line layout code no longer
1427         relies on the buggy behavior.
1428         (WebCore::RenderBlock::nodeAtPoint):
1429         (WebCore::RenderBlock::adjustForBorderFit):
1430         * rendering/RenderBlock.h:
1431         (WebCore::RenderBlock::containsFloats):
1432         (WebCore::RenderBlock::FloatingObject::FloatingObject):
1433         * rendering/bidi.cpp:
1434         (WebCore::RenderBlock::layoutInlineChildren):
1435         (WebCore::RenderBlock::matchedEndLine):
1436
1437 2008-03-17  Dan Bernstein  <mitz@apple.com>
1438
1439         Reviewed by Dave Hyatt.
1440
1441         - allow incremental relayout of blocks that contain floats
1442
1443         Tests: fast/repaint/line-flow-with-floats-[1-9].html
1444
1445         * rendering/RenderBlock.cpp:
1446         (WebCore::RenderBlock::clearFloatsIfNeeded): Cleaned up by moving most
1447         of the function body out of an if statement which was replaced with an
1448         early return.
1449         (WebCore::RenderBlock::insertFloatingObject): Cleaned up by moving most
1450         of the function body out of an if statement and moving the ASSERT, which
1451         is a crash in release builds, to the beginning. Made this function set
1452         the m_isDescendant flag of floating objects it creates.
1453         (WebCore::RenderBlock::removeFloatingObject): Added a call to
1454         markLinesDirtyInVerticalRange() when removing a float from a block with
1455         inline children.
1456         (WebCore::RenderBlock::markLinesDirtyInVerticalRange): Added. Marks the
1457         lines in the given range as dirty.
1458         (WebCore::RenderBlock::clearFloats): Added code to detect changes to
1459         the geometry of floats intruding into this block from other blocks and
1460         mark any lines whose available width has changed as a result as dirty.
1461
1462         * rendering/RenderBlock.h:
1463         (WebCore::RenderBlock::FloatWithRect::FloatWithRect): Added a structure
1464         to cache a float with its position and size.
1465         (WebCore::RenderBlock::FloatingObject::FloatingObject): Added an
1466         m_isDescendant flag, used by clearFloats() to distinguish between floats
1467         entering the block from outside and floats internal to the block.
1468
1469         * rendering/RootInlineBox.h:
1470         (WebCore::RootInlineBox::floats): Added.
1471         (WebCore::RootInlineBox::floatsPtr): Added.
1472         (WebCore::RootInlineBox::Overflow::Overflow): Added a data member to
1473         hold the floats originating on the line.
1474
1475         * rendering/bidi.cpp:
1476         (WebCore::RenderBlock::layoutInlineChildren): Made the existence of
1477         floats not force a full layout. Changed to cache the geometry of floats
1478         in the block and detect changes to it. If a float's size or position
1479         changes, all lines from that point on are treated as dirty. An exception
1480         is a change in the dimensions of a float on an otherwise-clean line,
1481         which only dirties lines potentially affected by the change (see
1482         determineStartPosition()). Added code to update each RootInlineBox's
1483         set of floats as lines are laid out. Added code to shift floats
1484         belonging to clean lines in the end along with the lines.
1485         (WebCore::RenderBlock::determineStartPosition): Made this function look
1486         for changes to floats' dimensions and mark lines as dirty accordingly.
1487         Also look for new floats and if found, cause a full layout. Added code
1488         to re-add floats belonging to clean lines.
1489         (WebCore::RenderBlock::matchedEndLine): Added checking that the clean
1490         lines in the end can be shifted vertically as needed, i.e. that the
1491         available width along the way is uniform.
1492
1493 2008-03-17  Eric Seidel  <eric@webkit.org>
1494
1495         Reviewed by darin.
1496
1497         Fix _NPN_IntFromIdentifier (and export the symbol for use!)
1498
1499         Test: plugins/netscape-identifier-conversion.html
1500
1501         * WebCore.NPAPI.exp:
1502         * bridge/npruntime.cpp:
1503         (_NPN_IntFromIdentifier):
1504
1505 2008-03-17  Sam Weinig  <sam@webkit.org>
1506
1507         Reviewed by Dan Bernstein.
1508
1509         Add HTMLCollection constructor to the Window object. (Omission noticed by Harri Porten)
1510
1511         * page/DOMWindow.idl: 
1512
1513 2008-03-17  Holger Hans Peter Freyther  <zecke@selfish.org>
1514
1515         Unreviewed Gtk+ build fix.
1516
1517         * platform/gtk/ScrollViewGtk.cpp: remove const
1518
1519 2008-03-17  Julien Chaffraix  <julien.chaffraix@gmail.com>
1520
1521         Reviewed by Holger.
1522
1523         <http://bugs.webkit.org/show_bug.cgi?id=17754>
1524
1525         - Implement ResourceHandle::loadResourceSynchronously to dispatch synchronous
1526           requests.
1527
1528         - Implement WebCoreSynchronousLoader, the ResourceHandleClient which holds
1529           the network data, response and error for us during the transfert.
1530
1531         * platform/network/ResourceHandleInternal.h: Remove trailing white space.
1532         * platform/network/curl/ResourceHandleCurl.cpp: Add WebCoreSynchronousLoader
1533         (WebCore::WebCoreSynchronousLoader::resourceResponse):
1534         (WebCore::WebCoreSynchronousLoader::resourceError):
1535         (WebCore::WebCoreSynchronousLoader::data):
1536         (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader):
1537         (WebCore::WebCoreSynchronousLoader::didReceiveResponse):
1538         (WebCore::WebCoreSynchronousLoader::didReceiveData):
1539         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
1540         (WebCore::WebCoreSynchronousLoader::didFail):
1541         (WebCore::ResourceHandle::loadResourceSynchronously): Implement method
1542         using WebCoreSynchronousLoader.
1543
1544         * platform/network/curl/ResourceHandleManager.cpp:
1545         (WebCore::ResourceHandleManager::dispatchSynchronousJob):
1546         (WebCore::ResourceHandleManager::startJob):
1547         (WebCore::ResourceHandleManager::initializeHandle): Handle initialization
1548         method used both for synchronous and asynchronous job.
1549
1550         * platform/network/curl/ResourceHandleManager.h:
1551
1552 2008-03-17  Darin Adler  <darin@apple.com>
1553
1554         - try to fix GTK build
1555
1556         * platform/ScrollView.h: Make setGtkAdjustments adjustment.
1557         And non-virtual (why was it virtual?).
1558
1559 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
1560
1561         Fix Bug 17898: Split PluginMessageThrottlerWin into its own files
1562
1563         <http://bugs.webkit.org/show_bug.cgi?id=17898>
1564
1565         Move the PluginMessageThrottlerWin class into its own files, in
1566         preparation for refactoring PluginView code to be shared.
1567
1568         Reviewed and tweaked by Adam Roben.
1569
1570         * WebCore.vcproj/WebCore.vcproj:
1571         * plugins/PluginView.h:
1572         * plugins/win/PluginMessageThrottlerWin.cpp: Added.
1573         * plugins/win/PluginMessageThrottlerWin.h: Added.
1574         * plugins/win/PluginViewWin.cpp:
1575
1576 2008-03-17  Adam Roben  <aroben@apple.com>
1577
1578         More Windows build fixes after r31098
1579
1580         * platform/ScrollView.h: Make some more methods public.
1581
1582 2008-03-17  Adam Roben  <aroben@apple.com>
1583
1584         Windows and Qt build fixes after r31098
1585
1586         * platform/ScrollView.h: Mark methods public that still need to be so.
1587
1588 2008-03-16  Timothy Hatcher  <timothy@apple.com>
1589
1590         Reviewed by Darin Adler.
1591
1592         Bug 17883: Console completion should support bracket notation
1593         http://bugs.webkit.org/show_bug.cgi?id=17883
1594
1595         Also fixes a bug where the Inspector's window object was used instead of the
1596         inspected window object.
1597
1598         * page/inspector/ConsolePanel.js:
1599         (WebInspector.ConsolePanel.complete): Add a comment about the _backwardsRange call.
1600         (WebInspector.ConsolePanel.completions): Add a comment about the _backwardsRange call.
1601         Check the last character of the expression for a dot or bracket. Fallback
1602         to the InspectorController.inspectedWindow() instead of window, this was a bad bug.
1603         If the expression caused an exception, just consider the prefix a window property.
1604         When bracket notation is used remember what quote was used and compared property names
1605         with that quote surrounding it. Also escape the property name for the quote and backslash.
1606
1607 2008-03-17  Robert Blaut  <webkit@blaut.biz>
1608
1609         Reviewed by Darin.
1610
1611         Fix for bug http://bugs.webkit.org/show_bug.cgi?id=17696
1612         Set default margin-bottom for form element in quirk mode
1613         and be compatible with Gecko.
1614
1615         Tests: fast/css/margin-bottom-form-element-quirk.html
1616                fast/css/margin-bottom-form-element-strict.html
1617
1618         * css/html4.css:
1619         * css/quirks.css:
1620
1621 2008-03-17  Antti Koivisto  <antti@apple.com>
1622
1623         Reviewed by Darin.
1624
1625         Speculative fix for http://bugs.webkit.org/show_bug.cgi?id=17878
1626         Bug 17878: REGRESSION: Acid3 sometimes crashes Webkit under WebCore::Loader::Host::cancelRequests
1627         
1628         I can't reproduce the crash or make a test case for this one but I'm pretty sure this
1629         is the problem. Essentially the same bug as http://bugs.webkit.org/show_bug.cgi?id=17862
1630         except in didFail() instead of didFinishLoading().
1631
1632         * loader/loader.cpp:
1633         (WebCore::Loader::Host::didFail):
1634
1635 2008-03-17  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
1636
1637         Reviewed and tweaked by Darin.
1638
1639         http://bugs.webkit.org/show_bug.cgi?id=17172
1640         Refactor platform checks in ScrollView.h
1641
1642         * platform/ScrollView.h: Change #ifs around.
1643
1644 2008-03-17  Yuzhu Shen  <yuzhu.shen@gmail.com>
1645
1646         Reviewed by Darin.
1647
1648         Fix the bug: http://bugs.webkit.org/show_bug.cgi?id=17760
1649         It is necessary to load the image even when src="".
1650
1651         Test: fast/images/load-img-with-empty-src.html
1652
1653         * html/HTMLImageLoader.cpp:
1654         (WebCore::HTMLImageLoader::updateFromElement): isNull rather than isEmpty.
1655
1656 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
1657
1658         Fix GTK+ build from r31094.
1659
1660         * plugins/gtk/PluginDatabaseGtk.cpp:
1661         (PluginDatabase::getPluginsInPaths):
1662
1663 2008-03-17  Adam Roben  <aroben@apple.com>
1664
1665         Fix Bug 17876: REGRESSION (r31060): Attempting to visit Ofcom page causes crash
1666
1667         <http://bugs.webkit.org/show_bug.cgi?id=17876>
1668
1669         Reviewed by John.
1670
1671         Test: fast/dom/remove-named-attribute-crash.html
1672
1673         * dom/NamedAttrMap.cpp:
1674         (WebCore::NamedAttrMap::removeAttribute): Store the Attribute we're
1675         going to remove from the m_attributes Vector in a RefPtr so it doesn't
1676         get deleted when it is removed from the Vector.
1677
1678 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
1679
1680         Reviewed by Adam Roben.
1681
1682         Implement PluginDatabase for GTK+ with PluginDatabaseGtk.cpp.
1683         Remove implemented methods from TemporaryLinkStubs.
1684
1685         * GNUmakefile.am:
1686         * plugins/gtk:
1687         * plugins/gtk/PluginDatabaseGtk.cpp:
1688         * platform/gtk/TemporaryLinkStubs.cpp:
1689
1690 2008-03-17  Simon Hausmann  <hausmann@webkit.org>
1691
1692         Fix the Qt build.
1693
1694         * platform/text/qt/TextCodecQt.cpp:
1695         (WebCore::TextCodecQt::encode):
1696         * platform/text/qt/TextCodecQt.h:
1697
1698 2008-03-16  Maciej Stachowiak  <mjs@apple.com>
1699
1700         Not reviewed, just fixing an incomplete comment from the last commit.
1701
1702         * dom/Range.cpp:
1703         (WebCore::Range::surroundContents):
1704
1705 2008-03-16  Maciej Stachowiak  <mjs@apple.com>
1706
1707         Reviewed by Darin.
1708
1709         - fixed "Acid3 expects different exceptions for surroundContents calls involving comment nodes (affects Acid3 test 11)"
1710         http://bugs.webkit.org/show_bug.cgi?id=17509
1711         
1712         This gets us to 92/100
1713
1714         * dom/Range.cpp:
1715         (WebCore::Range::surroundContents): Check for
1716         HIERARCHY_REQUEST_ERR before BAD_BOUNDARYPOINTS_ERR, since Acid3
1717         expects exceptional conditions to be tested in the order that the
1718         spec lists them. Also, adjust the HIERARCHY_REQUEST_ERR check. If
1719         the start point of the range is in a comment node, the node that
1720         would be the parent of a partial replacement is actually the
1721         comment node's parent (since comment nodes have character
1722         indices), so we should do the HIERARCHY_REQUEST_ERR check based on
1723         the parent of the comment node, as for text nodes, even though it
1724         will fail later with a different exception because it is not
1725         allowed to surround a partially selected non-text node.
1726
1727 2008-03-16  Marvin Decker  <marv.decker@gmail.com>
1728
1729         Reviewed by Darin.
1730
1731         Fix bug 15119: URL query characters that are unencodable in the
1732         request's character set should be converted to XML entities with
1733         non-alphanumeric characters escaped.
1734
1735         Test: http/tests/uri/escaped-entity.html
1736
1737         * html/FormDataList.cpp:
1738         (WebCore::FormDataList::appendString):
1739         * html/HTMLFormElement.cpp:
1740         (WebCore::HTMLFormElement::formData):
1741         * platform/KURL.cpp:
1742         (WebCore::encodeRelativeString):
1743         * platform/text/String.cpp:
1744         (WebCore::String::latin1):
1745         (WebCore::String::utf8):
1746         * platform/text/TextCodec.cpp:
1747         (WebCore::TextCodec::unencodableCharReplacement):
1748         * platform/text/TextCodec.h:
1749         (WebCore::):
1750         * platform/text/TextCodecICU.cpp:
1751         (WebCore::urlEscapedEntityCallback):
1752         (WebCore::gbkUrlEscapedEntityCallack):
1753         (WebCore::TextCodecICU::encode):
1754         * platform/text/TextCodecICU.h:
1755         (WebCore::TextCodecICU::setNeedsGBKFallbacks):
1756         * platform/text/TextCodecLatin1.cpp:
1757         (WebCore::encodeComplexWindowsLatin1):
1758         (WebCore::TextCodecLatin1::encode):
1759         * platform/text/TextCodecLatin1.h:
1760         * platform/text/TextCodecUTF16.cpp:
1761         (WebCore::TextCodecUTF16::encode):
1762         * platform/text/TextCodecUTF16.h:
1763         * platform/text/TextCodecUserDefined.cpp:
1764         (WebCore::encodeComplexUserDefined):
1765         (WebCore::TextCodecUserDefined::encode):
1766         * platform/text/TextCodecUserDefined.h:
1767         * platform/text/TextEncoding.cpp:
1768         (WebCore::TextEncoding::encode):
1769         * platform/text/TextEncoding.h:
1770         * platform/text/mac/TextCodecMac.cpp:
1771         (WebCore::TextCodecMac::encode):
1772         * platform/text/mac/TextCodecMac.h:
1773         * xml/XMLHttpRequest.cpp:
1774         (WebCore::XMLHttpRequest::send):
1775
1776 2008-03-16  Kevin Ollivier  <kevino@theolliviers.com>
1777
1778         Rubber stamped by Darin.
1779
1780         Add set-webkit-configuration support for wx port, and centralize
1781         build dir location setting.
1782
1783         http://bugs.webkit.org/show_bug.cgi?id=17790
1784
1785         * webcore-base.bkl:
1786
1787 2008-03-16  Darin Adler  <darin@apple.com>
1788
1789         Reviewed by Mark Rowe.
1790
1791         - http://bugs.webkit.org/show_bug.cgi?id=17881
1792           a little cleanup for HTMLTextAreaElement
1793
1794         Tests: fast/forms/textarea-default-value-leading-newline.html
1795                fast/forms/textarea-linewrap-dynamic.html
1796
1797         * html/HTMLTextAreaElement.cpp:
1798         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Tweaked names/
1799         (WebCore::HTMLTextAreaElement::selectionStart): Ditto, also use early return
1800         and check for < 0 rather than -1 specifically.
1801         (WebCore::HTMLTextAreaElement::selectionEnd): Ditto.
1802         (WebCore::HTMLTextAreaElement::setSelectionStart): Early return.
1803         (WebCore::HTMLTextAreaElement::setSelectionEnd): Ditto.
1804         (WebCore::HTMLTextAreaElement::select): Ditto.
1805         (WebCore::HTMLTextAreaElement::setSelectionRange): Ditto.
1806         (WebCore::HTMLTextAreaElement::parseMappedAttribute): Changed value parsing
1807         to treat unknown values as meaning "default" rather than "leave value as-is".
1808         Only call setNeedsLayoutAndPrefWidthsRecalc when mode changed.
1809         (WebCore::HTMLTextAreaElement::createRenderer): Removed name of unused argument.
1810         (WebCore::HTMLTextAreaElement::appendFormData): Updated for name changes.
1811         (WebCore::HTMLTextAreaElement::isKeyboardFocusable): Got rid of unnneeded explicit
1812         class name in isFocusable call.
1813         (WebCore::HTMLTextAreaElement::isMouseFocusable): Ditto.
1814         (WebCore::HTMLTextAreaElement::updateFocusAppearance): Tweaked formatting.
1815         (WebCore::HTMLTextAreaElement::defaultEventHandler): Ditto.
1816         (WebCore::HTMLTextAreaElement::updateValue): Early return.
1817         (WebCore::HTMLTextAreaElement::setValue): Got rid of intermediate value to
1818         eliminate on small refcount churn.
1819         (WebCore::HTMLTextAreaElement::defaultValue): Got rid of unneeded redundant
1820         string length checks, since String already checks all indexing and returns 0.
1821         (WebCore::HTMLTextAreaElement::setDefaultValue): Added code to normalize
1822         line endings and add a leading line ending to fix cases where the first
1823         character is a newline.
1824         (WebCore::HTMLTextAreaElement::accessKeyAction): Removed name of unused arg.
1825         (WebCore::HTMLTextAreaElement::accessKey): Changed return value to avoid
1826         refcount churn.
1827         (WebCore::HTMLTextAreaElement::selection): Updated names and use < 0 instead
1828         of -1 specifically.
1829
1830         * html/HTMLTextAreaElement.h: Replaced wrap function with more-specific
1831         shouldWrapText one. Changed return value of accessKey. Made WrapMethod enum
1832         provate and renamed the values. Renamed cachedSelStart and cachedSelEnd to
1833         m_cachedSelectionStart and m_cachedSelectionEnd.
1834
1835         * rendering/RenderTextControl.cpp:
1836         (WebCore::RenderTextControl::createInnerTextStyle): Updated for change to
1837         HTMLTextAreaElement wrap function.
1838
1839 2008-03-16  Antti Koivisto  <antti@apple.com>
1840
1841         Reviewed by Mitz.
1842
1843         Fix http/tests/security/frame-loading-via-document-write.html
1844         which was broken by the preload patch.
1845         
1846         Don't print error message when preload fails local file security check.
1847         Some minor refactoring.
1848
1849         * html/PreloadScanner.cpp:
1850         (WebCore::PreloadScanner::emitTag):
1851         (WebCore::PreloadScanner::emitCSSRule):
1852         * loader/Cache.cpp:
1853         (WebCore::Cache::requestResource):
1854         * loader/Cache.h:
1855         * loader/DocLoader.cpp:
1856         (WebCore::DocLoader::requestResource):
1857         (WebCore::DocLoader::preload):
1858         (WebCore::DocLoader::printPreloadStats):
1859         * loader/DocLoader.h:
1860
1861 2008-03-16  Antti Koivisto  <antti@apple.com>
1862
1863         Reviewed by Darin.
1864         
1865         Fix http://bugs.webkit.org/show_bug.cgi?id=17862
1866         REGRESSION (r31038): Reproducible crash under DocLoader::checkForReload() at marware.com
1867         
1868         This was a memory smasher introduced by the preloading patch. 
1869         If a script resource was marked uncacheable, early deletion of the 
1870         Request object would cause deletion of the CachedResource too if
1871         it was referred more than once in a single document.
1872
1873         Test: http/tests/misc/uncacheable-script-repeated.html
1874
1875         * loader/loader.cpp:
1876         (WebCore::Loader::Host::servePendingRequests):
1877         (WebCore::Loader::Host::didFinishLoading):
1878
1879 2008-03-16  Yuzhu Shen  <yuzhu.shen@gmail.com>
1880
1881         Reviewed by Darin.
1882
1883         Fix bug http://bugs.webkit.org/show_bug.cgi?id=17714
1884         <img href="#"> should go to top of the page.
1885
1886         Test: fast/html/empty-fragment-id-goto-top.html
1887
1888         * loader/FrameLoader.cpp:
1889         (WebCore::FrameLoader::gotoAnchor):
1890
1891 2008-03-16  Thiago Macieira  <thiago.macieira@trolltech.com>
1892
1893         Reviewed by Darin.
1894
1895         Don't use RefPtr in classes you haven't seen the implementation of.
1896
1897         Forward-declaration and declaration of RefPtr<Foo> is ok. But you
1898         cannot *use* said objects until Foo is defined. This is true even for
1899         initialisation with a 0.
1900
1901         Seems the HP aCC compiler is more strict here than gcc.
1902
1903         * editing/SplitTextNodeCommand.h:
1904         * page/FrameTree.h:
1905         * xml/XPathExpressionNode.h:
1906
1907 2008-03-16  Darin Adler  <darin@apple.com>
1908
1909         Reviewed by Mitz.
1910
1911         - fix http://bugs.webkit.org/show_bug.cgi?id=14941
1912           <rdar://problem/5404093> textarea value from JavaScript includes extra newline
1913
1914         Test: fast/forms/textarea-trailing-newline.html
1915
1916         * rendering/RenderTextControl.cpp:
1917         (WebCore::RenderTextControl::finishText): Added code to strip the trailing
1918         newline. It's possible there are some obscure cases where this is not wanted,
1919         but I couldn't find any. If someone finds a case where this is bad, we can
1920         make the code conditional.
1921
1922 2008-03-16  Darin Adler  <darin@apple.com>
1923
1924         Reviewed by Mitz.
1925
1926         - fix http://bugs.webkit.org/show_bug.cgi?id=17876
1927           Attempting to visit Ofcom page causes crash
1928
1929         This is causing intermittent crashes on some existing test cases on the buildbot
1930         too; I don't have a 100% test case right now, but it should be easy to add one later
1931         and this does fix a crash in a test we already have.
1932
1933         * dom/CharacterData.cpp:
1934         (WebCore::CharacterData::CharacterData): Initialize m_data to the empty string,
1935         not the null string. The class assumes the string can never being null.
1936         (WebCore::CharacterData::setData): If asked to set the data to the null string,
1937         set it to the empty string instead. This matches what the (non-empty) constructor
1938         has always done.
1939
1940 2008-03-15  Timothy Hatcher  <timothy@apple.com>
1941
1942         Reviewed by Adam Roben.
1943
1944         Bug 17870: Web Inspector console should feel more like a terminal
1945         http://bugs.webkit.org/show_bug.cgi?id=17870
1946
1947         Bug 14390: Console input area should be more noticeable
1948         http://bugs.webkit.org/show_bug.cgi?id=14390
1949         <rdar://5712831>
1950
1951         Bug 17237: Inspector should tab-complete object properties in the Console
1952         http://bugs.webkit.org/show_bug.cgi?id=17237
1953         <rdar://5732842>
1954
1955         Adds tab completion, auto completion and a blended input prompt.
1956         The prompt is also focused when the console is shown.
1957            Implements a new look, that will be part of the UI refresh.
1958
1959         * page/inspector/ConsolePanel.js: 
1960         (WebInspector.ConsolePanel): Renamed a few properties.
1961         (WebInspector.ConsolePanel.get/set promptText): Property to set
1962         and get the current prompt text. Does not affect command history.
1963         (WebInspector.ConsolePanel.show): Make the prompt focus on show.
1964         (WebInspector.ConsolePanel.acceptAutoComplete): Accepts any
1965         pending auto complete text.
1966         (WebInspector.ConsolePanel.clearAutoComplete): Cancels any pending
1967         auto complete text.
1968         (WebInspector.ConsolePanel.autoCompleteSoon): Sets a timeout to auto
1969         complete in 250 ms, only if there isn't a pending auto complete.
1970         (WebInspector.ConsolePanel.complete): 
1971         (WebInspector.ConsolePanel.completions): Generate a list of possible
1972         completions based on the prefix and the previous expression ranges.
1973         (WebInspector.ConsolePanel._backwardsRange): Helper to scan backwards
1974         from a node and offset to find a start node and offset of the first
1975         character found in the characters string.
1976         (WebInspector.ConsolePanel._evalInInspectedWindow): Helper to eval in the
1977         inspected window.
1978         (WebInspector.ConsolePanel._caretInsidePrompt): Returns true if the selection
1979         is collapsed and is inside the prompt element.
1980         (WebInspector.ConsolePanel._moveCaretToEndOfPrompt): Moves the selection
1981         to the end of the prompt.
1982         (WebInspector.ConsolePanel._onTabPressed): Calls complete on
1983         tab press.
1984         (WebInspector.ConsolePanel._onEnterPressed): Call clearAutoComplete so the
1985         autocompletion text is not evaluated.
1986
1987         * page/inspector/Images/errorIcon.png: New image.
1988         * page/inspector/Images/userInputIcon.png: Added.
1989         * page/inspector/Images/userInputPreviousIcon.png: Added.
1990         * page/inspector/Images/warningIcon.png: New image.
1991         * page/inspector/inspector.css: New refreshed UI.
1992
1993 2008-03-15  Mark Mentovai  <mark@moxienet.com>
1994
1995         Reviewed and landed by Darin.
1996
1997         - http://bugs.webkit.org/show_bug.cgi?id=17833
1998           use file extensions instead of explicit file types in WebCore's Xcode project
1999
2000         * WebCore.xcodeproj/project.pbxproj: Remove unnecessary
2001           uses of explicitFileType, preferring lastKnownFileType ("File Type:
2002           Default for File" in Xcode's File Info's General tab).  Files below
2003           that relied on an explicit file type setting other than what would
2004           be implied by their extensions have been renamed to have correct
2005           extensions.
2006         * bridge/jni/jni_jsobject.cpp: Removed.
2007         * bridge/jni/jni_jsobject.mm: Copied from bridge/jni/jni_jsobject.cpp.
2008         * loader/mac/LoaderNSURLExtras.m: Removed.
2009         * loader/mac/LoaderNSURLExtras.mm: Copied from loader/mac/LoaderNSURLExtras.m.
2010         * platform/mac/SharedTimerMac.cpp: Removed.
2011         * platform/mac/SharedTimerMac.mm: Copied from platform/mac/SharedTimerMac.cpp.
2012
2013 2008-03-15  Darin Adler  <darin@apple.com>
2014
2015         Reviewed by Sam.
2016
2017         - fix http://bugs.webkit.org/show_bug.cgi?id=11997
2018           Ranges are not fixed after mutation (affects Acid3 test 13)
2019
2020         Test: fast/dom/Range/mutation.html
2021
2022         * WebCore.xcodeproj/project.pbxproj: Added NodeWithIndex.h, NodeWithIndexAfter.h,
2023         and NodeWithIndexBefore.h.
2024
2025         * dom/CharacterData.cpp:
2026         (WebCore::CharacterData::setData): Replaced call to Document::removeMarkers
2027         with call to Document::textRemoved.
2028         (WebCore::CharacterData::insertData): Replaced call to Document::shiftMarkers
2029         with call to Document::textInserted.
2030         (WebCore::CharacterData::deleteData): Replaced call to Document::removeMarkers
2031         and Document::shiftMarkers with call to Document::textRemoved.
2032         (WebCore::CharacterData::replaceData): Replaced call to Document::removeMarkers
2033         and Document::shiftMarkers with call to Document::textRemoved and
2034         Document::textInserted.
2035         (WebCore::CharacterData::containsOnlyWhitespace): Tweaked a bit.
2036
2037         * dom/ContainerNode.cpp:
2038         (WebCore::ContainerNode::childrenChanged): Added a call to
2039         Document::nodeChildrenChanged when the nmber of children was changed (and not
2040         by the parser).
2041         (WebCore::dispatchChildRemovalEvents): Updated for name change.
2042
2043         * dom/Document.cpp:
2044         (WebCore::Document::~Document): Assert that all ranges are gone.
2045         (WebCore::Document::nodeChildrenChanged): Added. Calls nodeChildrenChanged on
2046         all ranges.
2047         (WebCore::Document::nodeWillBeRemoved): Renamed from notifyBeforeNodeRemoval.
2048         Added code to call nodeWillBeRemoved on all ranges.
2049         (WebCore::Document::textInserted): Added. Calls textInserted on all ranges and
2050         also calls shiftMarkers.
2051         (WebCore::Document::textRemoved): Added. Calls textRemoved on all ranges and also
2052         calls removeMarkers and shiftMarkers.
2053         (WebCore::Document::textNodesMerged): Added. Calls textNodesMerged on all ranges.
2054         (WebCore::Document::textNodeSplit): Added. Calls textNodeSplit on all ranges.
2055         (WebCore::Document::attachRange): Added. Adds range to the HashSet of all ranges
2056         for this document.
2057         (WebCore::Document::detachRange): Added. Removes range from the HashSet.
2058         * dom/Document.h: Added the new functions and the data member.
2059
2060         * dom/Element.cpp:
2061         (WebCore::Element::normalizeAttributes): Added. Contains the part of the
2062         normalize function that's specific to Element. Better encapsulation to have it
2063         here rather than in Node::normalize.
2064         * dom/Element.h: Added the new function.
2065
2066         * dom/Node.cpp:
2067         (WebCore::Node::normalize): Rewrote so it's no longer recursive. Also added
2068         a call to textNodesMerged after each pair of nodes is merged but before the
2069         second node is removed.
2070         (WebCore::Node::traverseNextNodePostOrder): Added. Helper function used by
2071         normalize, but also useful elsewhere.
2072         * dom/Node.h: Added the new function.
2073
2074         * dom/NodeIterator.cpp:
2075         (WebCore::NodeIterator::nodeWillBeRemoved): Renamed from notifyBeforeNodeRemoval.
2076         * dom/NodeIterator.h: Ditto.
2077
2078         * dom/ProcessingInstruction.cpp:
2079         (WebCore::ProcessingInstruction::setData): Call textRemoved.
2080
2081         * dom/Range.cpp:
2082         (WebCore::NodeWithIndex::index): Added. Computes and stores index.
2083         (WebCore::NodeWithIndexBefore::indexBefore): Added. Computes and stores index.
2084         (WebCore::NodeWithIndexAfter::indexAfter): Added. Computes and stores index.
2085         (WebCore::Range::Range): Call attachRange.
2086         (WebCore::Range::~Range): Call detachRange unless the range is already detached.
2087         (WebCore::Range::commonAncestorContainer): Removed check for WRONG_DOCUMENT_ERR.
2088         It's no longer possible to create a range where the two containers are non-zero
2089         and have no common ancestor.
2090         (WebCore::Range::isPointInRange): Rewrote expression to be more readable.
2091         (WebCore::Range::compareNode): Changed local variable to use int for consistency.
2092         (WebCore::Range::compareBoundaryPoints): Replaced ASSERT with ASSERT_NOT_REACHED.
2093         (WebCore::Range::deleteContents): Removed check for INVALID_STATE_ERR and
2094         initialization of ec to 0; both are now inside checkDeleteExtract.
2095         (WebCore::Range::intersectsNode): Changed local variable to use int for consistency.
2096         Also changed comparison to use < 0 and >= 0 rather than checking explicitly for 1
2097         and -1.
2098         (WebCore::Range::processContents): Changed code to not get the nodeType multiple
2099         times on the same node, and tweaked formatting. Removed code to update the range
2100         on deletion, because the normal delete logic will take care of that now.
2101         (WebCore::Range::extractContents): Removed check for INVALID_STATE_ERR and
2102         initialization of ec to 0; both are now inside checkDeleteExtract.
2103         (WebCore::Range::insertNode): Changed local variable to use int for consistency.
2104         (WebCore::Range::toString): Changed variable name to pastLast.
2105         (WebCore::Range::detach): Call detachRange.
2106         (WebCore::Range::checkDeleteExtract): Added check for detached range and code to
2107         set ec to 0; moved here from the two callers. Also changed variable name to pastLast.
2108         (WebCore::endpointNodeChildrenChanged): Added.
2109         (WebCore::Range::nodeChildrenChanged): Added.
2110         (WebCore::endpointNodeWillBeRemoved): Added.
2111         (WebCore::Range::nodeWillBeRemoved): Added.
2112         (WebCore::endpointTextInserted): Added.
2113         (WebCore::Range::textInserted): Added.
2114         (WebCore::endpointTextRemoved): Added.
2115         (WebCore::Range::textRemoved): Added.
2116         (WebCore::endpointTextNodesMerged): Added.
2117         (WebCore::Range::textNodesMerged): Added.
2118         (WebCore::endpointTextNodesSplit): Added.
2119         (WebCore::Range::textNodeSplit): Added.
2120
2121         * dom/Range.h: Added new member functions.
2122
2123         * dom/NodeWithIndex.h: Added. Makes it so we won't find the index for the same
2124         node more than once.
2125         * dom/NodeWithIndexAfter.h: Added. Similar to NodeWithIndex but gives the index after a
2126         node and treats a node pointer of 0 as meaning "before first node in parent container".
2127         * dom/NodeWithIndexBefore.h: Added.  Similar to NodeWithIndex but treats a node pointer of 0
2128         as meaning "after last node in parent container".
2129
2130         * dom/Text.cpp:
2131         (WebCore::Text::splitText): Call textNodeSplit.
2132
2133         * editing/ApplyStyleCommand.cpp:
2134         (WebCore::ApplyStyleCommand::applyInlineStyle): Changed variable name to pastLast.
2135
2136 2008-03-15  Julien Chaffraix  <julien.chaffraix@gmail.com>
2137
2138         Reviewed by Holger.
2139
2140         [CURL] Crash below ResourceHandleManager::setupPOST when job->request().httpBody() is NULL
2141         http://bugs.webkit.org/show_bug.cgi?id=16906
2142
2143         Add null checks for httpBody() to match other ports.
2144
2145         Test: http/tests/xmlhttprequest/xmlhttprequest-post-crash.html
2146
2147         * platform/network/curl/ResourceHandleManager.cpp:
2148         (WebCore::readCallback): Add null check.
2149         (WebCore::ResourceHandleManager::setupPOST): Ditto.
2150
2151 2008-03-14  Steve Falkenburg  <sfalken@apple.com>
2152
2153         PGO build fixes.
2154
2155         * WebCore.vcproj/WebCore.vcproj:
2156
2157 2008-03-14  Anders Carlsson  <andersca@apple.com>
2158
2159         Reviewed by Sam.
2160
2161         <rdar://problem/5794989>
2162         https://bugs.webkit.org/show_bug.cgi?id=17792
2163         REGRESSION (Safari 3.0.4-3.1): Ordering tickets from Sweden's biggest train operator doesn't work
2164
2165         Pass the frame loader that should be used for looking up the frame name to FrameLoader::createWindow
2166         so that somewindow.open calls where the active window and 'somewindow' differ return the correct frame.
2167         
2168         * bindings/js/JSDOMWindowBase.cpp:
2169         (WebCore::createWindow):
2170         * loader/FrameLoader.cpp:
2171         (WebCore::FrameLoader::createWindow):
2172         * loader/FrameLoader.h:
2173
2174 2008-03-14  Dan Bernstein  <mitz@apple.com>
2175
2176         Reviewed by Mark Rowe.
2177
2178         - fix <rdar://problem/5797836> shadow offsets are smaller than specified
2179
2180         * platform/graphics/cg/GraphicsContextCG.cpp:
2181         (WebCore::GraphicsContext::setShadow): Made the workaround for
2182         <rdar://problem/5539388> unconditional.
2183
2184 2008-03-14  Adam Roben  <aroben@apple.com>
2185
2186         Fix it right this time
2187
2188         * platform/MainThread.cpp: Cast to unsigned so we can use %u in the
2189         format string.
2190         * platform/mac/MainThreadMac.mm:
2191
2192 2008-03-14  Adam Roben  <aroben@apple.com>
2193
2194         Mac build fix
2195
2196         * platform/mac/MainThreadMac.mm: Corrected a typo.
2197
2198 2008-03-14  Dan Bernstein  <mitz@apple.com>
2199
2200         Reviewed by Darin Adler.
2201
2202         - fix http://bugs.webkit.org/show_bug.cgi?id=17834
2203           REGRESSION: floated first-letter does not work when included in table
2204
2205         Test: fast/css/first-letter-float.html
2206
2207         * rendering/RenderBlock.cpp:
2208         (WebCore::RenderBlock::updateFirstLetter): Changed the search for the
2209         first text node to stop at a float if that float is an existing first-
2210         letter.
2211
2212 2008-03-14  Sam Weinig  <sam@webkit.org>
2213
2214         Fix Mac build
2215
2216         * WebCore.xcodeproj/project.pbxproj:
2217
2218 2008-03-13  Adam Roben  <aroben@apple.com>
2219
2220         Make most of callOnMainThread's implementation be cross-platform
2221
2222         I took the non-platform-specific parts of MainThreadWin.cpp and moved
2223         them to a new MainThread.cpp. Each platform is now responsible for
2224         implementing one function, scheduleDispatchFunctionsOnMainThread,
2225         which is supposed to set things up so that
2226         dispatchFunctionsFromMainThread gets called from the main thread in
2227         the near future.
2228
2229         Reviewed by Alexey.
2230
2231         * GNUmakefile.am: Added MainThread.cpp to the project.
2232         * WebCore.pro: Ditto.
2233         * WebCore.vcproj/WebCore.vcproj: Ditto.
2234         * WebCore.xcodeproj/project.pbxproj: Ditto.
2235         * WebCoreSources.bkl: Ditto.
2236         * platform/MainThread.cpp:
2237           - Copied from WebCore/platform/win/MainThreadWin.cpp.
2238           - Removed the Windows-specific parts.
2239         (WebCore::callOnMainThread): Changed to call
2240         scheduleDispatchFunctionsOnMainThread instead of PostMessage.
2241         * platform/gtk/MainThreadGtk.cpp:
2242         (WebCore::timeoutFired): Renamed from callFunctionOnMainThread. Now
2243         just calls dispatchFunctionsFromMainThread.
2244         (WebCore::scheduleDispatchFunctionsOnMainThread): Added. Calls through
2245         to g_timeout_add.
2246         * platform/mac/MainThreadMac.mm: Renamed WebCoreFunctionWrapper to
2247         WebCoreMainThreadCaller.
2248         (-[WebCoreMainThreadCaller call]): Calls through to
2249         dispatchFunctionsFromMainThread.
2250         (WebCore::scheduleDispatchFunctionsOnMainThread): Makes a new
2251         WebCoreMainThreadCaller and calls performSelectorOnMainThread on it.
2252         * platform/qt/MainThreadQt.cpp: Removed PerformFunctionEvent.
2253         (WebCore::MainThreadInvoker::event): Chagned to call through to
2254         dispatchFunctionsFromMainThread.
2255         (WebCore::scheduleDispatchFunctionsOnMainThread): Sends an empty event
2256         to the MainThreadInvoker.
2257         * platform/win/MainThreadWin.cpp:
2258           - Removed the non-Windows-specific parts.
2259           - Removed some unnecessary initialization of static variables to 0.
2260         (WebCore::ThreadingWindowWndProc): Changed to call
2261         dispatchFunctionsFromMainThread.
2262         (WebCore::scheduleDispatchFunctionsOnMainThread): Calls through to
2263         PostMessage.
2264         * platform/wx/MainThreadWx.cpp:
2265         (WebCore::scheduleDispatchFunctionsOnMainThread): Added.
2266
2267 2008-03-14  Beth Dakin  <bdakin@apple.com>
2268
2269         Reviewed by Geoff.
2270
2271         Fix for <rdar://problem/5728171> Potential PLT speedup: don't 
2272         realloc every time inside NamedAttrMap::addAttribute
2273
2274         The speed-up for this turned out to be so small that it is mostly 
2275         imperceptible. It is likely that it is a tiny boost, though, and 
2276         the new code is much cleaner.
2277
2278         * dom/Element.cpp:
2279         (WebCore::Element::setAttributeMap): attrs is now called 
2280         m_attributes
2281         * dom/NamedAttrMap.cpp: The array attrs is now the Vector of 
2282         RefPtrs called m_attributes, and there is no longer any need for 
2283         the len member variable. 
2284         (WebCore::NamedAttrMap::NamedAttrMap): 
2285         (WebCore::NamedAttrMap::item):
2286         (WebCore::NamedAttrMap::getAttributeItem):
2287         (WebCore::NamedAttrMap::clearAttributes):
2288         (WebCore::NamedAttrMap::operator=):
2289         (WebCore::NamedAttrMap::addAttribute):
2290         (WebCore::NamedAttrMap::removeAttribute):
2291         (WebCore::NamedAttrMap::mapsEquivalent):
2292         * dom/NamedAttrMap.h: Same.
2293         (WebCore::NamedAttrMap::length):
2294         (WebCore::NamedAttrMap::attributeItem):
2295         (WebCore::NamedAttrMap::shrinkToLength):
2296         (WebCore::NamedAttrMap::reserveCapacity):
2297         * html/HTMLTokenizer.cpp: One of the benefits of the old array was 
2298         that it never took up more memory than it needed to. So the 
2299         tokenizer utilizes new member functions on NamedAttrMap 
2300         (shrinkToLength and reserveCapacity) to try to keep memory usage at 
2301         a minimum. 
2302         (WebCore::Token::addAttribute):
2303         (WebCore::HTMLTokenizer::processToken):
2304
2305 2008-03-14  David D. Kilzer  <ddkilzer@apple.com>
2306
2307         BUILD FIX when ENABLE(MAC_JAVA_BRIDGE) set to 0.
2308
2309         * page/mac/FrameMac.mm: Move up #if ENABLE(MAC_JAVA_BRIDGE) guard
2310         to comment out unused code.
2311
2312 2008-03-14  David D. Kilzer  <ddkilzer@apple.com>
2313
2314         Unify concept of enabling the Mac Java bridge.
2315
2316         Reviewed by Darin and Anders.
2317
2318         No test cases added since there is no change in functionality.
2319
2320         * DerivedSources.make: Added check for ENABLE_MAC_JAVA_BRIDGE macro.
2321         If defined as "1", add WebCore.JNI.exp to WEBCORE_EXPORT_DEPENDENCIES.
2322         * WebCore.JNI.exp: Added.
2323         * WebCore.base.exp: Moved exported JNI methods to WebCore.JNI.exp.
2324
2325         * bridge/jni/jni_class.cpp: Added #if ENABLE(MAC_JAVA_BRIDGE) guard.
2326         * bridge/jni/jni_class.h: Ditto.
2327         * bridge/jni/jni_instance.cpp: Ditto.
2328         * bridge/jni/jni_instance.h: Ditto.
2329         * bridge/jni/jni_jsobject.cpp: Ditto.
2330         * bridge/jni/jni_jsobject.h: Ditto.
2331         * bridge/jni/jni_objc.mm: Ditto.
2332         * bridge/jni/jni_runtime.cpp: Ditto.
2333         * bridge/jni/jni_runtime.h: Ditto.
2334         * bridge/jni/jni_utility.cpp: Ditto.
2335         * bridge/jni/jni_utility.h: Ditto.
2336
2337         * bridge/runtime.cpp: Removed unused #include statements.
2338         * bridge/runtime.h:
2339         (KJS::Bindings::Instance::BindingLanguage): Added #if ENABLE(MAC_JAVA_BRIDGE)
2340         guard for JavaLanguage enum.  Also added #if PLATFORM(MAC) guard for
2341         ObjectiveCLanguage enum to match corresponding code in runtime.cpp.
2342
2343         * config.h: Removed definition of HAVE_JNI.
2344
2345         * loader/FrameLoaderClient.h:
2346         (WebCore::FrameLoaderClient::javaApplet): Added #if ENABLE(MAC_JAVA_BRIDGE) guard.
2347         * page/Frame.cpp:
2348         (WebCore::Frame::Frame): Ditto.
2349         * page/Frame.h:
2350         (WebCore::Frame::initJavaJSBindings): Ditto.
2351         * page/mac/FrameMac.mm:
2352         (WebCore::Frame::createScriptInstanceForWidget): Ditto.
2353         (WebCore::Frame::initJavaJSBindings): Ditto.
2354
2355 2008-03-13  Darin Adler  <darin@apple.com>
2356
2357         * html/PreloadScanner.h: Corrected license.
2358         * html/PreloadScanner.cpp: Corrected license.
2359
2360 2008-03-13  Mark Mentovai  <mark@moxienet.com>
2361
2362         Reviewed by darin.  Landed by eseidel.
2363
2364         * platform/FloatConversion.h: Include a header to get CoreGraphics
2365         types when using CoreGraphics types.
2366
2367 2008-03-13  Mark Mentovai  <mark@moxienet.com>
2368
2369         Reviewed by eseidel.  Landed by eseidel.
2370
2371         * WebCore.xcodeproj/project.pbxproj:
2372         * css/CSSParser.cpp:
2373         * css/makeprop.pl:
2374         Move CSSPropertyNames.c to CSSPropertyNames.cpp
2375
2376 2008-03-13  Mark Mentovai  <mark@moxienet.com>
2377
2378         Reviewed by eseidel.  Landed by eseidel.
2379
2380         * platform/Arena.h: Use statement1;statement2 instead of
2381         (statement1,statement2) in CLEAR_UNUSED.
2382
2383 2008-03-13  Tommi Komulainen  <tommi.komulainen@iki.fi>
2384
2385         Reviewed by Alp Toker.
2386
2387         http://bugs.webkit.org/show_bug.cgi?id=17821
2388         [SOUP] POST requests are empty
2389
2390         Send the HTTP request body as well.
2391
2392         * platform/network/soup/ResourceHandleSoup.cpp:
2393         (WebCore::ResourceHandle::start):
2394
2395 2008-03-13  Dan Bernstein  <mitz@apple.com>
2396
2397         Reviewed by Dave Hyatt.
2398
2399         - fix http://bugs.webkit.org/show_bug.cgi?id=17819
2400           Border-collapse: collapse later cell wins on PC, earlier cell on Mac
2401
2402         Test: fast/table/border-collapsing/equal-precedence-resolution.html
2403
2404         * rendering/RenderTableCell.cpp:
2405         (WebCore::RenderTableCell::collapsedLeftBorder): When calling
2406         compareBorders() with borders that may have the same precedence, made
2407         sure to pass the border belonging to the earlier (in document order)
2408         element first, since compareBorders() prefers the first argument when
2409         there is a tie.
2410         (WebCore::RenderTableCell::collapsedRightBorder): Ditto.
2411         (WebCore::RenderTableCell::collapsedTopBorder): Ditto.
2412
2413 2008-03-13  Adam Roben  <aroben@apple.com>
2414
2415         wx build fix and Windows leak fix after r31034
2416
2417         * platform/graphics/wx/ImageWx.cpp:
2418         (WebCore::Image::loadPlatformResource): Use SharedBuffer::create.
2419         * platform/win/SharedBufferWin.cpp:
2420         (WebCore::SharedBuffer::createWithContentsOfFile): Ditto (we were
2421         leaking the SharedBuffer here before).
2422
2423 2008-03-13  Antti Koivisto  <antti@apple.com>
2424
2425         Reviewed by Eric.
2426
2427         Correct a few issues spotted by Mike Belshe. 
2428
2429         * html/PreloadScanner.cpp:
2430         (WebCore::PreloadScanner::tokenize):
2431         * loader/loader.cpp:
2432         (WebCore::Loader::cancelRequests):
2433
2434 2008-03-13  Rodney Dawes  <dobey@wayofthemonkey.com>
2435
2436         Fix GTK+ build for SharedBuffer changes.
2437
2438         * platform/graphics/gtk/ImageGtk.cpp:
2439         (Image::loadPlatformResource):
2440
2441 2008-03-13  Steve Falkenburg  <sfalken@apple.com>
2442
2443         More PGO build fixes.
2444
2445         * WebCorePrefix.cpp:
2446
2447 2008-03-13  Antti Koivisto  <antti@apple.com>
2448
2449         Reviewed by Darin.
2450         
2451         Make page loads go fast.
2452         
2453         http://bugs.webkit.org/show_bug.cgi?id=17480
2454
2455         - Implement speculative preloading. When a script load blocks the main parser, use a side 
2456           parser to pick up more resources.
2457         - Implement per-host load queues, prioritize scripts and stylesheets over images.
2458         
2459         Depending on content and network latency this may speed things up quite a bit.
2460
2461         * WebCore.xcodeproj/project.pbxproj:
2462         * dom/Document.cpp:
2463         (WebCore::Document::implicitClose):
2464         Clear the preloads after laoding completes.
2465         
2466         * html/HTMLLinkElement.cpp:
2467         (WebCore::HTMLLinkElement::parseMappedAttribute):
2468         (WebCore::HTMLLinkElement::tokenizeRelAttribute):
2469         * html/HTMLLinkElement.h:
2470         Make tokenizeRelAttribute() public static so it can be used from elsewhere.
2471         Eliminate a pointless bitfield so I can get references.
2472         
2473         * html/HTMLTokenizer.cpp:
2474         (WebCore::HTMLTokenizer::scriptHandler):
2475         (WebCore::HTMLTokenizer::scriptExecution):
2476         (WebCore::HTMLTokenizer::write):
2477         * html/HTMLTokenizer.h:
2478         Spin up the preload scanner whenever a script load blocks the parser. One scanner tracks the end of 
2479         the document while temporary ones are created as needed to scan document.write() output.
2480         
2481         * html/PreloadScanner.cpp: Added.
2482         (WebCore::PreloadScanner::PreloadScanner):
2483         (WebCore::PreloadScanner::~PreloadScanner):
2484         (WebCore::PreloadScanner::begin):
2485         (WebCore::PreloadScanner::end):
2486         (WebCore::PreloadScanner::reset):
2487         (WebCore::PreloadScanner::write):
2488         (WebCore::isWhitespace):
2489         (WebCore::PreloadScanner::clearLastCharacters):
2490         (WebCore::PreloadScanner::rememberCharacter):
2491         (WebCore::PreloadScanner::lastCharactersMatch):
2492         (WebCore::legalEntityFor):
2493         (WebCore::PreloadScanner::consumeEntity):
2494         (WebCore::PreloadScanner::tokenize):
2495         (WebCore::PreloadScanner::processAttribute):
2496         (WebCore::PreloadScanner::emitCharacter):
2497         (WebCore::PreloadScanner::tokenizeCSS):
2498         (WebCore::PreloadScanner::emitTag):
2499         (WebCore::PreloadScanner::emitCSSRule):
2500         * html/PreloadScanner.h: Added.
2501         (WebCore::PreloadScanner::inProgress):
2502         (WebCore::PreloadScanner::):
2503         HTML5 tokenization plus some glue code. Fake CSS parsing thrown in just for fun.
2504         
2505         * loader/Cache.cpp:
2506         (WebCore::Cache::pruneDeadResources):
2507         Preloads have zero refcount, avoid kicking them out too early.
2508         
2509         * loader/CachedResource.cpp:
2510         (WebCore::CachedResource::CachedResource):
2511         (WebCore::CachedResource::ref):
2512         * loader/CachedResource.h:
2513         (WebCore::CachedResource::):
2514         (WebCore::CachedResource::preloadResult):
2515         (WebCore::CachedResource::setRequestedFromNetworkingLayer):
2516         (WebCore::CachedResource::canDelete):
2517         (WebCore::CachedResource::isPreloaded):
2518         (WebCore::CachedResource::increasePreloadCount):
2519         (WebCore::CachedResource::decreasePreloadCount):
2520         Keep track which resources are preloads. Avoid deleting them. Track
2521         at which point of the loading preloads get utilized to enable some interesting 
2522         statistics.
2523         
2524         * loader/DocLoader.cpp:
2525         (WebCore::DocLoader::~DocLoader):
2526         (WebCore::DocLoader::checkForReload):
2527         (WebCore::DocLoader::registerPreload):
2528         (WebCore::DocLoader::clearPreloads):
2529         (WebCore::DocLoader::printPreloadStats):
2530         * loader/DocLoader.h:
2531         Ensure we utilize preloaded resources during reloads.
2532         Keep a list of all preloads in the document. Clear the preloads after
2533         parsing is complete. Some debug statistics.
2534         
2535         * loader/DocumentLoader.cpp:
2536         (WebCore::DocumentLoader::isLoadingInAPISense):
2537         Avoid signaling that loading is complete too early. 
2538         
2539         * loader/loader.cpp:
2540         (WebCore::Loader::Loader):
2541         (WebCore::Loader::~Loader):
2542         (WebCore::Loader::determinePriority):
2543         (WebCore::Loader::load):
2544         (WebCore::Loader::scheduleServePendingRequests):
2545         (WebCore::Loader::requestTimerFired):
2546         (WebCore::Loader::servePendingRequests):
2547         (WebCore::Loader::cancelRequests):
2548         (WebCore::Loader::Host::Host):
2549         (WebCore::Loader::Host::~Host):
2550         (WebCore::Loader::Host::addRequest):
2551         (WebCore::Loader::Host::hasRequests):
2552         (WebCore::Loader::Host::servePendingRequests):
2553         (WebCore::Loader::Host::didFinishLoading):
2554         (WebCore::Loader::Host::didFail):
2555         (WebCore::Loader::Host::didReceiveResponse):
2556         (WebCore::Loader::Host::didReceiveData):
2557         (WebCore::Loader::Host::cancelPendingRequests):
2558         (WebCore::Loader::Host::cancelRequests):
2559         * loader/loader.h:
2560         (WebCore::Loader::):
2561         Distribute load requests to per-host priority queues. Limit the number of loads issued to the 
2562         networking layer so we have better changes of getting important requests through first.
2563         Prioritize scripts > stylesheets > images.
2564
2565 2008-03-13  David Hyatt  <hyatt@apple.com>
2566
2567         This patch makes full page zoom work pretty well. It fixes repainting so that it works when transforms
2568         are set on the RenderView. It also implements the "smart layout" behavior that other browsers support when
2569         zooming. The page will still try to constrain to the viewport size even when zoomed.
2570
2571         Reviewed by john
2572
2573         * dom/Document.cpp:
2574         (WebCore::Document::recalcStyle):
2575         Make sure to test for transform changes even when there is no zoom.  This fixes repainting issues
2576         caused by jumping from a zoomed state back to the standard size.
2577
2578         * page/FrameView.cpp:
2579         (WebCore::FrameView::adjustViewSize):
2580         Adjust for the zoom factor (the render tree is in unzoomed coordinates, but the scrollbars of the view
2581         need to handle zoomed coordinates).
2582
2583         * rendering/RenderBox.cpp:
2584         (WebCore::RenderBox::calcHeight):
2585         Fix the body-sizing-to-the-view-height quirk so that it takes the zoom factor into account when
2586         stretching to fill the viewport.
2587
2588         * rendering/RenderLayer.cpp:
2589         (WebCore::RenderLayer::updateLayerPositions):
2590         (WebCore::RenderLayer::setHasVisibleContent):
2591         Remove the FIXMEs now that absoluteClippedOverflowRect works with transforms on the RenderView.
2592
2593         * rendering/RenderView.cpp:
2594         (WebCore::RenderView::calcHeight):
2595         (WebCore::RenderView::calcWidth):
2596         Make sure the calculated width/height take the zoom factor into account in order to get the "smart layout"
2597         behavior.
2598
2599         (WebCore::RenderView::layout):
2600         When deciding whether children have to get a relayout, we need to check the zoomed width/height and not just
2601         the viewport size.
2602
2603         (WebCore::RenderView::computeAbsoluteRepaintRect):
2604         Patched to take into account transforms set on the RenderView.
2605
2606         (WebCore::RenderView::docHeight):
2607         (WebCore::RenderView::docWidth):
2608         Patched to just always use m_width and m_height initially, since those have already been adjusted for
2609         the zoom factor.
2610
2611         (WebCore::RenderView::zoomedHeight):
2612         (WebCore::RenderView::zoomedWidth):
2613         * rendering/RenderView.h:
2614         New helper methods for obtaining the adjusted width/height of the viewport taking into account the
2615         zoom factor.
2616
2617 2008-03-13  Anders Carlsson  <andersca@apple.com>
2618
2619         Build fix.
2620
2621         * WebCore.base.exp:
2622
2623 2008-03-13  Anders Carlsson  <andersca@apple.com>
2624
2625         Reviewed by Adam.
2626
2627         Get rid of actualRequest, it is not used anymore. Also, get rid of 
2628         initialRequest and replace all uses with originalRequest because those are
2629         the same thing.
2630         
2631         * loader/DocumentLoader.cpp:
2632         * loader/DocumentLoader.h:
2633         * loader/FrameLoader.cpp:
2634         (WebCore::FrameLoader::initialRequest):
2635         (WebCore::FrameLoader::originalRequestURL):
2636
2637 2008-03-13  Brady Eidson  <beidson@apple.com>
2638
2639         Reviewed by Anders
2640
2641         Convert SharedBuffer to start with a refCount of 1
2642
2643         * loader/ImageDocument.cpp:
2644         (WebCore::ImageTokenizer::finish):
2645
2646         * loader/ResourceLoader.cpp:
2647         (WebCore::ResourceLoader::addData):
2648         (WebCore::ResourceLoader::willStopBufferingData):
2649
2650         * loader/icon/IconDatabase.cpp:
2651         (WebCore::IconDatabase::defaultIcon):
2652         (WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
2653
2654         * loader/loader.cpp:
2655         (WebCore::Loader::didReceiveData):
2656
2657         * platform/SharedBuffer.h:
2658         (WebCore::SharedBuffer::create): Make all constructors private, add ::create() calls
2659         * platform/SharedBuffer.cpp:
2660         (WebCore::SharedBuffer::SharedBuffer): Revert to default RefCounted constructor to start with a ref count of 1
2661         (WebCore::SharedBuffer::copy):
2662         * platform/mac/SharedBufferMac.mm:
2663         (WebCore::SharedBuffer::wrapNSData):
2664         (WebCore::SharedBuffer::SharedBuffer): Revert to default RefCounted constructor to start with a ref count of 1
2665
2666 2008-03-13  Steve Falkenburg  <sfalken@apple.com>
2667
2668         PGO build fixes.
2669         
2670         Disable PGO for normal release builds.
2671         Added work-in-progress Release_PGOInstrument/Release_PGOOptimize targets.
2672
2673         * WebCore.vcproj/WebCore.vcproj:
2674
2675 2008-03-13  Anders Carlsson  <andersca@apple.com>
2676
2677         Reviewed by Darin.
2678
2679         Make a bunch of DocumentLoader setters/getters inline.
2680         
2681         * loader/DocumentLoader.cpp:
2682         * loader/DocumentLoader.h:
2683         (WebCore::DocumentLoader::isStopping):
2684         (WebCore::DocumentLoader::setCommitted):
2685         (WebCore::DocumentLoader::isCommitted):
2686         (WebCore::DocumentLoader::isLoading):
2687         (WebCore::DocumentLoader::setLoading):
2688         (WebCore::DocumentLoader::response):
2689         (WebCore::DocumentLoader::mainDocumentError):
2690         (WebCore::DocumentLoader::setResponse):
2691         (WebCore::DocumentLoader::isClientRedirect):
2692         (WebCore::DocumentLoader::setIsClientRedirect):
2693         (WebCore::DocumentLoader::overrideEncoding):
2694         (WebCore::DocumentLoader::responses):
2695         (WebCore::DocumentLoader::triggeringAction):
2696         (WebCore::DocumentLoader::setTriggeringAction):
2697         (WebCore::DocumentLoader::setOverrideEncoding):
2698         (WebCore::DocumentLoader::setLastCheckedRequest):
2699         (WebCore::DocumentLoader::lastCheckedRequest):
2700         (WebCore::DocumentLoader::title):
2701         (WebCore::DocumentLoader::setLoadingFromCachedPage):
2702         (WebCore::DocumentLoader::isLoadingFromCachedPage):
2703
2704 2008-03-13  Rodney Dawes  <dobey@wayofthemonkey.com>
2705
2706         Fix builds without SVG enabled.
2707
2708         * page/Frame.cpp:
2709         (Frame::shouldApplyTextZoom):
2710         (Frame::shouldApplyPageZoom):
2711
2712 2008-03-13  Simon Hausmann  <hausmann@webkit.org>
2713
2714         Fix the Qt build.
2715
2716         * bridge/qt/qt_instance.cpp:
2717         (KJS::Bindings::QtInstance::getQtInstance):
2718         (KJS::Bindings::QtInstance::getRuntimeObject):
2719         * bridge/qt/qt_instance.h:
2720         (KJS::Bindings::QtInstance::create):
2721         * bridge/qt/qt_runtime.cpp:
2722         (KJS::Bindings::convertQVariantToValue):
2723         (KJS::Bindings::QtConnectionObject::execute):
2724         * page/qt/FrameQt.cpp:
2725         (WebCore::Frame::createScriptInstanceForWidget):
2726
2727 2008-03-12  Sam Weinig  <sam@webkit.org>
2728
2729         Reviewed by Darin Adler.
2730
2731         Fix <rdar://problem/5784773>
2732         Crash loading QT movies @ apple.com/ipodtouch/features.html with a PAC file (WebKitThreadingException)
2733
2734         Make bridged RuntimeObjects get collected on the main thread only. This is necessary
2735         because clients of the bridged objects are unlikely to prepared for a collection on 
2736         non-main thread, which can happen with a PAC file.
2737
2738         * bridge/runtime_object.cpp:
2739         (RuntimeObjectImp::RuntimeObjectImp):
2740
2741 2008-03-12  Adam Roben  <aroben@apple.com>
2742
2743         Fix Bug 17815: Inspector's DOM tree should descend into subframes
2744
2745         <http://bugs.webkit.org/show_bug.cgi?id=17815>
2746
2747         Reviewed by Tim.
2748
2749         * page/inspector/DocumentPanel.js:
2750         (WebInspector.DocumentPanel.revealNode): Changed to provide
2751         _isAncestorIncludingParentFramesWithinPanel and
2752         _parentNodeOrFrameElementWithinPanel for the isAncestor and getParent
2753         parameters to findTreeElement so that parent frames will be searched.
2754         (WebInspector.DocumentPanel.updateBreadcrumb):
2755           - Changed while loop to for loop
2756           - Use _parentNodeOrFrameElementWithinPanel instead of
2757             Node.parentNode to move to the next node
2758           - The loop now ends when we reach the DocumentPanel's document node
2759           - Traversal past other Document nodes is now allowed
2760           - We add the "start" class to the final crumb after the loop exits
2761         (WebInspector.DocumentPanel._getDocumentForNode): Added. Simple helper
2762         that returns the node itself if the node is a Document node, or the
2763         node's ownerDocument otherwise.
2764         (WebInspector.DocumentPanel._parentNodeOrFrameElementWithinPanel):
2765         Added. Returns the node's parent node or, in the case of a Document
2766         node, the node's window's owning frame element, but will not return a
2767         node that is in a parent frame of the DocumentPanel's Document.
2768         (WebInspector.DocumentPanel._isAncestorIncludingParentFramesWithinPanel):
2769         Added. Returns true if a is an ancestor of b if a is an ancestor of a
2770         frame element whose subframe(s) contain b.
2771         (WebInspector.DOMNodeTreeElement): We now consider ourselves to have
2772         children if we have a contentDocument.
2773         (WebInspector.DOMNodeTreeElement.onpopulate): Moved the appendChild
2774         loop into a function so that we can add both children of our
2775         contentDocument and children of our node to the tree.
2776         (WebInspector.DOMNodeTreeElement.ondblclick): Changed so that we get
2777         the rootDOMNode by traversing the tree outline hierarchy instead of
2778         the DOM hierarchy so that we can easily jump up to a parent frame.
2779
2780 2008-03-12  Adam Roben  <aroben@apple.com>
2781
2782         Update the styles/metrics panes and breadcrumb after editing DOM
2783         attributes
2784
2785         Reviewed by Tim.
2786
2787         * page/inspector/DocumentPanel.js:
2788         (WebInspector.DocumentPanel.set focusedDOMNode): Moved code to update
2789         the parts of the DocumentPanel other than the DOM tree into a new
2790         function, _focusedNodeChanged.
2791         (WebInspector.DocumentPanel._focusedNodeChanged): Added. The
2792         forceUpdate parameter specifies whether the update should occur even
2793         if the focused node hasn't changed since the last update.
2794         (WebInspector.DocumentPanel.updateBreadcrumb): Added a forceUpdate
2795         parameter. If forceUpdate is true, we always rebuild the breadcrumbs.
2796         (WebInspector.DocumentPanel.updateStyles): Added a forceUpdate
2797         parameter. If forceUpdate is true, we always rebuild the styles pane.
2798         (WebInspector.DOMNodeTreeElement._attributeEditingCommitted): Added a
2799         call to DocumentPanel._focusedNodeChanged. We have to force the update
2800         because we haven't changed the focused node (the attributes of the
2801         node have changed).
2802         * page/inspector/StylesSidebarPane.js:
2803         (WebInspector.StylesSidebarPane.update): Added a forceUpdate
2804         parameter. If forceUpdate is true we always rebuild the styles.
2805
2806 2008-03-12  Mark Rowe  <mrowe@apple.com>
2807
2808         Further Gtk and Qt build fixes.
2809
2810         * bridge/runtime.cpp:
2811         (KJS::Bindings::Instance::createRuntimeObject): Adapt Qt-only code for change to PassRefPtr.
2812         * page/gtk/FrameGtk.cpp: Add missing include.
2813
2814 2008-03-12  Mark Rowe  <mrowe@apple.com>
2815
2816         Fix Gtk and Qt builds.
2817
2818         * page/gtk/FrameGtk.cpp:
2819         * page/qt/FrameQt.cpp:
2820
2821 2008-03-12  Mark Rowe  <mrowe@apple.com>
2822
2823         Mac build fix.
2824
2825         * WebCore.base.exp:  Remove symbol.
2826
2827 2008-03-12  Steve Falkenburg  <sfalken@apple.com>
2828
2829         Build fix.
2830
2831         * page/win/FrameWin.cpp:
2832
2833 2008-03-12  Steve Falkenburg  <sfalken@apple.com>
2834
2835         Build fix.
2836
2837         * plugins/win/PluginViewWin.cpp:
2838         (WebCore::PluginView::bindingInstance):
2839
2840 2008-03-12  Darin Adler  <darin@apple.com>
2841
2842         Reviewed by Anders.
2843
2844         - http://bugs.webkit.org/show_bug.cgi?id=17640
2845           eliminate WebCoreFrameBridge
2846
2847         * WebCore.base.exp: Added more exports, needed by code moved from WebCoreFrameBridge
2848         to WebFrame in WebKit.
2849         * WebCore.xcodeproj/project.pbxproj: Added more headers, same reason. Also deleted
2850         WebCoreFrameBridge.h and WebCoreFrameBridge.mm.
2851
2852         * page/Frame.cpp:
2853         (WebCore::Frame::Frame): Added call to initJavaJSBindings(), formerly handled by
2854         the WebCoreFrameBridge.
2855         * page/Frame.h: Added initJavaJSBindings function.
2856
2857         * page/mac/FrameMac.mm:
2858         (WebCore::updateRenderingForBindings): Moved here from WebCoreFrameBridge.
2859         (WebCore::Frame::initJavaJSBindings): Ditto; code was in the init function.
2860
2861         * page/mac/WebCoreFrameBridge.h: Removed.
2862         * page/mac/WebCoreFrameBridge.mm: Removed.
2863
2864 2008-03-12  Sam Weinig  <sam@webkit.org>
2865
2866         Reviewed by Anders Carlsson.
2867
2868         Don't go through the Document just to get the frame Element.
2869
2870         * page/DOMWindow.cpp:
2871         (WebCore::DOMWindow::frameElement):
2872
2873 2008-03-12  Anders Carlsson  <andersca@apple.com>
2874
2875         Reviewed by Geoff and Sam.
2876
2877         More Instance cleanup:
2878         
2879         * Make Instance inherit from RefCounted instead of doing its own refcounting.        
2880         * Make all Instance subclasses private, add static create methods.         
2881         * Have Instance start out with a refcount of 1.
2882         * Get rid of Instance::createBindingForLanguageInstance and call the individual 
2883           instance constructor methods instead.
2884         * Fix many methods to take and return PassRefPtr<Instance> to ensure that the
2885           refcounting is done correctly.
2886          
2887         * bridge/c/c_instance.h:
2888         (KJS::Bindings::CInstance::create):
2889         * bridge/c/c_utility.cpp:
2890         (KJS::Bindings::convertNPVariantToValue):
2891         * bridge/jni/jni_instance.cpp:
2892         (JavaInstance::invokeMethod):
2893         * bridge/jni/jni_instance.h:
2894         (KJS::Bindings::JavaInstance::create):
2895         * bridge/jni/jni_jsobject.cpp:
2896         (JavaJSObject::convertJObjectToValue):
2897         * bridge/jni/jni_runtime.cpp:
2898         (JavaField::valueFromInstance):
2899         (JavaArray::valueAt):
2900         * bridge/objc/objc_instance.h:
2901         (KJS::Bindings::ObjcInstance::create):
2902         * bridge/objc/objc_utility.mm:
2903         (KJS::Bindings::convertObjcValueToValue):
2904         * bridge/qt/qt_instance.cpp:
2905         (KJS::Bindings::QtRuntimeObjectImp::QtRuntimeObjectImp):
2906         (KJS::Bindings::QtInstance::getQtInstance):
2907         (KJS::Bindings::QtInstance::getRuntimeObject):
2908         * bridge/qt/qt_instance.h:
2909         * bridge/runtime.cpp:
2910         (KJS::Bindings::Instance::Instance):
2911         (KJS::Bindings::Instance::createRuntimeObject):
2912         * bridge/runtime.h:
2913         * bridge/runtime_object.cpp:
2914         (RuntimeObjectImp::RuntimeObjectImp):
2915         * bridge/runtime_object.h:
2916         * page/Frame.h:
2917         * page/mac/FrameMac.mm:
2918         (WebCore::Frame::createScriptInstanceForWidget):
2919         * page/win/FrameWin.cpp:
2920         (WebCore::Frame::createScriptInstanceForWidget):
2921         * plugins/PluginView.h:
2922         * plugins/win/PluginViewWin.cpp:
2923         (WebCore::PluginView::bindingInstance):
2924
2925 2008-03-12  Dan Bernstein  <mitz@apple.com>
2926
2927         Suggested by Darin Adler. Reviewed by Dave Hyatt.
2928
2929         - speed up BidiIterator::direction()
2930
2931         * rendering/bidi.cpp:
2932         (WebCore::BidiIterator::current): Made inline and corrected the
2933         out-of-bounds condition to work with 0-length text and offsets beyond
2934         the end of the text.
2935         (WebCore::BidiIterator::direction): Changed to call current() and not
2936         call the virtual method isListMarker() most of the time.
2937         (WebCore::addMidpoint): Removed unnecessary null-check of smidpoints.
2938         (WebCore::appendRunsForObject): Ditto.
2939
2940 2008-03-12  Adam Roben  <aroben@apple.com>
2941
2942         Make URLs not be underlined while editing them in the DOM view
2943
2944         Reviewed by Tim.
2945
2946         * page/inspector/inspector.css:
2947
2948 2008-03-12  Adam Roben  <aroben@apple.com>
2949
2950         Part of Bug 17224: DOM nodes/attributes should be editable
2951
2952         <http://bugs.webkit.org/show_bug.cgi?id=17224>
2953         <rdar://problem/5732825>
2954
2955         We now start editing if the user single-clicks on an attribute,
2956         attribute value, or text node while the parent element is selected.
2957         Previously, we started editing on double-click regardless of the
2958         selection state of the element.
2959
2960         URLs in the DOM tree are now followed on Alt/Option-click, rather than
2961         on just click.
2962
2963         Reviewed by Tim.
2964
2965         * English.lproj/InspectorLocalizedStrings.js: Added four new localized
2966         strings.
2967         * page/inspector/DocumentPanel.js:
2968         (WebInspector.DOMNodeTreeElement.onattach): Call new
2969         _makeURLSActivateOnModifiedClick.
2970         (WebInspector.DOMNodeTreeElement._makeURLsActivateOnModifiedClick):
2971         Added. Changes the tooltip of each link in this element to indicate
2972         that Alt/Option-click will follow the URL, and sets the
2973         followOnAltClick property on each link.
2974         (WebInspector.DOMNodeTreeElement.onselect): Mark that we're being
2975         selected.
2976         (WebInspector.DOMNodeTreeElement.onmousedown): If we're not currently
2977         being selected, start editing.
2978         (WebInspector.DOMNodeTreeElement.ondblclick): We no longer start
2979         editing here. We block re-rooting of the tree if we're currently
2980         editing.
2981         (WebInspector.DOMNodeTreeElement._startEditing):
2982           - Don't do anything if we're not focused
2983           - Pass the event down to _startEditingAttribute.
2984         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Don't do
2985         anything if the event target is a URL and the Alt/Option key is
2986         pressed -- in this case we want to follow the link.
2987         (WebInspector.DOMNodeTreeElement._updateTitle): Call
2988         _makeURLsActivateOnClick again since the anchor elements have all been
2989         recreated.
2990         * page/inspector/inspector.js:
2991         (WebInspector.documentClick): If the anchor as a followOnAltClick
2992         property and the Alt/Option key is not pressed, do nothing.
2993
2994 2008-03-12  Ada Chan  <adachan@apple.com>
2995
2996         Fixed the initial value of zoom factor.
2997
2998         Reviewed by Adam.
2999
3000         * page/Frame.cpp:
3001         (WebCore::FramePrivate::FramePrivate):
3002
3003 2008-03-12  David Hyatt  <hyatt@apple.com>
3004
3005         Make full page zoom vaguely work.  This patch uses the CSS transform system to turn on full page zoom at the
3006         document level.  There are many many bugs that I'm going to file to track all the issues (most of the issues
3007         are just bugs with transforms themselves).
3008
3009         Reviewed by Adam Roben
3010
3011         * css/CSSStyleSelector.cpp:
3012         (WebCore::CSSStyleSelector::applyProperty):
3013         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
3014         * dom/Document.cpp:
3015         (WebCore::Document::recalcStyle):
3016         * page/Frame.cpp:
3017         (WebCore::Frame::shouldApplyTextZoom):
3018         (WebCore::Frame::shouldApplyPageZoom):
3019         * page/Frame.h:
3020         * rendering/RenderLayer.cpp:
3021         (WebCore::RenderLayer::updateLayerPositions):
3022         (WebCore::RenderLayer::setHasVisibleContent):
3023         (WebCore::RenderLayer::paintLayer):
3024         (WebCore::RenderLayer::hitTestLayer):
3025         * rendering/RenderLayer.h:
3026
3027 2008-03-12  David Hyatt  <hyatt@apple.com>
3028
3029         Make the zoom factor a float and not a percent.
3030
3031         Reviewed by antti
3032
3033         * WebCore.base.exp:
3034         * css/CSSStyleSelector.cpp:
3035         (WebCore::CSSStyleSelector::applyProperty):
3036         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
3037         * page/Frame.cpp:
3038         (WebCore::Frame::zoomFactor):
3039         (WebCore::Frame::setZoomFactor):
3040         * page/Frame.h:
3041         * page/FramePrivate.h:
3042         * svg/SVGSVGElement.cpp:
3043         (WebCore::SVGSVGElement::currentScale):
3044         (WebCore::SVGSVGElement::setCurrentScale):
3045
3046 2008-03-12  David Hyatt  <hyatt@apple.com>
3047
3048         Eliminate setTextMultiplier from the bridge.  Make Webkit just call setZoomFactor on the frame directly.
3049
3050         Reviewed by Tim H.
3051
3052         * WebCore.base.exp:
3053         * page/mac/WebCoreFrameBridge.h:
3054         * page/mac/WebCoreFrameBridge.mm:
3055
3056 2008-03-12  Dan Bernstein  <mitz@apple.com>
3057
3058         Reviewed by Darin Adler and Sam Weinig.
3059
3060         - <rdar://problem/4433248> use CoreText API instead of SPI on Leopard
3061
3062         Use CTFontCopyGraphicsFont and CTFontGetPlatformFont on Leopard instead
3063         of wkGetCGFontFromNSFont and wkGetNSFontATSUFontId, relying on NSFont
3064         and CTFontRef being toll-free bridged.
3065
3066         * WebCore.Tiger.exp:
3067         * WebCore.base.exp:
3068         * platform/graphics/mac/FontMac.mm:
3069         (WebCore::Font::drawGlyphs): Changed to use the cgFont() accessor.
3070         * platform/graphics/mac/FontPlatformData.h:
3071         Made m_cgFont a RetainPtr on Leopard.
3072         (WebCore::toCTFontRef): Added a function that encapsulates the
3073         toll-free bridging.
3074         (WebCore::FontPlatformData::FontPlatformData):
3075         (WebCore::FontPlatformData::cgFont): Added this accessor method.
3076         * platform/graphics/mac/FontPlatformDataMac.mm:
3077         (WebCore::FontPlatformData::FontPlatformData): Changed to use
3078         CoreText API on Leopard.
3079         (WebCore::FontPlatformData::setFont): Ditto.
3080         * platform/graphics/mac/SimpleFontDataMac.mm:
3081         (WebCore::initFontData):
3082         (WebCore::pathFromFont):
3083         (WebCore::SimpleFontData::platformInit):
3084         (WebCore::SimpleFontData::platformWidthForGlyph):
3085         * platform/mac/WebCoreSystemInterface.mm:
3086
3087 2008-03-12  David Harrison  <harrison@apple.com>
3088
3089         Reviewed by Darin.
3090
3091         <rdar://problem/5607382> CrashTracer: [REGRESSION] 2290 crashes in Safari at com.apple.WebCore: -[WebCoreAXObject isWebArea] + 8
3092
3093         The problem was that we lost track of the AX cache for a subframe when Frame::disconnectOwnerElement() was
3094         called, so we were unable to locate the AXObjects to de-register from AppKit's accessibility registry.
3095         Also saw that cache clearing was missing from Document::detach(), and fixed that.
3096         
3097         Also added a debug-only check that AXObjectCache::remove() not finding the AXObject is expected.
3098         
3099         Lastly, RenderWidget::destroy() now skips trying to remove the AXObject if accessibility has never been enabled.
3100        
3101         * dom/Document.cpp:
3102         (WebCore::Document::attach):
3103         Assert that there is no AX cache (since there is no renderer).
3104         
3105         (WebCore::Document::detach):
3106         Destroy the AX cache installed on this document.
3107         
3108         (WebCore::Document::clearAXObjectCache):
3109         New. Destroy the AX cache associated with this document.
3110         
3111         (WebCore::Document::axObjectCache):
3112         Added some comments.
3113         
3114         * dom/Document.h:
3115         Declare clearAXObjectCache().
3116         
3117         * page/Frame.cpp:
3118         (WebCore::Frame::disconnectOwnerElement):
3119         Destroy the AX cache associated with this frame's document.
3120         
3121         * page/mac/AXObjectCacheMac.mm:
3122         (WebCore::AXObjectCache::remove):        
3123         * page/mac/WebCoreAXObject.mm:
3124         (-[WebCoreAXObject initWithRenderer:]):
3125         (-[WebCoreAXObject detach]):
3126         * rendering/RenderObject.cpp:
3127         (WebCore::RenderObject::RenderObject):
3128         (WebCore::RenderObject::~RenderObject):
3129         * rendering/RenderObject.h:
3130         (WebCore::RenderObject::setHasAXObject):
3131         (WebCore::RenderObject::hasAXObject):
3132         Add debug-only check that AXObjectCache::remove() not finding the AXObject is expected.
3133         
3134         * rendering/RenderWidget.cpp:
3135         (WebCore::RenderWidget::destroy):
3136         Skip call to remove the AXObject if accessibility has never been enabled. A simple speed optimization in the
3137         very common case that the accessibility APIs are not being used. Same as in RenderObject::destroy().
3138
3139 2008-03-12  Xan Lopez  <xan@gnome.org>
3140
3141         Reviewed by Alp Toker.
3142
3143         http://bugs.webkit.org/show_bug.cgi?id=15229
3144
3145         Add Pango font backend.
3146
3147         Original patch by Sven Herzberg <sven@imendio.com>
3148
3149         * GNUmakefile.am:
3150         * platform/graphics/gtk/FontCacheGtk.cpp:
3151         (WebCore::FontCache::fontExists):
3152         * platform/graphics/gtk/FontCustomPlatformDataPango.cpp: Added.
3153         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
3154         (WebCore::FontCustomPlatformData::fontPlatformData):
3155         (WebCore::releaseData):
3156         (WebCore::createFontCustomPlatformData):
3157         * platform/graphics/gtk/FontPlatformData.h:
3158         (WebCore::FontPlatformData::FontPlatformData):
3159         (WebCore::FontPlatformData::hash):
3160         * platform/graphics/gtk/FontPlatformDataPango.cpp: Added.
3161         (WebCore::FontPlatformData::FontPlatformData):
3162         (WebCore::FontPlatformData::init):
3163         (WebCore::FontPlatformData::~FontPlatformData):
3164         (WebCore::FontPlatformData::isFixedPitch):
3165         (WebCore::FontPlatformData::setFont):
3166         (WebCore::FontPlatformData::operator==):
3167         * platform/graphics/gtk/GlyphPageTreeNodePango.cpp: Added.
3168         (WebCore::pango_font_get_glyph):
3169         (WebCore::GlyphPage::fill):
3170         * platform/graphics/gtk/SimpleFontDataPango.cpp: Added.
3171         (WebCore::SimpleFontData::platformInit):
3172         (WebCore::SimpleFontData::platformDestroy):
3173         (WebCore::SimpleFontData::smallCapsFontData):
3174         (WebCore::SimpleFontData::containsCharacters):
3175         (WebCore::SimpleFontData::determinePitch):
3176         (WebCore::SimpleFontData::platformWidthForGlyph):
3177         (WebCore::SimpleFontData::setFont):
3178
3179 2008-03-12  Justin Garcia  <justin.garcia@apple.com>
3180
3181         Reviewed by Oliver.
3182         
3183         <rdar://problem/5770834> Crash at InsertTextCommand::prepareForTextInsertion() doing RemoveFormat in a certain list
3184         
3185         Fixes some (but not all) of the instances of:
3186         <rdar://problem/5659795> CrashTracer: [REGRESSION] 187 crashes in Safari at com.apple.WebCore: WebCore::InsertTextCommand::prepareForTextInsertion + 241
3187         <rdar://problem/5779631> CrashTracer: [USER] 25 crashes in Mail at WebCore::InsertTextCommand::prepareForTextInsertion
3188
3189         * editing/InsertLineBreakCommand.cpp:
3190         (WebCore::InsertLineBreakCommand::doApply): applyStyle may have destroyed content that held
3191         the old endingSelection(), so we must recompute it.  Added a FIXME.  Added a few comments.
3192         * editing/RemoveFormatCommand.cpp:
3193         (WebCore::RemoveFormatCommand::doApply): Added a FIXME.
3194
3195 2008-03-11  Alexey Proskuryakov  <ap@webkit.org>
3196
3197         Reviewed by Darin.
3198
3199         <rdar://problem/5640615> REGRESSION (Safari 2-3): Changing subframe encoding rules broke
3200         some sites.
3201
3202         Other browsers' behavior keeps changing; let's implement what Firefox and Opera do now:
3203         if the frame and subframe belong to the same site, then the encoding is inherited from parent
3204         frame to subframe. Otherwise, it is not.
3205
3206         Always inheriting the encoding would cause a security problem.
3207
3208         Tests: http/tests/misc/frame-default-enc-different-domain.html
3209                http/tests/misc/frame-default-enc-same-domain.html
3210                fast/encoding/frame-default-enc.html
3211
3212         * loader/FrameLoader.cpp:
3213         (WebCore::FrameLoader::write): Also removed a check for m_frame->document() being non-null -
3214         this function also has code that uses it without checking, so it must be safe.
3215
3216 2008-03-12  Mark Rowe  <mrowe@apple.com>
3217
3218         Gtk build fix.
3219
3220         * page/Frame.h: Forward-declare FramePrivate.
3221
3222 2008-03-11  Steve Falkenburg  <sfalken@apple.com>
3223
3224         Disable LTCG/PGO for all of WebCore for now.
3225         We'll re-enable this as part of follow-on PGO work.
3226         
3227         Reviewed by Oliver.
3228
3229         * WebCore.vcproj/WebCore.vcproj:
3230
3231 2008-03-11  Darin Adler  <darin@apple.com>
3232
3233         Reviewed by Sam.
3234
3235         - remove all bridge-related things from WebCore except the bridge itself
3236
3237         * WebCore.base.exp: Removed the bridge and setBridge functions.
3238
3239         * loader/FrameLoader.cpp:
3240         (WebCore::FrameLoader::detachFromParent): Removed call to the bridge's
3241         close method.
3242
3243         * page/Frame.cpp:
3244         (WebCore::Frame::~Frame): Removed call to setBridge(0).
3245         (WebCore::FramePrivate::FramePrivate): Removed initialization of m_bridge.
3246         * page/Frame.h: Removed setBridge and bridge functions.
3247         * page/FramePrivate.h: Removed m_bridge pointer.
3248         * page/mac/FrameMac.mm: Removed setBridge and bridge functions.
3249
3250         * page/mac/WebCoreFrameBridge.h: Added setWebCoreFrame: method.
3251         Removed bridgeForDOMDocument: and clearFrame methods.
3252         * page/mac/WebCoreFrameBridge.mm: Ditto.
3253         (-[WebCoreFrameBridge close]): Changed to set m_frame to 0 directly.
3254         (-[WebCoreFrameBridge setWebCoreFrame:]): Added.
3255
3256 2008-03-11  Darin Adler  <darin@apple.com>
3257
3258         - restored some code I removed in the Range change; this code can't go
3259           until the rest of the Range fix is in
3260
3261         * dom/Range.cpp:
3262         (WebCore::Range::commonAncestorContainer): Added back the check for 0
3263         that I removed erroneously in the Range patch.
3264         (WebCore::Range::processContents): Left in assertions I used to debug
3265         this.
3266
3267 2008-03-11  Darin Adler  <darin@apple.com>
3268
3269         - fix Release build
3270
3271         * platform/mac/ScrollViewMac.mm:
3272         (WebCore::ScrollView::setContentsPos): Don't use NSMakePoint.
3273
3274 2008-03-11  Darin Adler  <darin@apple.com>
3275
3276         Reviewed by Anders.
3277
3278         - simplify Mac code for ScrollView, since it's used only for FrameView
3279           and not in two different modes like it was historically
3280         - remove code depending on the bridge to get from an NSView to a WebCore::Frame
3281
3282         * bindings/objc/DOMHTML.mm:
3283         (-[DOMHTMLInputElement _rectOnScreen]): getDocumentView -> documentView.
3284
3285         * bridge/jni/jni_jsobject.cpp:
3286         (createRootObject): Instead of using WebCoreViewFactory to find the frame given
3287         and NSView, use the WebCoreFrameView interface to do it.
3288
3289         * editing/mac/EditorMac.mm:
3290         (WebCore::Editor::paste): getDocumentView -> documentView.
3291         * editing/mac/SelectionControllerMac.mm:
3292         (WebCore::SelectionController::notifyAccessibilityForSelectionChange): Ditto.
3293
3294         * page/FrameView.h: Fixed comment.
3295
3296         * page/InspectorController.cpp:
3297         (WebCore::InspectorController::drawNodeHighlight): Removed uneeded typecasts
3298         to ScrollView* since FrameView is derived from ScrollView.
3299
3300         * page/mac/EventHandlerMac.mm:
3301         (WebCore::EventHandler::focusDocumentView): getDocumentView -> documentView.
3302         * page/mac/FrameMac.mm:
3303         (WebCore::Frame::imageFromRect): Ditto.
3304         * page/mac/WebCoreAXObject.mm:
3305         (-[WebCoreAXObject position]): Ditto.
3306         (-[WebCoreAXObject doAXTextMarkerForPosition:]): Ditto.
3307         (-[WebCoreAXObject rendererForView:]): Updated code that used to use
3308         WebCoreBridgeHolder to use WebCoreFrameView instead.
3309
3310         * page/mac/WebCoreFrameBridge.mm:
3311         (-[WebCoreFrameBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
3312         getDocumentView -> documentView.
3313
3314         * page/mac/WebCoreFrameView.h: Removed the WebCoreScrollbarMode type; we just
3315         use WebCore::ScrollbarMode directly. Renamed the WebCoreFrameView protocol to
3316         WebCoreFrameScrollView, since it's a protocol for the scroll view, not the
3317         frame view itself. Replaced WebCoreBridgeHolder protocol with WebCoreFrameView
3318         protocol, which returns a WebCore::Frame directly rather than a bridge.
3319
3320         * page/mac/WebCoreViewFactory.h: Eliminated the bridgeForView method.
3321
3322         * platform/ScrollView.h: Moved the constructor and destructor out of the
3323         class-specific #if blocks. Renamed Mac-specific function that gets the
3324         NSView for from getDocumentView to documentView and a scrollView function
3325         that returns an appropriately classed NSScrollView.
3326
3327         * platform/graphics/MediaPlayer.h: Changed type of parentWidget to FrameView
3328         instead of Widget.
3329         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3330         (WebCore::MediaPlayerPrivate::createQTMovieView): Removed unnecessary cast.
3331
3332         * platform/mac/PopupMenuMac.mm:
3333         (WebCore::PopupMenu::show): getDocumentView -> documentView.
3334         * platform/mac/ScrollViewMac.mm:
3335         (WebCore::ScrollView::ScrollView): Added.
3336         (WebCore::ScrollView::~ScrollView): Added.
3337         (WebCore::ScrollView::scrollView): Added.
3338         (WebCore::ScrollView::visibleWidth): Removed unused non-NSScrollView case.
3339         (WebCore::ScrollView::visibleHeight): Ditto.
3340         (WebCore::ScrollView::visibleContentRect): Ditto.
3341         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers): Ditto.
3342         (WebCore::ScrollView::contentsWidth): Ditto.
3343         (WebCore::ScrollView::contentsHeight): Ditto.
3344         (WebCore::ScrollView::contentsX): Ditto.
3345         (WebCore::ScrollView::contentsY): Ditto.
3346         (WebCore::ScrollView::scrollOffset): Ditto.
3347         (WebCore::ScrollView::scrollRectIntoViewRecursively): Ditto.
3348         (WebCore::ScrollView::setContentsPos): Ditto.
3349         (WebCore::ScrollView::setVScrollbarMode): Ditto.
3350         (WebCore::ScrollView::setHScrollbarMode): Ditto.
3351         (WebCore::ScrollView::setScrollbarsMode): Ditto.
3352         (WebCore::ScrollView::vScrollbarMode): Ditto.
3353         (WebCore::ScrollView::hScrollbarMode): Ditto.
3354         (WebCore::ScrollView::suppressScrollbars): Ditto.
3355         (WebCore::ScrollView::addChild): Ditto.
3356         (WebCore::ScrollView::resizeContents): Ditto.
3357         (WebCore::ScrollView::updateContents): Ditto.
3358         (WebCore::ScrollView::contentsToWindow): Ditto.
3359         (WebCore::ScrollView::windowToContents): Ditto.
3360         (WebCore::ScrollView::setStaticBackground): Ditto.
3361         (WebCore::ScrollView::documentView): Renamed and removed unused case.
3362         (WebCore::ScrollView::scrollbarUnderMouse): Removed incorrect comment.
3363
3364         * platform/mac/WidgetMac.mm:
3365         (WebCore::Widget::getOuterView): Update for protocol name change.
3366
3367         * rendering/RenderThemeMac.mm:
3368         (WebCore::RenderThemeMac::paintCheckbox): getDocumentView -> documentView.
3369         (WebCore::RenderThemeMac::paintRadio): Ditto.
3370         (WebCore::RenderThemeMac::paintButton): Ditto.
3371         (WebCore::RenderThemeMac::paintMenuList): Ditto.
3372         (WebCore::RenderThemeMac::paintSliderThumb): Ditto.
3373         (WebCore::RenderThemeMac::paintSearchField): Ditto.
3374         (WebCore::RenderThemeMac::paintSearchFieldCancelButton): Ditto.
3375         (WebCore::RenderThemeMac::paintSearchFieldResultsDecoration): Ditto.
3376         (WebCore::RenderThemeMac::paintSearchFieldResultsButton): Ditto.
3377
3378 2008-03-11  Brent Fulgham  <bfulgham@gmail.com>
3379
3380         Reviewed by Adam Roben.
3381
3382         Split CookieJarWin.cpp into CFNet and non-CFNet versions to
3383         reduce the massive amount of conditionalization in the file.
3384         (see http://bugs.webkit.org/show_bug.cgi?id=17788)
3385
3386         * WebCore.vcproj/WebCore.vcproj:
3387         * platform/network/win/CookieJarCFNetWin.cpp: Copied from WebCore/platform/network/win/CookieJarWin.cpp.
3388         (WebCore::setCookies):
3389         (WebCore::cookies):
3390         (WebCore::cookiesEnabled):
3391         * platform/network/win/CookieJarWin.cpp:
3392         (WebCore::setCookies):
3393         (WebCore::cookies):
3394         (WebCore::cookiesEnabled):
3395
3396 2008-03-11  Darin Adler  <darin@apple.com>
3397
3398         Reviewed by Sam.
3399
3400         - eliminate the remaining parts of WebCoreBridge used for calls to WebKit from WebCore
3401
3402         * page/ChromeClient.h: Added new client functions to replace calls up to WebKit
3403         that were formerly handled by the bridge.
3404
3405         * page/Frame.h: Removed unneeded declarations. Moved declarations of script-specific
3406         functions to a ScriptController section. Removed willPopupMenu.
3407
3408         * page/mac/ChromeMac.mm:
3409         (WebCore::Chrome::focusNSView): Changed to call firstResponder and makeFirstResponder
3410         via the client instead of the bridge.
3411
3412         * page/mac/EventHandlerMac.mm:
3413         (WebCore::EventHandler::passMouseDownEventToWidget): Changed to call firstResponder
3414         and makeFirstResponder via the chrome client instead of the bridge.
3415
3416         * page/mac/FrameMac.mm: Removed willPopupMenu.
3417
3418         * page/mac/WebCoreFrameBridge.h: Removed WebCoreFrameBridge protocol and
3419         SubclassResponsibility category. Also removed some unneeded imports.
3420
3421         * platform/mac/PopupMenuMac.mm:
3422         (WebCore::PopupMenu::show): Call willPopUpMenu on chrome client instead of frame.
3423
3424         * platform/mac/WidgetMac.mm:
3425         (WebCore::Widget::setIsSelected): Call functions directly on the view rather than
3426         calling via the bridge.
3427
3428 2008-03-11  Darin Adler  <darin@apple.com>
3429
3430         Reviewed by Mitz.
3431
3432         - make some Range improvements (preparation for Range support for DOM mutation)
3433
3434         Made constructors private, added create functions.
3435         Made refcount start at 1 rather than starting at 0 and being incremented.
3436         Made Range use two Position objects for the start/end container/offset pairs.
3437
3438         * WebCore.base.exp: Updated.
3439
3440         * dom/Document.cpp:
3441         (WebCore::Document::createRange): Changed to use Range::create.
3442         (WebCore::Document::removeMarkers): Updated for Range::first/pastLastNode name change.
3443
3444         * dom/Position.cpp:
3445         (WebCore::Position::formatForDebugger): Updated for member variable name change.
3446         (WebCore::Position::showTreeForThis): Ditto.
3447         (WebCore::startPosition): Changed to use Range::startPosition.
3448         (WebCore::endPosition): Changed to use Range::endPosition.
3449
3450         * dom/Position.h: Made the data members public and renamed them to container
3451         and offset. But since offset() is already a function, temporarily used posOffset
3452         for the data member. Later we'll get rid of offset(). Made more functions inline.
3453         Removed the constructor that takes a PositionIterator.
3454
3455         * dom/PositionIterator.cpp:
3456         (WebCore::PositionIterator::operator Position): Added. Replaces the constructor
3457         that used to be in Position.
3458         * dom/PositionIterator.h: Added conversion operator to produce a Position.
3459         Removed friend declaration for Position.
3460
3461         * dom/Range.cpp:
3462         (WebCore::Range::Range): Updated constructors for data member changes and made
3463         them use a refcount of 1.
3464         (WebCore::Range::create): Added.
3465         (WebCore::Range::startContainer): Updated to eliminate use of m_detached; detached
3466         is now indicated by m_start.container of 0. Also updated to use m_start instead
3467         of the old m_startContainer.
3468         (WebCore::Range::startOffset): Ditto.
3469         (WebCore::Range::endContainer): Ditto.
3470         (WebCore::Range::endOffset): Ditto.
3471         (WebCore::Range::commonAncestorContainer): Ditto.
3472         (WebCore::Range::collapsed): Ditto.
3473         (WebCore::Range::setStart): Ditto.
3474         (WebCore::Range::setEnd): Ditto.
3475         (WebCore::Range::collapse): Ditto.
3476         (WebCore::Range::isPointInRange): Ditto.
3477         (WebCore::Range::comparePoint): Ditto.
3478         (WebCore::Range::compareNode): Ditto.
3479         (WebCore::Range::compareBoundaryPoints): Ditto.
3480         (WebCore::Range::boundaryPointsValid): Ditto.
3481         (WebCore::Range::deleteContents): Ditto.
3482         (WebCore::Range::intersectsNode): Ditto.
3483         (WebCore::Range::processContents): Ditto.
3484         (WebCore::Range::extractContents): Ditto.
3485         (WebCore::Range::cloneContents): Ditto.
3486         (WebCore::Range::insertNode): Ditto.
3487         (WebCore::Range::toString): Ditto.
3488         (WebCore::Range::text): Ditto.
3489         (WebCore::Range::createContextualFragment): Ditto.
3490         (WebCore::Range::detach): Ditto.
3491         (WebCore::Range::checkNodeBA): Changed to use switch statements instead of
3492         multiple calls to the virtual nodeType() function.
3493         (WebCore::Range::cloneRange): Ditto.
3494         (WebCore::Range::setStartAfter): Ditto.
3495         (WebCore::Range::setEndBefore): Ditto.
3496         (WebCore::Range::setEndAfter): Ditto.
3497         (WebCore::Range::selectNode): Ditto.
3498         (WebCore::Range::selectNodeContents): Ditto.
3499         (WebCore::Range::surroundContents): Ditto.
3500         (WebCore::Range::setStartBefore): Ditto.
3501         (WebCore::Range::checkDeleteExtract): Ditto.
3502         (WebCore::Range::containedByReadOnly): Ditto.
3503         (WebCore::Range::firstNode): Ditto.
3504         (WebCore::Range::editingStartPosition): Ditto.
3505         (WebCore::Range::pastLastNode): Ditto.
3506         (WebCore::Range::addLineBoxRects): Ditto.
3507         (WebCore::Range::formatForDebugger): Ditto.
3508         (WebCore::operator==): Ditto.
3509         (WebCore::rangeOfContents): Ditto.
3510         (WebCore::Range::maxStartOffset): Ditto.
3511         (WebCore::Range::maxEndOffset): Ditto.
3512
3513         * dom/Range.h: Made constructors private. Added create functions.
3514         Added getters for startContainer/Offset and endContainer/Offset that
3515         return 0 instead of an exception for detached ranges that are inline
3516         and don't require an ExceptionCode out parameter. Changed the parameters
3517         to setStart and setEnd to PassRefPtr. Removed isDetached function.
3518         Made ActionType and processContents private. Made startPosition and
3519         endPosition inlines and have then return const&. Renamed startNode and
3520         pastEndNode to firstNode and pastLastNode to reduce the chance of
3521         confusion with startContainer/endContainer. Used Position for m_start
3522         and m_end instead of separate container and offset members. Changed
3523         maxStartOffset and maxEndOffset into int to match other offsets.
3524
3525         * editing/ApplyStyleCommand.cpp:
3526         (WebCore::ApplyStyleCommand::applyBlockStyle): Changed to use Range::create.
3527         (WebCore::ApplyStyleCommand::applyInlineStyle): Ditto.
3528         * editing/CompositeEditCommand.cpp:
3529         (WebCore::CompositeEditCommand::inputText): Ditto.
3530         (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
3531         * editing/DeleteSelectionCommand.cpp:
3532         (WebCore::DeleteSelectionCommand::mergeParagraphs): Ditto.
3533         * editing/Editor.cpp:
3534         (WebCore::Editor::fontForSelection): Changed for pastLastNode name change.
3535         (WebCore::Editor::setComposition): Changed to use Range::create.
3536         (WebCore::paragraphAlignedRangeForRange): Ditto.
3537         (WebCore::markMisspellingsOrBadGrammar): Changed to get rid of check for
3538         isDetached and check for 0 from startContainer instead.
3539         (WebCore::Editor::compositionRange): Changed to use Range::create.
3540         * editing/EditorCommand.cpp:
3541         (WebCore::unionDOMRanges): Ditto.
3542         * editing/Selection.cpp:
3543         (WebCore::Selection::toRange): Ditto.
3544         * editing/TextIterator.cpp:
3545         (WebCore::TextIterator::TextIterator): Changed for firstNode and