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