Fix for bug 13274. Rework mouse events so that subframe capturing works...
[WebKit-https.git] / WebCore / ChangeLog
1 2007-04-06  David Hyatt  <hyatt@apple.com>
2
3         Fix for bug 13274.  Rework mouse events so that subframe capturing works again.  Make sure
4         everything just comes down through the top FrameView even when capturing is in effect.  Update
5         scrollbar handling logic so that scrollbars receive events correctly while capturing is in
6         effect.  Eliminate the notion of widget capture.  Fix mouse moves so that they only fire
7         on the innermost hit frame.
8
9         Reviewed by olliej
10
11         * page/EventHandler.cpp:
12         (WebCore::EventHandler::handleMouseDraggedEvent):
13         (WebCore::subframeForTargetNode):
14         (WebCore::EventHandler::handleMousePressEvent):
15         (WebCore::EventHandler::handleMouseMoveEvent):
16         (WebCore::EventHandler::handleMouseReleaseEvent):
17         * page/EventHandler.h:
18         * platform/PopupMenu.h:
19         (WebCore::PopupMenu::scrollbarCapturingMouse):
20         (WebCore::PopupMenu::setScrollbarCapturingMouse):
21         * platform/ScrollBar.h:
22         (WebCore::Scrollbar::handleMouseReleaseEvent):
23         * platform/Widget.h:
24         (WebCore::Widget::geometryChanged):
25
26 2007-04-06  Justin Garcia  <justin.garcia@apple.com>
27
28         Reviewed by john
29
30         <rdar://problem/5115601> 
31         REGRESSION: Crash deleting a selection that starts in an editable table cell
32         
33         The selection starts at the start of an editable 
34         root that's embedded in a non-editable ToDo (table).  
35         Removing the selection removes all editable 
36         VisiblePositions from the root.  Then, the creation 
37         of mergeDestination fails, and using it causes a crash.
38
39         * editing/DeleteSelectionCommand.cpp:
40         (WebCore::DeleteSelectionCommand::mergeParagraphs):
41         Nil-check mergeDestination to avoid crashing and
42         also insert a break in that case at m_upstreamStart, 
43         so that we can create a valid mergeDestination and
44         perform the merge.
45         
46         
47 2007-04-06  Mitz Pettel  <mitz@webkit.org>
48
49         Reviewed by Oliver.
50
51         Eliminate PlatformMouseEvent::currentEvent.
52
53         No test possible (no change to functionality).
54
55         * page/EventHandler.cpp:
56         (WebCore::EventHandler::handleDrag):
57         * platform/PlatformMouseEvent.h:
58         * platform/gdk/TemporaryLinkStubs.cpp:
59         * platform/mac/PlatformMouseEventMac.mm:
60         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
61         * platform/qt/PlatformMouseEventQt.cpp:
62         * platform/win/TemporaryLinkStubs.cpp:
63
64 2007-04-05  Oliver Hunt  <oliver@apple.com>
65
66         Reviewed by Maciej.
67
68         Fix for rdar://problem/4849948 -- JSCanvasRenderingContext2D::drawImage
69         crashes when given invalid arguments.
70
71         JSCanvasRenderingContext2D frequently casts from JSValue* to JSObject*
72         and then checks isObject *after* the cast.  JSObject::isObject is unsafe 
73         if applied to a JSImmediate value (null, undefined, etc).  This patch 
74         corrects the logic in a number of places by performing the isObject check
75         before casting to JSObject.
76
77         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
78         (WebCore::JSCanvasRenderingContext2D::drawImage):
79         (WebCore::JSCanvasRenderingContext2D::drawImageFromRect):
80         (WebCore::JSCanvasRenderingContext2D::createPattern):
81
82 2007-04-05  Adele Peterson  <adele@apple.com>
83
84         Reviewed by Oliver.
85
86         Fix for <rdar://problem/4965597> REGRESSION: mouseup doesn't fire for slider (causes it to always default to max)
87
88         Test: fast/forms/slider-mouse-events.html
89
90         * page/EventHandler.cpp: (WebCore::EventHandler::dispatchMouseEvent):
91         Since the actual target node of the event can't be a shadow node, set the target node to the capturing node before adjusting it.
92
93 2007-04-05  Kevin McCullough  <kmccullough@apple.com>
94
95         Reviewed by Darin.
96
97         - Added reportLocalLoadFailed to FrameLoader to send an error to the console when
98         calls to canLoad fail. 
99
100         * loader/Cache.cpp:
101         (WebCore::Cache::requestResource):
102         * loader/FrameLoader.cpp:
103         (WebCore::FrameLoader::loadSubframe):
104         (WebCore::FrameLoader::loadPlugin):
105         (WebCore::FrameLoader::load):
106         (WebCore::FrameLoader::reportLocalLoadFailed):
107         * loader/FrameLoader.h:
108         * loader/SubresourceLoader.cpp:
109         (WebCore::SubresourceLoader::create):
110
111 2007-04-05  Adele Peterson  <adele@apple.com>
112
113         Reviewed by Maciej.
114
115         Add text-align: -webkit-auto for form controls.  Buttons already override this property to center their text.
116
117         * css/html4.css:
118
119 2007-04-05  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
120
121         Reviewed by rwlbuis.
122
123         Coverity fix. Coverity says:
124         "Event var_deref_model: Variable "page" tracked as NULL was passed to a function that dereferences it."
125
126         * platform/Font.cpp:
127         (WebCore::Font::glyphDataForCharacter):
128
129 2007-04-05  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
130
131         Reviewed by darin.
132
133         Coverity fix. Coverity says:
134         "Event var_deref_model: Variable "unicode" tracked as NULL was passed to a 
135         function that dereferences it."
136
137         * platform/DeprecatedString.cpp:
138         (WebCore::DeprecatedString::DeprecatedString):
139
140 2007-04-05  Adele Peterson  <adele@apple.com>
141
142         Reviewed by Hyatt.
143
144         Fix for <rdar://problem/5113593> REGRESSION: Search fields in RSS pages don't show ibeam cursor
145
146         * css/html4.css: Set the cursor values explicitly for input, textarea (to auto), & select (to default).
147
148 2007-04-05  David Hyatt  <hyatt@apple.com>
149
150         Fix for <rdar://problem/5078866> tables should only reset text-align
151         in quirks mode.
152
153         Reviewed by beth
154
155         * css/html4.css:
156         * css/quirks.css:
157
158 2007-04-05  Adele Peterson  <adele@apple.com>
159
160         Fixing typo that's crashing.
161
162         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
163           Use evt instead of null variable k.
164
165 2007-04-05  Adele Peterson  <adele@apple.com>
166
167         Reviewed by Hyatt.
168
169         Fix for <rdar://problem/5021500> Cursor should stay as pointer when slider is being dragged
170
171         Don't set the selection ibeam cursor when there's a node that's capturing mouse events.
172
173         * page/EventHandler.cpp:
174         (WebCore::selectCursor):
175         (WebCore::EventHandler::handleMouseMoveEvent):
176
177 2007-04-05  Geoffrey Garen  <ggaren@apple.com>
178
179         Reviewed by Beth Dakin.
180
181         More clean-up while fixing <rdar://problem/5112273> REGRESSION(TOT): 
182         Reproducible crash loading an old version of amazon.com as a web archive
183         
184         Layout tests pass.
185         
186         Removed more superfluous document NULL checks. (Node::document() never 
187         returns NULL, and it asserts as much.)
188         
189         Merged some duplicate editing code into a static inline function.
190         
191         * page/mac/WebCoreFrameBridge.mm:
192         (updateRenderingForBindings): Removed superfluous static_cast.
193
194 2007-04-05  Adele Peterson  <adele@apple.com>
195
196         Reviewed by Darin.
197
198         A little cleanup from my last checkin.  Always check if an Event is really a MouseEvent or a KeyboardEvent
199         before casting it.
200
201         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
202         * html/HTMLSelectElement.cpp:
203         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
204         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
205         * html/HTMLTextFieldInnerElement.cpp:
206         (WebCore::HTMLSearchFieldResultsButtonElement::defaultEventHandler):
207         (WebCore::HTMLSearchFieldCancelButtonElement::defaultEventHandler):
208         * ksvg2/svg/SVGAElement.cpp: (WebCore::SVGAElement::defaultEventHandler):
209         * page/ContextMenuController.cpp: (WebCore::ContextMenuController::handleContextMenuEvent):
210         * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::userResize):
211         * rendering/RenderSlider.cpp: (WebCore::HTMLSliderThumbElement::defaultEventHandler):
212
213 2007-04-05  Geoffrey Garen  <ggaren@apple.com>
214
215         Reviewed by Beth Dakin.
216         
217         Some clean-up while fixing <rdar://problem/5112273> REGRESSION(TOT): 
218         Reproducible crash loading an old version of amazon.com as a web archive
219         
220         Removed superfluous document NULL checks. (Node::document() never returns
221         NULL, and it asserts as much.)
222         
223         Removed duplicate implementation of displayString.
224         
225         Layout tests pass.
226
227         * bindings/objc/DOMInternal.h:
228         * bindings/objc/DOMInternal.mm:
229         * html/HTMLGenericFormElement.cpp:
230         (WebCore::HTMLGenericFormElement::supportsFocus):
231         * html/HTMLPlugInElement.cpp:
232         (WebCore::HTMLPlugInElement::createNPObject):
233         * platform/ContextMenu.cpp:
234         (WebCore::ContextMenu::checkOrEnableIfNeeded):
235         * rendering/HitTestResult.cpp:
236         (WebCore::displayString):
237         * rendering/HitTestResult.h:
238         * rendering/RenderLayer.cpp:
239         (WebCore::RenderLayer::updateHoverActiveState):
240
241 === Safari-5522.6 ===
242
243 2007-04-05  Oliver Hunt  <oliver@apple.com>
244
245         Reviewed by Adam.
246
247         Fix rdar://problem/5030934 -- landscape PDFs embedded as an image are cut off
248         also fixes scaling of pdf images
249
250         PDFDocumentImage was not accounting for page rotation in a number of places
251
252         * platform/graphics/cg/PDFDocumentImage.cpp:
253         (WebCore::PDFDocumentImage::size):
254           we need to account for rotation of the pdf image effecting our bounds
255         (WebCore::PDFDocumentImage::draw):
256           When compensating for flipped coords we need to use the correct rect for the 
257           coordinate space.  We can't pass size() to CGContextDrawPDFDocument as it
258           returns the rotated bounds now -- this is also save the old 
259           FloatSize -> IntSize -> FloatSize conversions.
260           
261
262 2007-04-04  Alexey Proskuryakov  <ap@webkit.org>
263
264         Reviewed by Darin.
265
266         http://bugs.webkit.org/show_bug.cgi?id=13278
267         REGRESSION: cannot change SELECT option
268
269         Test: fast/forms/option-change-single-selected.html
270
271         * html/HTMLSelectElement.cpp:
272         (WebCore::HTMLSelectElement::setSelectedIndex): If multiple selection is not allowed, 
273         be sure to deselect the previous option.
274
275 2007-04-04  Adele Peterson  <adele@apple.com>
276
277         Reviewed by Oliver.
278
279         Fix for <rdar://5105009> Prepare for fix to send mousedown and mouseup (but not click) events when right-clicking
280
281         * page/EventHandler.cpp: Don't ever send click events for right-clicks.
282         (WebCore::EventHandler::handleMouseDoubleClickEvent):
283         (WebCore::EventHandler::handleMouseReleaseEvent):
284         
285         Check that the mousedown and mouseup are not with the right button before performing default behavior.
286         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
287         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
288         * html/HTMLSelectElement.cpp:
289         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
290         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
291         * html/HTMLTextFieldInnerElement.cpp:
292         (WebCore::HTMLSearchFieldResultsButtonElement::defaultEventHandler):
293         (WebCore::HTMLSearchFieldCancelButtonElement::defaultEventHandler):
294         * ksvg2/svg/SVGAElement.cpp:(WebCore::SVGAElement::defaultEventHandler):
295         * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::userResize):
296         * rendering/RenderSlider.cpp: (WebCore::HTMLSliderThumbElement::defaultEventHandler):
297
298 2007-04-03  Justin Garcia  <justin.garcia@apple.com>
299
300         Reviewed by darin
301         
302         <rdar://problem/5026848> Can cut/delete ToDo subunits
303         
304         We were removing non-editable content during a delete.
305
306         * editing/DeleteSelectionCommand.cpp: 
307         (WebCore::DeleteSelectionCommand::initializePositionData): 
308         Set m_startRoot and m_endRoot.
309         (WebCore::DeleteSelectionCommand::removeNode): If a node
310         is not inside both the start and end roots, remove it only
311         if it is in editable content.
312         * editing/DeleteSelectionCommand.h: Added m_startRoot and 
313         m_endRoot, the editable roots that contain the start and end
314         of the selection, respectively.  We consult these every
315         time we remove a node, and don't want to recompute them 
316         on every call to removeNode().
317
318 2007-04-03  David Hyatt  <hyatt@apple.com>
319
320         Fix for <rdar://problem/5108896>, make sure the assert for setEncodedSize
321         deals with the error case.
322
323         Reviewed by andersca
324
325         * loader/CachedResource.cpp:
326         (WebCore::CachedResource::setEncodedSize):
327
328 2007-04-03  Anders Carlsson  <andersca@apple.com>
329
330         Reviewed by Dave Hyatt.
331
332         * loader/ImageDocument.cpp:
333         Don't call error() in stopParsing.
334
335 2007-04-03  Justin Garcia  <justin.garcia@apple.com>
336
337         Reviewed by darin
338         
339         <rdar://problem/5107422> 
340         TOT REGRESSION: Delete key fails to delete text, and cursor disappears in Mail.app
341         <rdar://problem/5107413> 
342         TOT REGRESSION: Crash deleting text in email (infinite recursion in shouldInsertNode)
343
344         * editing/CompositeEditCommand.cpp:
345         (WebCore::CompositeEditCommand::moveParagraphs):
346         Back out the call to shouldInsert until we
347         add WebViewInsertActionMoved, because Mail returns
348         NO from shouldInsert for WebViewInsertActionPasted
349         to override our Paste operation.
350
351 2007-04-03  Anders Carlsson  <andersca@apple.com>
352
353         Reviewed by Mitz.
354
355         Make window.innerWidth/innerHeight include the size of any present scrollbar to match Firefox.
356         
357         Make document.body.clientWidth/clientHeight return the width/height of the visible content when in
358         quirks mode to match WinIE.
359         
360         * bindings/js/kjs_window.cpp:
361         (KJS::Window::getValueProperty):
362         Return the width and height of the scroll view, not the visible width and height.
363         
364         * dom/Element.cpp:
365         (WebCore::Element::clientWidth):        
366         (WebCore::Element::clientHeight):
367         Return the visible size if the element is the body element and we're in quirks mode.
368
369 2007-04-03  Adele Peterson  <adele@apple.com>
370
371         Reviewed by Darin.
372
373         Updated fix for <rdar://problem/5107095> REGRESSION: disabled text color calculations are slowing down launchtime measurements
374
375         * platform/graphics/Color.cpp: Moved optimization for lightening black and darkening white into the Color class.
376         (WebCore::Color::light):
377         (WebCore::Color::dark):
378         * rendering/RenderTextControl.cpp: (WebCore::disabledTextColor): Skip the difference calculation for black text, which will always be lightened.
379
380 2007-04-03  Anders Carlsson  <andersca@apple.com>
381
382         Reviewed by Tim.
383
384         <rdar://problem/4649516> 
385         Turn off slow script dialog or crank up time that makes it come up
386         
387         * bindings/js/kjs_binding.cpp:
388         (KJS::ScriptInterpreter::ScriptInterpreter):
389         Increase the timeout to 10 seconds to match Firefox.
390
391 2007-04-03  Mitz Pettel  <mitz@webkit.org>
392
393         Reviewed by Darin.
394
395         - fix http://bugs.webkit.org/show_bug.cgi?id=13251
396           editing/style/fontsize-1.html fails intermittently when run multiple times on Intel, generates incorrect DOM
397
398         Covered by existing editing tests.
399
400         * css/CSSPrimitiveValue.cpp:
401         (WebCore::CSSPrimitiveValue::getFloatValue): Added ASSERTs that the requested conversion
402         is from a scalar type to a scalar type. The intermittent failures in the test were
403         the result of trying to convert an identifier type to a scalar type.
404         * editing/ApplyStyleCommand.cpp:
405         (WebCore::StyleChange::checkForLegacyHTMLStyleChange): Added a check that the
406         font-size property value is an absolute length. If it is not (such as in the case
407         of relative units or keywords like "x-large"), then no corresponding 'size' attribute
408         will be generated for legacy HTML.
409
410 2007-04-03  Mitz Pettel  <mitz@webkit.org>
411
412         Reviewed by Darin.
413
414         - fix http://bugs.webkit.org/show_bug.cgi?id=13218
415           <rdar://problem/5095977>
416           Reproducible crash after call to window.close()
417
418         * manual-tests/stale-currentEvent.html: Added.
419         * page/EventHandler.cpp:
420         (WebCore::EventHandler::hoverTimerFired): Instead of faking a mouse event,
421         just hit-test the last mouse event coordinates and update for hover state
422         changes. This eliminates the use of currentEvent, which can be a non-mouse
423         event or even a stale event.
424
425 2007-04-02  Adele Peterson  <adele@apple.com>
426
427         Reviewed by Maciej.
428
429         Fix for <rdar://problem/5107095> REGRESSION: disabled text color calculations are slowing down launchtime measurements
430
431         Hardcode disabled text colors for the most common cases- black and white.
432
433         * rendering/RenderTextControl.cpp: (WebCore::disabledTextColor):
434
435 2007-04-02  David Hyatt  <hyatt@apple.com>
436
437         Fix for <rdar://problem/5105784>, assertion failure in cache.  Encoded sizes were being set to
438         garbage by accident because of a mismatch between derived class and base class constructors.  This
439         patch cleans all of this up and gets rid of expiration date as a concept separate from the response.
440
441         Reviewed by anders
442
443         * dom/Document.cpp:
444         (WebCore::Document::processHttpEquiv):
445         * html/HTMLImageLoader.cpp:
446         (WebCore::HTMLImageLoader::updateFromElement):
447         * loader/Cache.cpp:
448         (WebCore::createResource):
449         (WebCore::Cache::requestResource):
450         * loader/Cache.h:
451         * loader/CachedCSSStyleSheet.cpp:
452         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
453         * loader/CachedCSSStyleSheet.h:
454         * loader/CachedImage.cpp:
455         (WebCore::CachedImage::CachedImage):
456         * loader/CachedImage.h:
457         * loader/CachedResource.cpp:
458         (WebCore::CachedResource::CachedResource):
459         (WebCore::CachedResource::finish):
460         * loader/CachedResource.h:
461         * loader/CachedScript.cpp:
462         (WebCore::CachedScript::CachedScript):
463         * loader/CachedScript.h:
464         * loader/CachedXBLDocument.cpp:
465         (WebCore::CachedXBLDocument::CachedXBLDocument):
466         * loader/CachedXBLDocument.h:
467         * loader/CachedXSLStyleSheet.cpp:
468         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
469         * loader/CachedXSLStyleSheet.h:
470         * loader/DocLoader.cpp:
471         (WebCore::DocLoader::DocLoader):
472         (WebCore::DocLoader::requestResource):
473         * loader/DocLoader.h:
474
475 2007-04-03  Antti Koivisto  <antti@apple.com>
476
477         Reviewed by Hyatt.
478
479         Render tree memory savings, part 3
480         
481         These changes shrink all RenderBlocks by additional 28 bytes. Together with parts 1 and 2
482         RenderBlock goes from 172 bytes to 128 bytes, a saving of 26%.
483         
484         - Pack bitfields together in RenderFlow
485         - Move top/bottom min/max margin values to a struct that is only allocated in case these
486           variables have non default values. Usually this is <5% of all blocks. 
487         - Move rarely used column variables to hash
488
489         * rendering/RenderBlock.cpp:
490         (WebCore::ColumnInfo::ColumnInfo):
491         (WebCore::RenderBlock::RenderBlock):
492         (WebCore::RenderBlock::~RenderBlock):
493         (WebCore::RenderBlock::layoutBlock):
494         (WebCore::RenderBlock::collapseMargins):
495         (WebCore::RenderBlock::clearFloatsIfNeeded):
496         (WebCore::RenderBlock::setCollapsedBottomMargin):
497         (WebCore::RenderBlock::layoutBlockChildren):
498         (WebCore::RenderBlock::paintColumns):
499         (WebCore::RenderBlock::paintObject):
500         (WebCore::RenderBlock::fillSelectionGaps):
501         (WebCore::RenderBlock::lowestPosition):
502         (WebCore::RenderBlock::rightmostPosition):
503         (WebCore::RenderBlock::leftmostPosition):
504         (WebCore::RenderBlock::nodeAtPoint):
505         (WebCore::RenderBlock::hitTestColumns):
506         (WebCore::RenderBlock::positionForCoordinates):
507         (WebCore::RenderBlock::availableWidth):
508         (WebCore::RenderBlock::calcColumnWidth):
509         (WebCore::RenderBlock::setDesiredColumnCountAndWidth):
510         (WebCore::RenderBlock::desiredColumnWidth):
511         (WebCore::RenderBlock::desiredColumnCount):
512         (WebCore::RenderBlock::columnRects):
513         (WebCore::RenderBlock::layoutColumns):
514         (WebCore::RenderBlock::adjustPointToColumnContents):
515         (WebCore::RenderBlock::adjustRectForColumns):
516         (WebCore::RenderBlock::setMaxTopMargins):
517         (WebCore::RenderBlock::setMaxBottomMargins):
518         * rendering/RenderBlock.h:
519         (WebCore::RenderBlock::maxTopMargin):
520         (WebCore::RenderBlock::maxBottomMargin):
521         (WebCore::RenderBlock::maxTopPosMargin):
522         (WebCore::RenderBlock::maxTopNegMargin):
523         (WebCore::RenderBlock::maxBottomPosMargin):
524         (WebCore::RenderBlock::maxBottomNegMargin):
525         (WebCore::RenderBlock::initMaxMarginValues):
526         (WebCore::RenderBlock::MaxMargin::MaxMargin):
527         (WebCore::RenderBlock::MaxMargin::topPosDefault):
528         (WebCore::RenderBlock::MaxMargin::topNegDefault):
529         (WebCore::RenderBlock::MaxMargin::bottomPosDefault):
530         (WebCore::RenderBlock::MaxMargin::bottomNegDefault):
531         * rendering/RenderFlexibleBox.cpp:
532         (WebCore::RenderFlexibleBox::layoutBlock):
533         * rendering/RenderFlow.h:
534         (WebCore::RenderFlow::RenderFlow):
535         (WebCore::RenderFlow::hasColumns):
536         * rendering/RenderInline.cpp:
537         (WebCore::RenderInline::RenderInline):
538         * rendering/RenderInline.h:
539
540 2007-04-03  Antti Koivisto  <antti@apple.com>
541
542         Reviewed by Hyatt.
543
544         Fix asserts, these may also be called for rel positioned elements
545
546         * rendering/RenderBox.cpp:
547         (WebCore::RenderBox::setStaticX):
548         (WebCore::RenderBox::setStaticY):
549
550 2007-04-02  David Hyatt  <hyatt@apple.com>
551
552         Throw in an assert to try to track down a problem where an image is being set to a smaller encoded
553         size.
554
555         * loader/CachedResource.cpp:
556         (WebCore::CachedResource::setEncodedSize):
557
558 2007-04-02  Ada Chan  <adachan@apple.com>
559
560         Reviewed by Adele.
561
562         <rdar://5105331> Missing null check in Editor::execCommand
563         Added null check.
564
565         * editing/Editor.cpp:
566         (WebCore::Editor::execCommand):
567
568 2007-04-02  Justin Garcia  <justin.garcia@apple.com>
569
570         Reviewed by darin
571
572         <rdar://problem/5058163> 
573         Hitting return inserts a new line between two To Dos, but caret is position after second ToDo
574
575         * editing/InsertParagraphSeparatorCommand.cpp:
576         (WebCore::InsertParagraphSeparatorCommand::doApply):
577         Removed refPos, it was unused.
578         Don't assume that upstream() moves to a different
579         node.  This assumption caused the line break to
580         be inserted *after* the caret and a bad position
581         to be set (added a testcase).
582         Use isStartOfParagraph instead of checking
583         for the existence of a br because the line might 
584         be broken by a newline character in text that 
585         preserves newlines.  Paragraphs that are created 
586         in other ways, like with blocks, are handled 
587         above (added a testcase).
588
589  2007-04-02  David Harrison  <harrison@apple.com>
590
591         Reviewed by Darin.
592
593         <rdar://problem/4906488> text attributes are not working for frame based web page
594
595         Attribute handling now treats each WebArea as its own world, rather than sometimes
596         referring back up to the top WebArea. e.g. getting/setting the selection now
597         operates on the WebArea containing the WebCoreAXObject that is being messaged (self).
598         The methods that sit above this and are able to go into arbitrary WebAreas
599         are accessibilityFocusedUIElement and doAXTextMarkerForPosition, allowing VoiceOver
600         to navigate between frames.
601         
602         * bridge/mac/WebCoreAXObject.mm:
603         (-[WebCoreAXObject topRenderer]):
604         (-[WebCoreAXObject frameView]):
605         (-[WebCoreAXObject topFrameView]):
606         Removed topDocument, renamed topView to topFrameView, added frameView.
607         
608         (-[WebCoreAXObject accessibilityAttributeValue:]):
609         AXSelectedTextMarkerRange, AXStartTextMarker, and AXEndTextMarker now use
610         self's WebArea, rather than the top WebArea.
611         
612         (-[WebCoreAXObject doAXTextMarkerRangeForLine:]):
613         Use self's WebArea, rather than the top WebArea.
614
615         (-[WebCoreAXObject doAXTextMarkerForPosition:]):
616         Use renamed methods for accessing top WebArea.
617          
618         (-[WebCoreAXObject doAXBoundsForTextMarkerRange:]):
619         Use renamed methods for accessing self's WebArea.
620
621         (AXAttributeStringSetColor):
622         (AXAttributeStringSetNumber):
623         (AXAttributeStringSetFont):
624         (AXAttributeStringSetStyle):
625         (AXAttributeStringSetElement):
626         (-[WebCoreAXObject rendererForView:]):
627         Clean up uses of nil and NULL.
628         
629         (-[WebCoreAXObject accessibilityFocusedUIElement]):
630         Find the focused node on the whole page. If there is no focused node,
631         return the WebArea for the focused document.
632         
633         (-[WebCoreAXObject doSetAXSelectedTextMarkerRange:]):
634         Use self's WebArea, rather than the top WebArea.
635
636 2007-04-02  Antti Koivisto  <antti@apple.com>
637
638         Fix build. This one was not supposed to be checked in.
639
640         * rendering/RenderFlexibleBox.cpp:
641         (WebCore::RenderFlexibleBox::layoutBlock):
642
643 2007-03-30  Antti Koivisto  <antti@apple.com>
644
645         Reviewed by Hyatt.
646
647         Render tree memory savings, part 2
648         
649         - Move staticX and staticY variables to RenderLayer since they are only
650           applicable to positioned objects
651         - Move very rarely used overrideSize variable to hash
652         
653         These changes shrink all box types by 12 bytes
654
655         * rendering/RenderBox.cpp:
656         (WebCore::RenderBox::RenderBox):
657         (WebCore::RenderBox::destroy):
658         (WebCore::RenderBox::overrideSize):
659         (WebCore::RenderBox::setOverrideSize):
660         (WebCore::RenderBox::overrideWidth):
661         (WebCore::RenderBox::overrideHeight):
662         (WebCore::RenderBox::position):
663         (WebCore::RenderBox::calcWidth):
664         (WebCore::RenderBox::calcHeight):
665         (WebCore::RenderBox::staticX):
666         (WebCore::RenderBox::staticY):
667         (WebCore::RenderBox::setStaticX):
668         (WebCore::RenderBox::setStaticY):
669         (WebCore::RenderBox::calcAbsoluteHorizontal):
670         (WebCore::RenderBox::calcAbsoluteVertical):
671         (WebCore::RenderBox::calcAbsoluteHorizontalReplaced):
672         (WebCore::RenderBox::calcAbsoluteVerticalReplaced):
673         * rendering/RenderBox.h:
674         * rendering/RenderLayer.cpp:
675         (WebCore::RenderLayer::RenderLayer):
676         * rendering/RenderLayer.h:
677         (WebCore::RenderLayer::staticX):
678         (WebCore::RenderLayer::staticY):
679         (WebCore::RenderLayer::setStaticX):
680         (WebCore::RenderLayer::setStaticY):
681         * rendering/RenderObject.cpp:
682         (WebCore::RenderObject::RenderObject):
683         * rendering/RenderObject.h:
684         (WebCore::):
685         (WebCore::RenderObject::hasOverrideSize):
686         (WebCore::RenderObject::setHasOverrideSize):
687         * rendering/RenderWidget.cpp:
688         (WebCore::RenderWidget::destroy):
689
690 2007-03-31  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
691
692         Not reviewed - gdk build fix.
693
694         * platform/gdk/TemporaryLinkStubs.cpp:
695         (Font::selectionRectForComplexText):
696         (Font::drawComplexText):
697
698 2007-03-31  Alexey Proskuryakov  <ap@webkit.org>
699
700         Reviewed by Darin.
701
702         http://bugs.webkit.org/show_bug.cgi?id=12778
703         REGRESSION: Nightly won't load Curl plugin for full page use
704
705         * dom/DOMImplementation.cpp:
706         (WebCore::DOMImplementation::createDocument): Re-order cases to give more priority to plugins.
707         This also fixes Adobe SVG Viewer and any plugins that register XML MIME types.
708         Added a case for XHTML to avoid enumerating plugins.
709
710 2007-03-31  David Hyatt  <hyatt@apple.com>
711
712         Fix for bug 13234, layout of selected justified text is broken.  Rework TextRuns to avoid having
713         from/to members.  Let those be passed in only by the functions that need them (drawing and selection rect).
714
715         Reviewed by mitz
716
717         fast/text/justified-selection-at-edge.html
718
719         * platform/Font.cpp:
720         (WebCore::WidthIterator::WidthIterator):
721         (WebCore::WidthIterator::advance):
722         (WebCore::Font::canUseGlyphCache):
723         (WebCore::Font::drawSimpleText):
724         (WebCore::Font::drawText):
725         (WebCore::Font::floatWidth):
726         (WebCore::Font::floatWidthForSimpleText):
727         (WebCore::Font::selectionRectForText):
728         (WebCore::Font::selectionRectForSimpleText):
729         (WebCore::Font::offsetForPositionForSimpleText):
730         * platform/Font.h:
731         (WebCore::TextRun::m_len):
732         * platform/graphics/GraphicsContext.cpp:
733         (WebCore::GraphicsContext::drawText):
734         (WebCore::GraphicsContext::drawHighlightForText):
735         * platform/graphics/GraphicsContext.h:
736         * platform/mac/FontMac.mm:
737         (WebCore::addDirectionalOverride):
738         (WebCore::overrideLayoutOperation):
739         (WebCore::ATSULayoutParameters::initialize):
740         (WebCore::Font::selectionRectForComplexText):
741         (WebCore::Font::drawComplexText):
742         (WebCore::Font::floatWidthForComplexText):
743         (WebCore::Font::offsetForPositionForComplexText):
744         * platform/qt/FontQt.cpp:
745         (WebCore::Font::drawComplexText):
746         (WebCore::Font::floatWidthForComplexText):
747         * platform/qt/TemporaryLinkStubs.cpp:
748         (Font::selectionRectForComplexText):
749         * rendering/EllipsisBox.cpp:
750         (WebCore::EllipsisBox::paint):
751         * rendering/InlineTextBox.cpp:
752         (WebCore::InlineTextBox::selectionRect):
753         (WebCore::InlineTextBox::paint):
754         (WebCore::InlineTextBox::paintSelection):
755         (WebCore::InlineTextBox::paintMarkedTextBackground):
756         (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
757         (WebCore::InlineTextBox::paintTextMatchMarker):
758         (WebCore::InlineTextBox::offsetForPosition):
759         (WebCore::InlineTextBox::positionForOffset):
760         * rendering/RenderListMarker.cpp:
761         (WebCore::RenderListMarker::paint):
762         (WebCore::RenderListMarker::calcMinMaxWidth):
763         (WebCore::RenderListMarker::getRelativeMarkerRect):
764         * rendering/RenderMenuList.cpp:
765         (WebCore::RenderMenuList::updateOptionsWidth):
766         * rendering/RenderText.cpp:
767         (WebCore::RenderText::widthFromCache):
768         (WebCore::RenderText::width):
769
770 2007-03-31  Mitz Pettel  <mitz@webkit.org>
771
772         Reviewed by Darin.
773
774         - fix http://bugs.webkit.org/show_bug.cgi?id=13243
775               <rdar://problem/5103226>
776           REGRESSION (r20506): Repro crash/assert when using scroll wheel on a list box taller than its contents
777
778         * platform/ScrollBar.cpp:
779         (WebCore::Scrollbar::setValue): Cleaned up a little.
780         (WebCore::Scrollbar::scroll): Changed to apply the minimum and maximum constraints
781         in the right order, and cleaned up a little.
782
783 2007-03-31  Mitz Pettel  <mitz@webkit.org>
784
785         Reviewed by Darin.
786
787         - fix http://bugs.webkit.org/show_bug.cgi?id=13242
788           REGRESSION: Repro crash when specifying the content property for an image
789
790         Test: fast/images/text-content-crash.html
791
792         * html/HTMLImageElement.cpp:
793         (WebCore::HTMLImageElement::parseMappedAttribute): Added a check that the
794         renderer is an image.
795         (WebCore::HTMLImageElement::attach): Ditto.
796
797 2007-03-31  Mark Rowe  <mrowe@apple.com>
798
799         Reviewed by Darin.
800
801         A more correct fix for http://bugs.webkit.org/show_bug.cgi?id=13129
802         Bug 13129: Democracy Player dies in NSException from WebScriptObject on startup
803
804         The previous attempt at a fix in r20343 attempted to conditionally expose the 'count'
805         method.  It did not work which resulted in 'count' always being hidden.  This change
806         disables -[WebScriptObject count] completely until it can be determined whether it is
807         needed and how to support it without breaking third-party applications.
808
809         * bindings/objc/WebScriptObject.mm:
810         (-[WebScriptObject count]):
811         * bindings/objc/WebScriptObjectPrivate.h:
812
813 2007-03-31  Nicholas Shanks  <webkit@nickshanks.com>
814
815         Reviewed by Adele.
816
817         http://bugs.webkit.org/show_bug.cgi?id=13184
818         HTMLImageElement longdesc should be complete resolved URL
819
820         Test: fast/dom/HTMLImageElement/image-longdesc-absolute-url.html
821
822         * html/HTMLImageElement.cpp:
823         (WebCore::HTMLImageElement::longDesc): Return absolute URL.
824         Behaviour now matches Firefox and Opera.
825
826 2007-03-31  Mitz Pettel  <mitz@webkit.org>
827
828         Reviewed by Hyatt.
829
830         - fix http://bugs.webkit.org/show_bug.cgi?id=13209
831           REGRESSION (r18756-18765): Incomplete list marker repaint when resizing list item
832
833         Test: fast/repaint/list-marker-2.html
834
835         A list marker can increase the horizontal overflow after layoutInlineChildren(),
836         so made that function return only the vertical bounds of the repaint rect. As the
837         horizontal bounds, made layoutBlock() just use the overflow bounds after layout.
838
839         * rendering/RenderBlock.cpp:
840         (WebCore::RenderBlock::layoutBlock):
841         * rendering/RenderBlock.h:
842         * rendering/bidi.cpp:
843         (WebCore::RenderBlock::layoutInlineChildren):
844
845 2007-03-31  Mitz Pettel  <mitz@webkit.org>
846
847         Reviewed by Hyatt.
848
849         - http://bugs.webkit.org/show_bug.cgi?id=13178
850           Helvetica zero-width space has non-zero width
851
852         Test: fast/text/wide-zero-width-space.html
853
854         * platform/FontData.cpp:
855         (WebCore::FontData::FontData): Force the ZERO WIDTH SPACE glyph to have width
856         0, unless the SPACE character maps to the same glyph.
857
858 2007-03-31  Mitz Pettel  <mitz@webkit.org>
859
860         Reviewed by Darin.
861
862         - fix http://bugs.webkit.org/show_bug.cgi?id=8016
863           REPRO: Safari hangs loading 18 MB page (deeply nested DOM tree)
864
865         Test: fast/tokenizer/lessthan-terminates-tags-and-attrs.html
866
867         * html/HTMLTokenizer.cpp:
868         (WebCore::HTMLTokenizer::parseTag): Made "<" terminate tag and attribute
869         names. This matches Firefox.
870
871 2007-03-31  Alexey Proskuryakov  <ap@webkit.org>
872
873         Debug build fix.
874
875         * xml/XPathValue.cpp:
876         (WebCore::XPath::): Define Value::adopt.
877
878 2007-03-30  Alexey Proskuryakov  <ap@webkit.org>
879
880         Reviewed by Darin.
881
882         http://bugs.webkit.org/show_bug.cgi?id=13021
883         XPath can be very slow
884
885         This patch finally makes us faster than Firefox 2.0 on this test case.
886
887         * xml/XPathFunctions.cpp:
888         (WebCore::XPath::FunConcat::evaluate): Use a Vector buffer for faster appending.
889         (WebCore::XPath::FunId::evaluate): Move the result NodeSet into Value instead of copying it.
890         (WebCore::XPath::FunLocalName::evaluate): Cosmetic changes.
891         (WebCore::XPath::FunNamespaceURI::evaluate): Ditto.
892         (WebCore::XPath::FunName::evaluate): Ditto.
893         (WebCore::XPath::FunNormalizeSpace::evaluate): Ditto.
894
895         * xml/XPathValue.cpp:
896         (WebCore::XPath::Value::toNodeSet):
897         (WebCore::XPath::Value::modifiableNodeSet):
898         (WebCore::XPath::Value::toBoolean):
899         (WebCore::XPath::Value::toNumber):
900         (WebCore::XPath::Value::toString):
901         * xml/XPathValue.h:
902         (WebCore::XPath::ValueData::ValueData):
903         (WebCore::XPath::Value::Value):
904         Made Value copying faster by putting large data members into a separate refcounted ValueData class.
905         Added provisions for moving a NodeSet in and out of Value without copying.
906         Made construction safer by moving bool version to a template constructor.
907         Removed an (almost) unused default constructor.
908
909         * xml/XPathPredicate.h: Store a Value for literal string and number expressions to avoid 
910         constructing one each time.
911
912         * xml/XPathPath.cpp:
913         (WebCore::XPath::Filter::evaluate):
914         (WebCore::XPath::LocationPath::evaluate):
915         (WebCore::XPath::Path::evaluate):
916         * xml/XPathPath.h:
917         * xml/XPathPredicate.cpp:
918         (WebCore::XPath::NumericOp::evaluate):
919         (WebCore::XPath::Union::evaluate):
920         * xml/XPathResult.cpp:
921         (WebCore::XPathResult::snapshotItem):
922         * xml/XPathStep.cpp:
923         (WebCore::XPath::Step::evaluate):
924         (WebCore::XPath::Step::nodesInAxis):
925         * xml/XPathStep.h:
926         Got rid of unnecessary NodeSet copying in many cases.
927
928 2007-03-30  Justin Garcia  <justin.garcia@apple.com>
929
930         Reviewed by john
931
932         <rdar://problem/5076323> Only one To Do can be created by a selection in a message
933
934         When Mail's ToDoify operation called moveToEndOfDocument: 
935         with a selection that started just before a ToDo, we'd 
936         move them to the end of the document, not to the end
937         of the editable root, because we incorrectly checked
938         for the editability of positions before ToDos.  Then Mail
939         would refuse to create a ToDo because the selection was 
940         outside of the region where they allowed editing.
941
942         * editing/SelectionController.cpp:
943         (WebCore::SelectionController::modifyExtendingRightForward):
944         Check the position for editability, not the position's node,
945         since there are editable positions of the form [node, offset]
946         where node is contenteditable=false.
947         Re-use pos.  Nothing that happens after it's created can invalidate
948         it or the position and affinity used to create it.
949         (WebCore::SelectionController::modifyMovingRightForward): Ditto.
950         (WebCore::SelectionController::modifyExtendingLeftBackward): Ditto.
951         (WebCore::SelectionController::modifyMovingLeftBackward): Ditto.
952         * rendering/RenderBlock.cpp:
953         (WebCore::RenderBlock::paintCaret): Ditto.
954
955 2007-03-30  Adele Peterson  <adele@apple.com>
956
957         Reviewed by Darin.
958
959         Added DeleteWordBackward and DeleteWordForward to execCommand.
960
961         * editing/Editor.cpp:
962         (WebCore::execDeleteWordBackward):
963         (WebCore::execDeleteWordForward):
964         (WebCore::CommandEntry::):
965
966 2007-03-30  Simon Hausmann  <hausmann@kde.org>
967
968         Reviewed by Zack
969
970         * WebCore.pro: Fix release Qt builds.
971
972 2007-03-30  Antti Koivisto  <antti@apple.com>
973
974         Reviewed by bdash.
975
976         Spotted an int that should be float in previous patch.
977
978         * platform/Font.cpp:
979         (WebCore::WidthIterator::advance):
980
981 2007-03-30  Antti Koivisto  <antti@apple.com>
982
983         Reviewed by Hyatt.
984
985         Render tree memory savings, part 1
986         
987         - Eliminate caching of monospace char width from RenderText. This optimization is not needed
988           anymore since Font already caches space width (RenderText -4 bytes)
989         - Eliminate caching of tab width from RenderBlock. Similary this optimization has become
990           obsolete (RenderBlock -4 bytes)
991
992         * platform/Font.cpp:
993         (WebCore::WidthIterator::advance):
994         (WebCore::Font::spaceWidth):
995         * platform/Font.h:
996         (WebCore::Font::tabWidth):
997         * platform/TextStyle.h:
998         (WebCore::TextStyle::TextStyle):
999         (WebCore::TextStyle::allowTabs):
1000         * rendering/InlineTextBox.cpp:
1001         (WebCore::InlineTextBox::selectionRect):
1002         (WebCore::InlineTextBox::paint):
1003         (WebCore::InlineTextBox::paintSelection):
1004         (WebCore::InlineTextBox::paintMarkedTextBackground):
1005         (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
1006         (WebCore::InlineTextBox::paintTextMatchMarker):
1007         (WebCore::InlineTextBox::offsetForPosition):
1008         (WebCore::InlineTextBox::positionForOffset):
1009         * rendering/RenderBlock.cpp:
1010         (WebCore:::RenderFlow):
1011         (WebCore::RenderBlock::setStyle):
1012         * rendering/RenderBlock.h:
1013         * rendering/RenderObject.cpp:
1014         * rendering/RenderObject.h:
1015         * rendering/RenderText.cpp:
1016         (WebCore::RenderText::RenderText):
1017         (WebCore::RenderText::setStyle):
1018         (WebCore::RenderText::widthFromCache):
1019         (WebCore::RenderText::trimmedMinMaxWidth):
1020         (WebCore::RenderText::calcMinMaxWidthInternal):
1021         (WebCore::RenderText::setTextInternal):
1022         (WebCore::RenderText::width):
1023         * rendering/RenderText.h:
1024         (WebCore::RenderText::allowTabs):
1025         * rendering/bidi.cpp:
1026
1027 2007-03-30  David Hyatt  <hyatt@apple.com>
1028
1029         Fix (take 2) for bug 4334, flickering when floating elements gain/lose transparency.
1030
1031         Reviewed by mitz
1032
1033         * rendering/RenderBlock.cpp:
1034         * rendering/RenderBlock.h:
1035         * rendering/RenderBox.cpp:
1036         (WebCore::RenderBox::setStyle):
1037
1038 2007-03-29  Mitz Pettel  <mitz@webkit.org>
1039
1040         Reviewed by Darin.
1041
1042         - fix http://bugs.webkit.org/show_bug.cgi?id=13166
1043           REGRESSION (2005-10-16 - 2005-10-19): Ampersands showing up in the last column of the Gmail contacts table
1044
1045         Test: fast/tokenizer/write-partial-entity.html
1046
1047         * html/HTMLTokenizer.cpp:
1048         (WebCore::HTMLTokenizer::parseTag): Reordered to avoid resetting the buffer position
1049         after script execution which can write to the buffer.
1050
1051 2007-03-29  Justin Garcia  <justin.garcia@apple.com>
1052
1053         Reviewed by john
1054
1055         <rdar://problem/5099303> Deleting after a ToDo puts the caret in the wrong position
1056         
1057         We were failing to create the correct selection 
1058         for DeleteSelectionCommand because the selection extension 
1059         operations don't skip over non-editable content for editable 
1060         selections.
1061
1062         * editing/SelectionController.cpp:
1063         (WebCore::SelectionController::modifyExtendingRightForward):
1064         When extending an editable selection, don't extend into
1065         non-editable content.
1066         (WebCore::SelectionController::modifyExtendingLeftBackward):
1067         Ditto.
1068
1069 2007-03-29  Patti Hoa  <patti@apple.com>
1070
1071         Reviewed by harrison.
1072
1073         <rdar://problem/4918397> Exception raise inspecting note contents in the background
1074         * WebCore.xcodeproj/project.pbxproj:
1075         * bridge/mac/WebCoreAXObject.mm:
1076         (-[WebCoreAXObject subrole]):
1077         (-[WebCoreAXObject title]):
1078         Check that attachment supports the attribute before requesting it.
1079
1080 2007-03-29  Justin Garcia  <justin.garcia@apple.com>
1081
1082         Reviewed by john
1083
1084         <rdar://problem/5032066> Delete should work between ToDos
1085         
1086         Stop selecting the table when the user attempts to delete
1087         the line break just after it, instead, extend the selection
1088         into the last table cell.
1089         Let deletion merge content into table cells (as long as 
1090         its not from another table cell).  
1091         Start calling shouldInsertNode:replacingDOMRange:givenAction: 
1092         when moving content with moveParagraphs, so that Mail can 
1093         modify content before it is moved into a ToDo during a delete.
1094
1095         * editing/CompositeEditCommand.cpp:
1096         (WebCore::CompositeEditCommand::moveParagraphs): Ask the
1097         delegate before performing the move.  This will let Mail
1098         prevent styles from entering a ToDo.
1099         Added a FIXME about adding a new WebViewInsertAction
1100         * editing/DeleteSelectionCommand.cpp:
1101         (WebCore::DeleteSelectionCommand::initializePositionData):
1102         Allow merging into table cells from content not in a table.
1103         * editing/SelectionController.cpp:
1104         (WebCore::SelectionController::modifyExtendingRightForward):
1105         Don't select the table when extending by character/word from
1106         just before it.  This code was here to make it easier to select
1107         tables in order to delete them, but the deletion UI makes it 
1108         largely unnecessary.
1109         (WebCore::SelectionController::modifyExtendingLeftBackward):
1110         Ditto.
1111         * editing/TypingCommand.cpp:
1112         (WebCore::isFirstPositionAfterTable): Added.
1113         (WebCore::isLastPositionBeforeTable): Ditto.
1114         (WebCore::TypingCommand::deleteKeyPressed): When pressing
1115         the delete key with a caret at the beginning of a paragraph
1116         just after a table, move the paragraph into the last table
1117         cell.
1118         Do not do this if it would mean moving a block table.
1119         Removed some old irrelevant comments.
1120         * editing/htmlediting.cpp: Removed unused functions.
1121         * editing/htmlediting.h:
1122
1123 2007-03-29  Adam Treat  <adam@staikos.net>
1124
1125         Reviewed and committed by George Staikos.
1126
1127         Remove redundant line.
1128
1129         * platform/qt/FontDataQt.cpp:
1130         (WebCore::FontData::platformInit):
1131
1132 2007-03-29  Adam Treat  <adam@staikos.net>
1133
1134         Reviewed by David Hyatt, committed by George Staikos.
1135
1136         Test: fast/text/justified-selection.html
1137
1138         Take into account the entire run length to get a proper selection.
1139
1140         * platform/Font.cpp:
1141         (WebCore::WidthIterator::WidthIterator):
1142
1143 2007-03-29  David Hyatt  <hyatt@apple.com>
1144
1145         Fix for <rdar://problem/4545060>, technorati and arstechnica fail because of getComputedStyle not
1146         reporting display:none properly when it is set.  This is bugzilla bug 13103.
1147
1148         Reviewed by mitz
1149
1150         * css/CSSComputedStyleDeclaration.cpp:
1151         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1152
1153 2007-03-28  Oliver Hunt  <oliver@apple.com>
1154
1155         Reviewed by Hyatt.
1156
1157         Rename DocLoader::setPasteInProgress, etc to more generic 
1158         setAllowStaleResources, etc
1159
1160         * editing/Editor.cpp:
1161         (WebCore::Editor::paste):
1162         * loader/DocLoader.cpp:
1163         (WebCore::DocLoader::DocLoader):
1164         (WebCore::DocLoader::checkForReload):
1165         * loader/DocLoader.h:
1166         (WebCore::DocLoader::setAllowStaleResources):
1167         * page/DragController.cpp:
1168         (WebCore::DragController::concludeDrag):
1169
1170 2007-03-28  Oliver Hunt  <oliver@apple.com>
1171
1172         Reviewed by Anders and Steve.
1173
1174         Add a flag to DocLoader to prevent it from reloading 
1175         when performing a paste or drop operation.
1176         
1177         Remove m_cachePolicy from CachedResource as it is never used
1178         
1179         Fixes rdar://problem/5044366 : REGRESSION: Repro ASSERT failures 
1180         dragging image into GMail message in _web_writeImage and 
1181         documentFragmentFromDragData
1182
1183         * editing/Editor.cpp:
1184         (WebCore::Editor::paste):
1185           prevent the docloader from reloading resources on paste
1186         * html/HTMLImageLoader.cpp:
1187         (WebCore::HTMLImageLoader::updateFromElement):
1188         * loader/Cache.cpp:
1189         (WebCore::createResource):
1190         * loader/CachedCSSStyleSheet.cpp:
1191         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
1192         * loader/CachedCSSStyleSheet.h:
1193         * loader/CachedImage.cpp:
1194         (WebCore::CachedImage::CachedImage):
1195         * loader/CachedImage.h:
1196         * loader/CachedResource.cpp:
1197         (WebCore::CachedResource::CachedResource):
1198         * loader/CachedResource.h:
1199         * loader/CachedScript.cpp:
1200         (WebCore::CachedScript::CachedScript):
1201         * loader/CachedScript.h:
1202         * loader/CachedXBLDocument.cpp:
1203         (WebCore::CachedXBLDocument::CachedXBLDocument):
1204         * loader/CachedXBLDocument.h:
1205         * loader/CachedXSLStyleSheet.cpp:
1206         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
1207         * loader/CachedXSLStyleSheet.h:
1208         * loader/DocLoader.cpp:
1209         (WebCore::DocLoader::DocLoader):
1210            Tidy up constructor initialise new field
1211         (WebCore::DocLoader::checkForReload):
1212            Prevent reload when pasting
1213         * loader/DocLoader.h:
1214         (WebCore::DocLoader::setPasteInProgress):
1215           new field and setter
1216         * page/DragController.cpp:
1217         (WebCore::DragController::concludeDrag):
1218           prevent the docloader from reloading resources on drop
1219
1220 2007-03-27  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1221
1222         Not reviewed - fix typo in gdk build.
1223
1224         * platform/gdk/ScrollViewGdk.cpp:
1225         (WebCore::ScrollView::contentsToWindow):
1226
1227 2007-03-28  Maciej Stachowiak  <mjs@apple.com>
1228         
1229         Reviewed by Darin.
1230         
1231         - fixed <rdar://problem/4820817> Autoscroll is broken in Mail.app (message jumps around when trying to select text)
1232                 
1233         Handle scrolling external scrollviews around the webview during
1234         autoscroll or when scrolling into view.
1235         
1236         This should also restore performance on BenchJS test 6 lost due to Tim's partial fix.
1237
1238         * page/FrameView.cpp:
1239         (WebCore::FrameView::scrollRectIntoViewRecursively):
1240         * page/FrameView.h:
1241         * platform/ScrollView.h:
1242         * platform/gdk/ScrollViewGdk.cpp:
1243         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
1244         (WebCore::ScrollView::scrollRectIntoViewRecursively):
1245         * platform/mac/ScrollViewMac.mm:
1246         (WebCore::ScrollView::visibleContentRect):
1247         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
1248         (WebCore::ScrollView::scrollRectIntoViewRecursively):
1249         (WebCore::ScrollView::updateContents):
1250         * platform/qt/ScrollViewQt.cpp:
1251         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
1252         (WebCore::ScrollView::scrollRectIntoViewRecursively):
1253         * platform/win/ScrollViewWin.cpp:
1254         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers):
1255         * platform/win/TemporaryLinkStubs.cpp:
1256         (WebCore::ScrollView::scrollRectIntoViewRecursively):
1257         * rendering/RenderLayer.cpp:
1258         (WebCore::RenderLayer::scrollRectToVisible):
1259        
1260 2007-03-28  Jungshik Shin  <jungshik.shin@gmail.com>
1261
1262         Reviewed  and landed by Darin
1263
1264         Get rid of some misuses of |islower| and |tolower| for non-ASCII characters.
1265         http://bugs.webkit.org/show_bug.cgi?id=13138
1266
1267         * platform/StringImpl.cpp:
1268         (WebCore::StringImpl::isLower):
1269         (WebCore::StringImpl::lower):
1270         (WebCore::StringImpl::equalIgnoringCase):
1271
1272 2007-03-28  Antti Koivisto  <antti@apple.com>
1273
1274         Reviewed by Hyatt.
1275
1276         Fix <rdar://problem/5092653>
1277         REGRESSION: Image decoding making scrolling slow
1278         
1279         If decoder gave back a null frame (which I think happens regularly if you don't have full frame 
1280         data yet for image that does not decode incrementally) m_decodedSize was incremented anyway. This
1281         led to massive growth in calculated image size and eventually made cache prune constantly. 
1282         
1283         No test, I don't know how to make one for this.
1284
1285         * platform/graphics/BitmapImage.cpp:
1286         (WebCore::BitmapImage::cacheFrame):
1287
1288 2007-03-28  Adele Peterson  <adele@apple.com>
1289
1290         Reviewed by Kevin M.
1291
1292         WebCore part of fix for <rdar://problem/5095515> VitalSource Bookshelf should not pass return statements into stringByEvaluatingJavaScriptFromString
1293
1294         * page/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
1295         Convert return value to a string.  This matches the behavior in Safari 2.0.
1296
1297 2007-03-28  Alexey Proskuryakov  <ap@webkit.org>
1298
1299         Reviewed by Darin.
1300
1301         http://bugs.webkit.org/show_bug.cgi?id=13190
1302         XPath incorrectly handles namespaces on attributes
1303
1304         * xml/XPathStep.cpp:
1305         (WebCore::XPath::Step::nodesInAxis): Added a special case for faster attribute lookup; gives a slight but 
1306         measurable performance improvement for bug 13021.
1307         (WebCore::XPath::Step::nodeMatches): Fixed NameTest for attribute nodes.
1308
1309         * xml/XPathStep.h:
1310         (WebCore::XPath::Step::NodeTest::NodeTest):
1311         (WebCore::XPath::Step::NodeTest::namespaceURI):
1312         (WebCore::XPath::Step::nodeTest):
1313         (WebCore::XPath::Step::setNodeTest):
1314         Move m_namespaceURI to NodeTest, where it belongs. Removed unused m_nodeTestData (oops!).
1315
1316         * xml/XPathGrammar.y:
1317         * xml/XPathPath.cpp:
1318         (WebCore::XPath::LocationPath::optimizeStepPair):
1319         Accounted for the above change.
1320
1321 2007-03-28  Oliver Hunt  <oliver@apple.com>
1322
1323         rs=Hyatt.
1324
1325         Rollout local changes :-/
1326
1327         * loader/Cache.cpp:
1328         (WebCore::Cache::pruneAllResources):
1329         (WebCore::Cache::remove):
1330
1331 2007-03-28  Oliver Hunt  <oliver@apple.com>
1332
1333         Reviewed by Hyatt.
1334
1335         Roll out r20511 due to incredible badness
1336
1337         * loader/Cache.cpp:
1338         (WebCore::Cache::pruneAllResources):
1339         (WebCore::Cache::remove):
1340
1341 2007-03-27  Oliver Hunt  <oliver@apple.com>
1342
1343         Reviewed by Adam.
1344
1345         Don't enforce text-selection drag delay when we are
1346         going to drag an image anyway.
1347
1348         Fixes rdar://problem/4668935
1349
1350         * page/EventHandler.cpp:
1351         (WebCore::EventHandler::handleDrag):
1352
1353 2007-03-27  Justin Garcia  <justin.garcia@apple.com>
1354
1355         Build fix
1356         
1357         * editing/markup.cpp:
1358         (WebCore::startMarkup):
1359
1360 2007-03-27  Justin Garcia  <justin.garcia@apple.com>
1361
1362         Reviewed by darin
1363         
1364         <rdar://problem/5091898> REGRESSION: GMail Editor: A line of underlined text copied with Select All pastes with wrong font family
1365         
1366         createMarkup skipped elements if they were blocks
1367         when called from moveParagraphs (because that function 
1368         must receive only inline content).  This patch adds 
1369         code to inline these blocks instead of skipping them 
1370         so that we don't lose any of the style that they 
1371         contribute to the copied markup.
1372
1373         * editing/markup.cpp:
1374         (WebCore::startMarkup): Add an inlineBlocks option.
1375         Make sure to overwrite display:block coming from
1376         a style sheet or the inline style declaration.
1377         (WebCore::createMarkup): Don't refuse to include a 
1378         specialCommonAncestor that's a block if we were asked 
1379         to include only inline content, since we can now inline 
1380         block elements in startMarkup.
1381
1382 2007-03-27  Adele Peterson  <adele@apple.com>
1383
1384         Reviewed by Hyatt.
1385
1386         Fix for <rdar://problem/5026141> REGRESSION: Aperture Viewer Flashes when switching from Index Page to Detail page in Web Gallery
1387
1388         This disables the paint that occurs after WebCore finishes loading the document.  We should reenable this when we
1389         move the dispatchDidFinishLoad delegate callback to happen around the same time as the JS onload call.  See <rdar://problem/5092361>.
1390
1391         * dom/Document.cpp: (WebCore::Document::implicitClose):
1392
1393 2007-03-26  Justin Garcia  <justin.garcia@apple.com>
1394
1395         Reviewed by darin
1396         
1397         <rdar://problem/5065910> REGRESSION: In Mail and GMail, Can't apply color to pasted line of text
1398         <rdar://problem/5084241> After deleting a paragraph of colored text, can't change text color
1399         <rdar://problem/5065605> REGRESSION: Text copied with Select All + Copy loses color on Paste
1400         <rdar://problem/4916887> GMAIL: Can't apply color to text once it becomes indented
1401
1402         * css/CSSComputedStyleDeclaration.cpp:
1403         (WebCore::CSSComputedStyleDeclaration::copyInheritableProperties):
1404         If a node's text fill color is invalid, then its children use 
1405         their font-color as their text fill color (they don't inherit 
1406         it).  Likewise for stroke color.
1407
1408 2007-03-27  Anders Carlsson  <acarlsson@apple.com>
1409
1410         * platform/ScrollBar.h:
1411         Use wtf/MathExtras.h instead of math.h
1412
1413 2007-03-27  Zack Rusin  <zrusin@trolltech.com>
1414
1415         Fix the compile - when using math.h functions
1416         actually include the header with them.
1417
1418         * platform/ScrollBar.h:
1419
1420 2007-03-27  Oliver Hunt  <oliver@apple.com>
1421
1422         Reviewed by Maciej.
1423
1424         The WebArchiver needs all the subresources of a document to be accessible
1425         through the DocLoader, so we can't remove a CachedResource simultaneously
1426         from the global Cache and all DocLoaders, just because it needs to be 
1427         reloaded in one.
1428
1429         Fixes rdar://problem/5044366
1430
1431         * loader/Cache.cpp:
1432         (WebCore::Cache::remove):
1433            Don't evict the resource from all DocLoaders
1434         * manual-tests/test-iframes-loading-the-same-resource.html: Added.
1435            Alas it wasn't possible to make a nice layout test, even this manual test
1436            is not entirely deterministic
1437
1438 2007-03-27  Mark Rowe  <mrowe@apple.com>
1439
1440         Build fix.
1441
1442         * platform/GlyphBuffer.h:
1443         (WebCore::GlyphBuffer::clear):
1444
1445 2007-03-27  Dave Hyatt  <hyatt@apple.com>
1446
1447         Add support for glyph offsets to the GlyphBuffer.
1448        
1449         Reviewed by olliej
1450
1451         * platform/Font.cpp:
1452         (WebCore::Font::drawGlyphBuffer):
1453         * platform/GlyphBuffer.h:
1454         (WebCore::GlyphBuffer::clear):
1455         (WebCore::GlyphBuffer::swap):
1456         (WebCore::GlyphBuffer::offsetAt):
1457         (WebCore::GlyphBuffer::add):
1458
1459 2007-03-27  Antti Koivisto  <antti@apple.com>
1460
1461         Keep buildbot happy.
1462
1463         * platform/mac/PlatformScrollBarMac.mm:
1464         (WebCore::PlatformScrollbar::scrollbarHit):
1465
1466 2007-03-26  Antti Koivisto  <antti@apple.com>
1467
1468         Reviewed by Darin.
1469         
1470         On Mac, support fine grained wheel events generated by trackpad and Mighty Mouse.
1471         http://bugs.webkit.org/show_bug.cgi?id=13134
1472         <rdar://problem/5076249?
1473
1474         * WebCore.exp:
1475             Export _wkGetWheelEventDeltas
1476         * page/EventHandler.cpp:
1477         (WebCore::EventHandler::handleWheelEvent):
1478             Remove (0, 0) scroll event hack, it is not needed anymore.
1479             Do per-pixel scrolling for fine grained events.
1480         * platform/PlatformWheelEvent.h:
1481         (WebCore::PlatformWheelEvent::isContinuous):
1482             Add new m_isContinuous boolean to indicate fine grained wheel events.
1483         * platform/ScrollBar.cpp:
1484         (WebCore::Scrollbar::Scrollbar):
1485         (WebCore::Scrollbar::setValue):
1486         (WebCore::Scrollbar::setSteps):
1487         (WebCore::Scrollbar::scroll):
1488         * platform/ScrollBar.h:
1489         (WebCore::Scrollbar::value):
1490             Use float to represent current position to support finer grained scrolling.
1491             Add ScrollByPixel, remove ScrollByWheel (which was same as ScrollByLine anyway)
1492         * platform/ScrollTypes.h:
1493         (WebCore::):
1494         * platform/gdk/WheelEventGdk.cpp:
1495         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1496             Initalize m_isContinuous
1497         * platform/mac/WebCoreSystemInterface.h:
1498         * platform/mac/WebCoreSystemInterface.mm:
1499             Add wkGetWheelEventDeltas for getting fine grained wheel events
1500         * platform/mac/WheelEventMac.mm:
1501         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1502             Get the wheel deltas using new wkGetWheelEventDeltas interface
1503         * platform/qt/WheelEventQt.cpp:
1504         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1505             Initalize m_isContinuous
1506         * rendering/RenderListBox.cpp:
1507         (WebCore::RenderListBox::calcHeight):
1508             Pass item height to scrollbar
1509
1510 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
1511
1512         Reviewed by Darin Adler.
1513
1514         Fixed <rdar://problem/5088234> REGRESSION: Crash occurs at WebCore::Node::
1515         createRendererIfNeeded() when changing map views with MS Virtual Earth 
1516         (http://www.ziprealty.com/)
1517         
1518         The cause of the crash was the insertion of a <script> element whose
1519         script removed it from the document. The <script> element would then be 
1520         garbage when the insertion routine went on to attach() it.
1521         
1522         The solution here is to check that an element is still your child before
1523         trying to attach() it. This matches the style of checks we do elsewhere
1524         in the node insertion and removal code.
1525
1526         * dom/ContainerNode.cpp:
1527         (WebCore::ContainerNode::insertBefore):
1528         (WebCore::ContainerNode::replaceChild):
1529         (WebCore::ContainerNode::appendChild):
1530
1531 2007-03-26  David Carson  <dacarson@gmail.com>
1532
1533         Reviewed by Darin, landed by Anders.
1534
1535         Manual test case for: REGRESSION (r19559): Java applet crash
1536         http://bugs.webkit.org/show_bug.cgi?id=13142
1537         <rdar://problem/5080340>
1538
1539         * manual-tests/liveconnect-applet-get-boolean.html: Added.
1540         * manual-tests/resources/CheckerApplet.class: Added.
1541         * manual-tests/resources/CheckerApplet.java: Added.
1542
1543 2007-03-26  Mitz Pettel  <mitz@webkit.org>
1544
1545         Reviewed and landed by Darin.
1546
1547         - fix http://bugs.webkit.org/show_bug.cgi?id=13194
1548           <rdar://problem/5087738>
1549           REGRESSION: Selection rects are wrong for images in search results from images.google.com
1550
1551         Test: fast/replaced/selection-rect-in-table-cell.html
1552
1553         * rendering/RenderReplaced.cpp:
1554         (WebCore::RenderReplaced::selectionRect):
1555
1556 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
1557
1558         Removed now-stale #includes of <assert.h>.
1559         
1560         * WebCorePrefix.h:
1561         * config.h:
1562         * css/CSSGrammar.y:
1563         * platform/Arena.cpp:
1564         * platform/KURL.cpp:
1565         * platform/SegmentedString.h:
1566         * rendering/DataRef.h:
1567         * rendering/RenderArena.cpp:
1568
1569 2007-03-26  Geoffrey Garen  <ggaren@apple.com>
1570
1571         Reviewed by Kevin McCulough.
1572
1573         Global replace of "assert(" with "ASSERT(" to assist debugging. Removed
1574         one instance of commented-out code containing "assert(" instead of replacing it.
1575
1576 2007-03-25  Antti Koivisto  <antti@apple.com>
1577
1578         Reviewed by Adam.
1579
1580         Fix <rdar://problem/5049842>
1581         Gmail Editor: Dragging message text in the message body results in a crash at WebCore::Frame::eventHandler()
1582
1583         Null check frame in m_dragTarget, it might be gone already.
1584
1585         * page/EventHandler.cpp:
1586         (WebCore::EventHandler::updateDragAndDrop):
1587         (WebCore::EventHandler::cancelDragAndDrop):
1588         (WebCore::EventHandler::performDragAndDrop):
1589
1590 2007-03-25  Alexey Proskuryakov  <ap@webkit.org>
1591
1592         Reviewed by Darin.
1593
1594         A partial fix for http://bugs.webkit.org/show_bug.cgi?id=13021
1595         XPath can be very slow
1596
1597         * xml/XPathExpression.cpp:
1598         (WebCore::XPathExpression::evaluate): Reset a reference to the context node, as this may prevent the whole document
1599         from being destroyed in time.
1600
1601         * dom/Attr.cpp:
1602         (WebCore::Attr::createTextChild): Instead of calling appendChild(), just do the few operations it really needs to perform.
1603         * dom/ContainerNode.h:
1604         (WebCore::ContainerNode::fastSetFirstChild):
1605         (WebCore::ContainerNode::fastSetLastChild):
1606         Added operations that let Attr hack internal ContainerNode data (evil, but fast!).
1607
1608         * xml/XPathStep.cpp:
1609         (WebCore::XPath::Step::evaluate):
1610         (WebCore::XPath::Step::nodesInAxis):
1611         (WebCore::XPath::Step::nodeMatches):
1612         * xml/XPathStep.h:
1613         Merged node testing into axis enumeration. This saves a lot of Vector resizing and passing, and is necessary for future 
1614         optimizations (sometimes, we can just pick the single result node instead of enumerating and filtering the whole axis).
1615
1616 2007-03-24  Mitz Pettel  <mitz@webkit.org>
1617
1618         Reviewed by Darin.
1619
1620         - fix http://bugs.webkit.org/show_bug.cgi?id=13156
1621           REGRESSION (r19621): Pasting breakable content where wrapped line is too long to fit in a textarea fails to draw a horizontal scrollbar
1622
1623         Test: fast/text/midword-break-after-breakable-char.html
1624
1625         Breaking in the middle of the word
1626         is allowed only if no breaking opportunity between words has occurred yet. The
1627         first position on the line should not be considered "between words" even if
1628         it is a breaking opportunity.
1629         
1630         * rendering/bidi.cpp:
1631         (WebCore::RenderBlock::findNextLineBreak): Changed according to the above. Also
1632         cleaned up a couple of lines.
1633
1634 2007-03-24  David Hyatt  <hyatt@apple.com>
1635
1636         Fix for bugzilla bug 13187, place a hard limit on the amount of decoded data that WebCore will keep
1637         around even on live pages (pages being displayed in tabs/windows or in the back/forward cache).
1638         Images will decode to paint and once the decoded data exceeds the cache size, the decoded data will be
1639         tossed.
1640
1641         Refine the flushing algorithm to apply the two-pass decode/evict model to each LRU-SP queue individually, rather
1642         than to all the lists at once.  This allows the cache to evict large encoded resources before flushing small
1643         or frequently accessed decoded onces.
1644
1645         Added information on live/decoded data to the cache statistics.
1646
1647         Reviewed by darin
1648
1649         * loader/Cache.cpp:
1650         (WebCore::Cache::Cache):
1651         (WebCore::Cache::pruneLiveResources):
1652         (WebCore::Cache::pruneAllResources):
1653         (WebCore::Cache::setMaximumSize):
1654         (WebCore::Cache::remove):
1655         (WebCore::Cache::lruListFor):
1656         (WebCore::Cache::removeFromLRUList):
1657         (WebCore::Cache::insertInLRUList):
1658         (WebCore::Cache::liveLRUListFor):
1659         (WebCore::Cache::removeFromLiveResourcesList):
1660         (WebCore::Cache::insertInLiveResourcesList):
1661         (WebCore::Cache::addToLiveResourcesSize):
1662         (WebCore::Cache::removeFromLiveResourcesSize):
1663         (WebCore::Cache::adjustSize):
1664         (WebCore::Cache::getStatistics):
1665         * loader/Cache.h:
1666         (WebCore::Cache::TypeStatistic::TypeStatistic):
1667         * loader/CachedImage.cpp:
1668         (WebCore::CachedImage::decodedSizeWillChange):
1669         (WebCore::CachedImage::decodedSizeChanged):
1670         * loader/CachedImage.h:
1671         * loader/CachedResource.cpp:
1672         (WebCore::CachedResource::CachedResource):
1673         (WebCore::CachedResource::ref):
1674         (WebCore::CachedResource::deref):
1675         (WebCore::CachedResource::setEncodedSize):
1676         (WebCore::CachedResource::liveResourceAccessed):
1677         * loader/CachedResource.h:
1678         (WebCore::CachedResource::liveAccessCount):
1679         (WebCore::CachedResource::resetLiveAccessCount):
1680         (WebCore::CachedResource::increaseLiveAccessCount):
1681         * platform/graphics/BitmapImage.cpp:
1682         (WebCore::BitmapImage::destroyDecodedData):
1683         (WebCore::BitmapImage::cacheFrame):
1684         * platform/graphics/ImageObserver.h:
1685         * rendering/RenderBox.cpp:
1686         (WebCore::RenderBox::paintBackgroundExtended):
1687         * rendering/RenderImage.cpp:
1688         (WebCore::RenderImage::paint):
1689         * rendering/RenderListMarker.cpp:
1690         (WebCore::RenderListMarker::paint):
1691         * rendering/RenderObject.cpp:
1692         (WebCore::RenderObject::paintBorderImage):
1693
1694 2007-03-24  Darin Adler  <darin@apple.com>
1695
1696         Reviewed by Mitz.
1697
1698         - fix http://bugs.webkit.org/show_bug.cgi?id=13123
1699           CSS selectors that use :lang, :not, and namespaces do not serialize correctly
1700
1701         Test: fast/css/css-selector-text.html
1702
1703         * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText): Add the namespace
1704         prefix for tag or attribute names, the sub-selector for :not, and the argument
1705         for :lang.
1706
1707 2007-03-24  Brady Eidson  <beidson@apple.com>
1708
1709         Reviewed by Adam
1710
1711         <rdar://problem/5086210> - Move RetainPtr to WTF
1712
1713         * ForwardingHeaders/wtf/RetainPtr.h: Added.
1714         * WebCore.xcodeproj/project.pbxproj: Removed WebCore/RetainPtr.h
1715         
1716         * history/HistoryItem.h: Changed #include to <wtf/RetainPtr.h>
1717         * history/PageCache.h: Ditto
1718         * page/mac/WebCoreFrameBridge.mm: Ditto
1719         * platform/ContextMenu.h: Ditto
1720         * platform/ContextMenuItem.h: Ditto
1721         * platform/DragImage.h: Ditto
1722         * platform/FileChooser.h: Ditto
1723         * platform/PlatformKeyboardEvent.h: Ditto
1724         * platform/PopupMenu.h: Ditto
1725         * platform/SharedBuffer.h: Ditto
1726         * platform/cf/RetainPtr.h: Removed.
1727         * platform/graphics/Icon.h: Changed #include
1728         * platform/mac/ClipboardMac.h: Ditto
1729         * platform/mac/PasteboardMac.mm: Ditto
1730         * platform/mac/WidgetMac.mm: Ditto
1731         * platform/network/AuthenticationChallenge.h: Ditto
1732         * platform/network/ResourceError.h: Ditto
1733         * platform/network/ResourceHandle.h: Ditto
1734         * platform/network/ResourceRequest.h: Ditto
1735         * platform/network/ResourceResponse.h: Ditto
1736         * rendering/RenderThemeMac.mm: Ditto
1737
1738 2007-03-24  Mitz Pettel  <mitz@webkit.org>
1739
1740         Fix for <rdar://problem/5086797>, layoutPending is now reporting incorrect results, which will lead
1741         to all sorts of layout issues.  This is in bugzilla as 13179.
1742
1743         Reviewed by hyatt
1744
1745         - fix http://bugs.webkit.org/show_bug.cgi?id=13179
1746           REGRESSION (r20410): In debug builds, loading a certain page is suspended until redisplay is forced
1747
1748         Moved the root->needsLayout() check from layoutPending() to needsLayout()
1749         to restore the behavior before r20324.
1750
1751         * page/FrameView.cpp:
1752         (WebCore::FrameView::layoutPending):
1753         (WebCore::FrameView::needsLayout):
1754
1755 2007-03-24  Mitz Pettel  <mitz@webkit.org>
1756
1757         Reviewed by Adele.
1758
1759         - fix http://bugs.webkit.org/show_bug.cgi?id=13180
1760               <rdar://problem/5084478>
1761           Another debug build crash from ASSERTION FAILED: !needsLayout()
1762
1763         No test possible because updateRendering() is always called after script
1764         execution.
1765
1766         * page/FrameView.cpp:
1767         (WebCore::FrameView::layout): Get the layout root after calling recalcStyle()
1768         since a style recalc may result in needing to do start layout at the root.
1769
1770 2007-03-24  Nikolas Zimmermann  <zimmermann@kde.org>
1771
1772         Not reviewed. Build fix.
1773
1774         Fix FloatRect vs. IntRect confusion.
1775
1776         * rendering/RenderSVGImage.cpp:
1777         (WebCore::RenderSVGImage::nodeAtPoint):
1778
1779 2007-03-25  Mark Rowe  <mrowe@apple.com>
1780
1781         Fix incorrect radar number.
1782
1783         * platform/network/mac/ResourceHandleMac.mm:
1784         (-[WebCoreResourceHandleAsDelegate connection:willCacheResponse:]):
1785
1786 2007-03-23  Nikolas Zimmermann  <zimmermann@kde.org>
1787
1788         Reviewed by Oliver.
1789
1790         Fix all known RenderSVGImage problems.
1791
1792         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12126 (RenderSVGImage seems to suffer from integer overflow)
1793         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12442 (raster images disappearing during script execution (SVG))
1794         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12572 (WebKit does not properly invalidate image region after image load)
1795
1796         Added test: svg/custom/scrolling-embedded-svg-file-image-repaint-problem.html
1797
1798         In RenderSVGImage::paint, do not call shouldPaint() as this will never work properly for SVG renderers, as shouldPaint
1799         doesn't take into account any special SVG transformation (localTransform/absoluteTransform). Just remove the call.
1800
1801         Fix hit detection on RenderSVGImage - it didn't work properly at all. No idea why I didn't notice before.
1802         Thanks Andreas Neumann once again for writing excellent bug reports and pointing me to them :-)
1803
1804         The carto.net navigation tools work as expected now, and also the "dock like" image effect example.
1805
1806         * rendering/RenderSVGImage.cpp:
1807         (WebCore::RenderSVGImage::paint):
1808         (WebCore::RenderSVGImage::nodeAtPoint):
1809
1810 2007-03-24  Mitz Pettel  <mitz@webkit.org>
1811
1812         Reviewed by Dave Hyatt.
1813
1814         - http://bugs.webkit.org/show_bug.cgi?id=13177
1815           Suppress control characters in the ATSUI code path
1816
1817         * platform/mac/FontMac.mm:
1818         (WebCore::overrideLayoutOperation):
1819         (WebCore::ATSULayoutParameters::initialize):
1820
1821 2007-03-24  David Hyatt  <hyatt@apple.com>
1822
1823         Fix for <rdar://problem/5086400>, images scrolled offscreen continue to animate.  Safari 2 would
1824         halt animations when images were no longer visible.
1825
1826         Reviewed by mjs, olliej
1827
1828         * platform/graphics/BitmapImage.cpp:
1829         (WebCore::BitmapImage::advanceAnimation):
1830
1831 2007-03-24  David Hyatt  <hyatt@apple.com>
1832
1833         Fix for <rdar://problem/508328>, sluggish text entry in search field.  Make sure
1834         our size actually changed before we decide to do a full repaint because of background/border
1835         complexities.
1836
1837         Reviewed by aroben
1838
1839         * rendering/RenderObject.cpp:
1840         (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
1841
1842 2007-03-23  Dave Hyatt  <hyatt@apple.com>
1843
1844         Fix for <rdar://problem/5048219>, spurious glyphs in gmail.   This is bugzilla bug 13136, which
1845         will remain open to cover patching the complex text path.
1846         
1847         Reviewed by aroben
1848
1849         * platform/Font.cpp:
1850         (WebCore::Font::glyphDataForCharacter):
1851         * platform/Font.h:
1852         (WebCore::Font::treatAsZeroWidthSpace):
1853         * platform/GlyphPageTreeNode.cpp:
1854         (WebCore::GlyphPageTreeNode::initializePage):
1855
1856 2007-03-23  Mitz Pettel  <mitz@webkit.org>
1857
1858         Reviewed by Adele.
1859
1860         - fix http://bugs.webkit.org/show_bug.cgi?id=13153
1861           REGRESSION: Visual highlighting of pre-populated blank line in textarea is broken
1862
1863         - fix a bug where selecting across a soft line break did not highlight to
1864           the end of the first line if it contained skipped whitespace
1865
1866         Test: fast/text/selection-hard-linebreak.html
1867
1868         * rendering/InlineTextBox.cpp:
1869         (WebCore::InlineTextBox::selectionState): Changed to treat a selection that ends on the
1870         end of a hard line break as if it ends after the line break. Fixed the case of a selection
1871         that starts and ends in the same text object as the box but does not intersect it
1872         to return SelectionNone instead of selectionBoth.
1873
1874 2007-03-23  Mitz Pettel  <mitz@webkit.org>
1875
1876         Reviewed by Adele.
1877
1878         - fix http://bugs.webkit.org/show_bug.cgi?id=13124
1879           REGRESSION: Reproducible crash in Widget::getView
1880
1881         Test: fast/frames/hover-timer-crash.html
1882
1883         * page/Frame.cpp:
1884         (WebCore::Frame::setView): Added a call to EventHandler::clear().
1885
1886 2007-03-23  Justin Garcia  <justin.garcia@apple.com>
1887
1888         Reviewed by adele
1889
1890         <rdar://problem/5078739> 
1891         Crash in in ReplaceSelectionCommand if the fragment contains only a style span
1892
1893         * editing/ReplaceSelectionCommand.cpp:
1894         (WebCore::ReplaceSelectionCommand::doApply): Check 
1895         for an empty fragment after removing a redundant
1896         style span instead of before.
1897
1898 2007-03-23  David Hyatt  <hyatt@apple.com>
1899
1900         <rdar://problem/5085063>
1901
1902         Fix non-looping animation on cuteoverload.com. Just always flush
1903         decoded data for large animated images to avoid our cache getting
1904         out of sync with the image source.
1905
1906         Reviewed by ggaren
1907
1908         * platform/graphics/BitmapImage.cpp:
1909         (WebCore::BitmapImage::advanceAnimation):
1910
1911 2007-03-23  Adele Peterson  <adele@apple.com>
1912
1913         Reviewed by Darin.
1914
1915         Fix for <rdar://problem/5061024> REGRESSION: Returning false from onkeypress event on Input is ignored when key is Tab
1916         http://bugs.webkit.org/show_bug.cgi?id= 13020
1917
1918         No known way to add a layout test for this.  We would need a way to know exactly how the event was consumed.
1919
1920         * page/EventHandler.cpp: (WebCore::EventHandler::defaultKeyboardEventHandler):
1921           If the keypress event has its default behavior prevented, then we should consider the keydown event handled.
1922
1923 2007-03-23  Justin Garcia  <justin.garcia@apple.com>
1924
1925         Reviewed by darin
1926
1927         <rdar://problem/5080333> 
1928         REGRESSION: Selection changes when changing the alignment of an image
1929         
1930         Regression occurred when we started using moveParagraphs
1931         to move content in applyBlockStyle.  moveParagraphs 
1932         moves by copying, deleting and reinserting content, and
1933         so must be accompanied by selection preservation code.
1934         That code uses rangeFromLocationAndLength and rangeLength,
1935         which use TextIterators, which don't emit anything for images 
1936         and other replaced elements, causing this bug.
1937
1938         * editing/ApplyStyleCommand.cpp:
1939         (WebCore::ApplyStyleCommand::applyBlockStyle): Ask rangeLength 
1940         and rangeFromLocationAndLength to request that their
1941         TextIterators emit spaces for replaced elements.
1942         Use rangeCompliantEquivalent()s when creating a Range from
1943         VisiblePositions, since some VisiblePositions have illegal
1944         deepEquivalent()s.
1945         * editing/CompositeEditCommand.cpp:
1946         (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
1947         * editing/TextIterator.cpp:
1948         (WebCore::TextIterator::TextIterator):
1949         (WebCore::TextIterator::handleReplacedElement): Emit
1950         a space if requested.
1951         (WebCore::TextIterator::representNodeOffsetZero): Emit
1952         ranges before m_node, not around m_lastTextNode.  These
1953         ranges should represent the part of the document associated
1954         with the emitted character. 
1955         (WebCore::TextIterator::rangeLength): Take in the new bool.
1956         (WebCore::TextIterator::rangeFromLocationAndLength): Ditto.
1957         Also, don't loop an extra time after finding the end of the
1958         range when we're looking for zero length ranges.  This appeared
1959         to be a workaround for the bugs fixed in representNodeOffsetZero
1960         in this patch.
1961         * editing/TextIterator.h:
1962
1963 2007-03-24  Mark Rowe  <mrowe@apple.com>
1964
1965         Rubber-stamped by Darin.
1966
1967         * Configurations/WebCore.xcconfig: Remove unnecessary INFOPLIST_PREPROCESS.
1968
1969 2007-03-23  Darin Adler  <darin@apple.com>
1970
1971         * html/HTMLBodyElement.cpp: Fix comment typo.
1972
1973 2007-03-23  Adam Treat  <adam@staikos.net>
1974
1975         Reviewed and committed by George.
1976
1977         Patch from Adam Treat to make the Qt build work without SVG and XSLT.
1978         XMLNames is required in any case.
1979
1980         * WebCore.pro:
1981
1982 2007-03-23  Darin Adler  <darin@apple.com>
1983
1984         Reviewed by Hyatt.
1985
1986         - <rdar://problem/5074439> handle margins on frame and iframe elements
1987           without involving FrameView, FrameLoader, etc.
1988
1989         * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::insertedIntoDocument):
1990         Grab the margin from the frame directly here. There was no real benefit
1991         to doing this via FrameView. Later we can delete quite a bit of unneeded code
1992         here and in WebKit that exists only to set up the margin values in FrameView,
1993         which are now unused.
1994
1995 2007-03-23  Adele Peterson  <adele@apple.com>
1996
1997         Reviewed by Darin.
1998
1999         Fix for <rdar://problem/5080428> REGRESSION: getting value for hidden input element fails after the fix for Bug 11866
2000         http://bugs.webkit.org/show_bug.cgi?id=13121
2001
2002         Rolled out the change for 11866 that made hidden input elements store the value separately from the value attribute.
2003         Added an m_originalValue field that gets set when the element is done being parsed (in closeRenderer).  In reset,
2004         use the m_originalValue for hidden input elements.
2005
2006         * html/HTMLInputElement.cpp:
2007         (WebCore::HTMLInputElement::closeRenderer):
2008         (WebCore::HTMLInputElement::reset):
2009         (WebCore::HTMLInputElement::setValue):
2010         (WebCore::HTMLInputElement::storesValueSeparateFromAttribute):
2011         * html/HTMLInputElement.h:
2012
2013 2007-03-23  Mitz Pettel  <mitz@webkit.org>
2014
2015         Reviewed by Dave Hyatt.
2016
2017         - fix http://bugs.webkit.org/show_bug.cgi?id=13157
2018               <rdar://problem/5083995>
2019           List markers positioned incorrectly and don't repaint properly on Oxford homepage
2020
2021         Test: fast/lists/marker-image-error.html
2022
2023         * rendering/RenderListMarker.cpp:
2024         (WebCore::RenderListMarker::imageChanged): Mark ourselves for relayout if
2025         the image failed to load, since that means we will use a bullet instead.
2026
2027 2007-03-23  Zack Rusin  <zrusin@trolltech.com>
2028
2029         Fix the compile.
2030
2031         * platform/graphics/qt/ImageSourceQt.cpp:
2032
2033 2007-03-22  Dave Hyatt  <hyatt@apple.com>
2034
2035         Fix for <rdar://problem/5083072>.
2036
2037         * page/Frame.cpp:
2038         (WebCore::Frame::setPrinting):
2039         (WebCore::Frame::forceLayoutWithPageWidthRange):
2040         * page/Frame.h:
2041         * page/mac/WebCoreFrameBridge.mm:
2042         (-[WebCoreFrameBridge forceLayoutWithMinimumPageWidth:maximumPageWidth:adjustingViewSize:]):
2043
2044 2007-03-22  Anders Carlsson  <acarlsson@apple.com>
2045
2046         Reviewed by Ada.
2047
2048         <rdar://problem/5074974>
2049         CrashTracer: [USER] repro crash in Safari at com.apple.WebCore: WebCore::FrameLoader::activeDocumentLoader const + 6
2050         
2051         * loader/mac/NetscapePlugInStreamLoaderMac.mm:
2052         (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
2053         Don't use ResourceResponse:isHTTP here since that only looks at the protocol instead of if the response came from a 
2054         HTTP server (and not a web archive).
2055
2056 2007-03-22  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
2057
2058         Not reviewed - gdk build fix.
2059
2060         * platform/graphics/cairo/ImageSourceCairo.cpp:
2061
2062 2007-03-22  Dave Hyatt  <hyatt@apple.com>
2063
2064         Fix for <rdar://problem/5083473>.  Make sure wheeling still forwards to the frame view even
2065         when no node is hit.  Technically not ever hitting a node is a regression from the RenderView
2066         size changes (making it be the size of the initial containing block according to CSS2.1), but
2067         we should still handle this case gracefully in case it comes up again.
2068        
2069         Reviewed by olliej
2070
2071         * page/EventHandler.cpp:
2072         (WebCore::EventHandler::handleWheelEvent):
2073
2074 2007-03-22  Justin Garcia  <justin.garcia@apple.com>
2075
2076         Reviewed by kevin
2077
2078         <rdar://problem/5081257> 
2079         REGRESSION: New Mail signatures start out empty
2080
2081         * editing/VisiblePosition.cpp:
2082         (WebCore::VisiblePosition::canonicalPosition): Allow
2083         descent from positions inside the document into an 
2084         editable body.
2085
2086 2007-03-22  Brady Eidson  <beidson@apple.com>
2087
2088         Reviewed by Adele and John
2089
2090         <rdar://5043528> - Prepare for new API
2091         
2092         * platform/network/ResourceHandle.cpp:
2093         (WebCore::ResourceHandle::clearAuthentication): Clear CF type
2094
2095 2007-03-22  Beth Dakin  <bdakin@apple.com>
2096
2097         Patch by Hyatt, reviewed and committed by me.
2098
2099         Does not reproduce consistently, so a layout test does not seem 
2100         possible.
2101
2102         Fix for <rdar://problem/5082421> Constantly hitting ASSERT(!
2103         needsLayout()) in RenderView::paint()
2104
2105         * page/FrameView.cpp:
2106         (WebCore::FrameView::layoutPending): It is not enough to ask if the 
2107         layout timer is active. There may be times that we don't have a 
2108         body yet so we cannot schedule layout yet, but the root still needs 
2109         layout.  
2110
2111 2007-03-22  John Sullivan  <sullivan@apple.com>
2112
2113         Reviewed by Darin
2114         
2115         Followup for recent fix to 5079700, found by assertion added to Safari.
2116
2117         * page/mac/FrameMac.mm:
2118         (WebCore::Frame::searchForLabelsBeforeElement):
2119         Fixed another place in this method where an empty NSString was being returned instead of nil.
2120         Cleaned up the style a little too.
2121
2122 2007-03-22  David Hyatt  <hyatt@apple.com>
2123
2124         Remove unnecessary destroyFrameAtIndex call.  Now that we throw away
2125         the image source, it is no longer needed.
2126
2127         Reviewed by beth
2128
2129         * platform/graphics/BitmapImage.cpp:
2130         (WebCore::BitmapImage::destroyDecodedData):
2131
2132 2007-03-22  David Harrison  <harrison@apple.com>
2133
2134         Reviewed by Geoff, Darin.
2135
2136         <rdar://problem/5077892> In RapidWeaver 3.5.1, a crash occurs when attempting to load Safari Bookmarks in iMedia Browser
2137         
2138         * platform/mac/ThreadCheck.mm:
2139         (WebCore::_WebCoreThreadViolationCheck):
2140         Change default on Tiger to NSLog rather than raise an exception.
2141
2142 2007-03-22  Darin Adler  <darin@apple.com>
2143
2144         Reviewed by Brady.
2145
2146         - use binary_search instead of hash table; slightly better performance and
2147           less memory use
2148
2149         * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::portAllowed):
2150         Use binary_search.
2151
2152 2007-03-22  Darin Adler  <darin@apple.com>
2153
2154         Reviewed by Adele.
2155
2156         - fix <rdar://problem/5074630> detachChildren call should move from WebKit to WebCore
2157
2158         * loader/FrameLoader.cpp: (WebCore::FrameLoader::setDocumentLoader):
2159         Add a call to detachChildren() after the call to prepareForDataSourceReplacement().
2160         There was no reason for this crucial loading step to be left to the client.
2161
2162 2007-03-22  David Hyatt  <hyatt@apple.com>
2163
2164         Minor refactoring and cleanup of the bridge calls that want to control layout settings on the RenderView.
2165         Have the bridge talk through the FrameView instead of just asking for the RenderView directly.
2166
2167         Add an assert to help catch situations where the RenderView needs layout at paint time, since this is a known
2168         catastrophic scenario that will (much of the time) result in a crash in RenderTableSection::paint.
2169
2170         Reviewed by aroben
2171
2172         * page/FrameView.cpp:
2173         (WebCore::FrameView::adjustViewSize):
2174         (WebCore::FrameView::needsLayout):
2175         (WebCore::FrameView::setNeedsLayout):
2176         * page/FrameView.h:
2177         * page/mac/WebCoreFrameBridge.mm:
2178         (-[WebCoreFrameBridge needsLayout]):
2179         (-[WebCoreFrameBridge setNeedsLayout]):
2180         * rendering/RenderView.cpp:
2181         (WebCore::RenderView::paint):
2182
2183 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
2184
2185         Reviewed by Beth Dakin.
2186         
2187         Re-worked the fix in r20375. 'M' and 'm' are not the only commands that
2188         accept "extra" coordinates -- virtually all commands accept them.
2189
2190         * ksvg2/svg/SVGParserUtilities.cpp:
2191         (WebCore::SVGPathParser::parseSVG):
2192
2193 2007-03-21  David Harrison  <harrison@apple.com>
2194
2195         Reviewed by hyatt.
2196
2197         <rdar://problem/5072460> CrashTracer: [USER] 1 crashes in Xcode at com.apple.ImageIO.framework: getBandProcPNG + 168
2198
2199         An NSData object was being alloc/init'd, then returned callers who cast the pointer as a
2200         CFDataRef, including calling CFRelease on it. The problem is that under garbage collection, the NS
2201         retain count is ignored (it's always 0), but the CFRetain and CFRelease are not ignored. This
2202         caused the object to be over-released. The solution that works in both GC and non-GC is to "transfer"
2203         the initial NS retain count to the CF retain count, using HardRetainWithNSRelease.
2204         
2205         The creator of the NSData was SharedBuffer::createNSData. The callers were PDFDocumentImage::dataChanged()
2206         and ImageSource::setData(). This particular crash involved the ImageSource::setData() case.
2207
2208         * platform/SharedBuffer.h:
2209         Declare createCFData().
2210         
2211         * platform/graphics/cg/ImageSourceCG.cpp:
2212         (WebCore::ImageSource::setData):
2213         Call createCFData instead of createNSData.
2214         
2215         * platform/graphics/cg/PDFDocumentImage.cpp:
2216         (WebCore::PDFDocumentImage::dataChanged):
2217         Call createCFData instead of createNSData.
2218         
2219        * platform/mac/SharedBufferMac.mm:
2220         (WebCore::SharedBuffer::createCFData):
2221         Implement createCFData(). Use HardRetainWithNSRelease for gc safety.
2222         
2223 2007-03-21  Mitz Pettel  <mitz@webkit.org>
2224
2225         Reviewed by Darin.
2226
2227         - fix http://bugs.webkit.org/show_bug.cgi?id=13145
2228           Regression: Scrollbar not resizing after display none
2229
2230         Test: fast/dynamic/view-overflow.html
2231
2232         * rendering/RenderView.cpp:
2233         (WebCore::RenderView::layout): Reset overflowHeight() and overflowWidth()
2234         before calling docHeight() and docWidth(), since the former act as a lower
2235         bound for the latter.
2236
2237 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
2238
2239         Reviewed by Beth Dakin.
2240         
2241         A little cleanup based work I've been doing on the SVG parsers.
2242
2243         * ksvg2/svg/SVGParserUtilities.h:
2244         (WebCore::skipString):
2245         * ksvg2/svg/SVGPreserveAspectRatio.cpp: Moved checkString into
2246         SVGParserUtilities.h, so it could be with all its friends. Renamed 
2247         "checkString" to "skipString" to match the rest of the code and to be 
2248         clear about which functions move the buffer pointer.
2249         (WebCore::SVGPreserveAspectRatio::parsePreserveAspectRatio):
2250         * ksvg2/svg/SVGTransformable.cpp:
2251         (WebCore::SVGTransformable::parseTransformAttribute): Changed gotos into 
2252         returns. Removed unnecessary magic number.
2253
2254 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
2255
2256         Reviewed by Beth Dakin.
2257         
2258         Fixed <rdar://problem/5078471> SVG rgb color parser runs past end of 
2259         buffer when running fuzzing test
2260
2261         * ksvg2/svg/SVGColor.cpp:
2262         (WebCore::parseNumberOrPercent): Check for past the end condition.
2263         (WebCore::SVGColor::colorFromRGBColorString): Reversed "read past end
2264         of buffer, then check if you're past the end" logic.
2265
2266 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
2267
2268         Reviewed by Beth Dakin.
2269         
2270         Fixed <rdar://problem/5079410> SVG path parser hangs, exhausts memory when 
2271         running fuzzer test
2272
2273         * ksvg2/svg/SVGParserUtilities.cpp:
2274         (WebCore::SVGPathParser::parseSVG): Don't assume that extra digits are
2275         always preceded by an 'M' or an 'm'.
2276
2277 2007-03-21  John Sullivan  <sullivan@apple.com>
2278
2279         Reviewed by Adam
2280         
2281         - fixed <rdar://problem/5079700> REGRESSION (r19702): Name/password aren't autofilled 
2282           or saved for .Mac homepage login
2283
2284         * page/mac/FrameMac.mm:
2285         (WebCore::Frame::searchForLabelsBeforeElement):
2286         don't count empty strings as valid results
2287
2288 2007-03-21  Justin Garcia  <justin.garcia@apple.com>
2289
2290         Reviewed by darin
2291
2292         * editing/markup.cpp:
2293         (WebCore::styleFromMatchedRulesAndInlineDecl): 
2294         Release the RefPtr to avoid increasing/decreasing
2295         the refcount unnecessarily.
2296         (WebCore::propertyMissingOrEqualToNone): Added and used
2297         instead of converting values to strings.
2298         (WebCore::elementHasTextDecorationProperty): 
2299         (WebCore::createMarkup):
2300
2301 2007-03-21  Justin Garcia  <justin.garcia@apple.com>
2302
2303         Reviewed by oliver
2304
2305         <rdar://problem/5075944> 
2306         REGRESSION: Partially selected underlined content pastes as plain text
2307         
2308         We stopped adding markup for all the ancestors
2309         of lastClosed up to the commonAncestorBlock
2310         because it was adding a lot of unnecessary markup.
2311         This caused us to lose underlining when copying a 
2312         partially selected underlined element (even though 
2313         we put all styles that the copied markup inherits 
2314         into a style span, because the text-decoration 
2315         isn't inheritable).
2316
2317         * editing/markup.cpp:
2318         (WebCore::styleFromMatchedRulesAndInlineDecl): Moved
2319         code here.
2320         (WebCore::elementHasTextDecorationProperty): Added.
2321         (WebCore::createMarkup): If the copied markup has a
2322         text-decoration because some common ancestor has
2323         a text-decoration property set, include that ancestor
2324         and all its descendants in the copied markup.
2325
2326 2007-03-21  Oliver Hunt  <oliver@apple.com>
2327
2328         Reviewed by Antti.
2329
2330         Update a few SVG attribute parsers to be more defensive against
2331         reading beyond the end of input. 
2332
2333         Fixes rdar://problem/5077218 -- SVG transform parser runs past
2334         end of buffer when running fuzzing test
2335
2336         * ksvg2/svg/SVGParserUtilities.cpp:
2337         (WebCore::SVGPathParser::parseSVG):
2338         * ksvg2/svg/SVGParserUtilities.h:
2339         (WebCore::skipOptionalSpacesOrDelimiter):
2340         * ksvg2/svg/SVGTransformable.cpp:
2341         (WebCore::parseTransformParamList):
2342         (WebCore::SVGTransformable::parseTransformAttribute):
2343
2344 2007-03-21  Alexey Proskuryakov  <ap@webkit.org>
2345
2346         Reviewed by Mitz.
2347
2348         http://bugs.webkit.org/show_bug.cgi?id=13140
2349         Crash after loading SVG fragment with XMLHttpRequest (Yosemite Map Geology Layer)
2350
2351         Test: svg/carto.net/frameless-svg-parse-error.html
2352
2353         * ksvg2/misc/SVGDocumentExtensions.cpp:
2354         (WebCore::SVGDocumentExtensions::reportError): Added a null check.
2355         (WebCore::SVGDocumentExtensions::reportWarning): Ditto.
2356
2357 2007-03-21  Beth Dakin  <bdakin@apple.com>
2358
2359         Reviewed by Geoff.
2360
2361         Fix for <rdar://problem/5072678> Crash in
2362         RenderLayer::scrollRectToVisible with MallocScribble enabled
2363
2364         I tried to fix this earlier today but my fix caused a regression
2365         scrolling through RSS pages. It turns out that sometimes scroll
2366         events need to propagate immediately, and sometimes they must be
2367         delayed or they risk deleting objects that are expected to be
2368         around after the event has propagated. Mitz's original fix made
2369         sheduleEvent() only delay events that happen during layout. This
2370         fix marks two other places in addition to layout where events also
2371         need to be delayed. These two places are places that were marked
2372         with FIXMEs that Mitz removed in his original patch. (There was a
2373         third FIXME in RenderLayer::updateScrollInfoAfterLayout() but that
2374         case is only called through layout and is covered by Mitz's
2375         original patch.)
2376
2377         * page/FrameView.cpp:
2378         (WebCore::FrameView::~FrameView): Added assertion.
2379         (WebCore::FrameView::layout): Call new functions to increment and 
2380         decrement the queued events count.
2381         (WebCore::FrameView::pauseScheduledEvents):
2382         (WebCore::FrameView::resumeScheduledEvents): Decrement queued 
2383         events count and dispatch events if the count has zeroed.
2384         * page/FrameView.h:
2385         * rendering/RenderLayer.cpp:
2386         (WebCore::RenderLayer::scrollRectToVisible):
2387         (WebCore::Marquee::start):
2388
2389 2007-03-21  Mitz Pettel  <mitz@webkit.org>
2390
2391         Reviewed by John Sullivan.
2392
2393         - fix http://bugs.webkit.org/show_bug.cgi?id=13130
2394           REGRESSION: Sometimes a frame resizer keeps following the mouse after mouseup
2395
2396         * rendering/RenderFrameSet.cpp:
2397         (WebCore::RenderFrameSet::userResize): Reordered the code to allow resizing
2398         to be terminated by a mouseup event regardless of whether the frameset needs
2399         layout.
2400
2401 2007-03-20  Anders Carlsson  <acarlsson@apple.com>
2402
2403         Reviewed by Oliver.
2404
2405         <rdar://problem/5077252> 
2406         In NetNewsWire 2.1.1 and 3.0d62, a crash occurs after triple-clicking a link on the page
2407         
2408         * loader/FrameLoader.cpp:
2409         (WebCore::FrameLoader::load):
2410         Move the m_inStopAllLoaders check to the load function that's common for loading a request or substitute data.
2411
2412 2007-03-20  Brady Eidson  <beidson@apple.com>
2413
2414         Reviewed by Anders.
2415
2416         <rdar://problem/5073391> and http://bugs.webkit.org/show_bug.cgi?id=13137
2417
2418         Crash in IconDatabase when private browsing is enabled.
2419
2420         The problem was caused by http://trac.webkit.org/projects/webkit/changeset/20182 
2421         which changed many uses of char[] and Vector<char> to SharedBuffer.  The patch
2422         tended to literally replace a Vector<char> with RefPtr<SharedBuffers> but forgot
2423         to enforce the concept that Vector<char>'s always exist, whereas RefPtr<SharedBuffers>
2424         can be null.  This led to derefs.
2425
2426         I took the opportunity to rework the iconDB functions to live in a SharedBuffer 
2427         world, as that didn't exist when they were originally written - now they just return
2428         SharedBuffers instead of taking a Vector<char>& as a parameter
2429
2430         * loader/icon/IconDatabase.cpp:
2431         (WebCore::IconDatabase::imageDataForIconURL): Return a SharedBuffer
2432         (WebCore::IconDatabase::iconForPageURL): Null check the SharedBuffer before asking
2433           it if it's empty
2434         (WebCore::IconDatabase::imageDataForIconURLQuery): Return a new SharedBuffer
2435
2436         * loader/icon/IconDatabase.h: Return SharedBuffer's instead of taking Vector<char>&'s
2437
2438 2007-03-20  Adam Roben  <aroben@apple.com>
2439
2440         Rubberstamped by Adele.
2441
2442         Roll out r20348 because it was causing crashes.
2443
2444         * page/FrameView.cpp:
2445         (WebCore::FrameViewPrivate::FrameViewPrivate):
2446         (WebCore::FrameView::layout):
2447         (WebCore::FrameView::scheduleEvent):
2448
2449 2007-03-20  Timothy Hatcher  <timothy@apple.com>
2450
2451         Reviewed by Kevin Decker.
2452
2453         Rolling out part of r19828 that caused a scrolling regression in Mail.
2454
2455         <rdar://problem/4820817> Message jumps around when trying to select text
2456
2457         * platform/mac/ScrollViewMac.mm:
2458         (WebCore::ScrollView::visibleContentRect):
2459         (WebCore::ScrollView::updateContents):
2460
2461 2007-03-20  Brady Eidson  <beidson@apple.com>
2462
2463         Reviewed by John
2464
2465         <rdar://5071341> - Crash in IconLoader::finishLoading()
2466         
2467         Though the reproducibility of the crash is still elusive, there's been a crasher likely uncovered 
2468         Hyatt's recent caching changings to the IconLoader.  This crash tends to hit on sites without favicons,
2469         that serve up complex 404 pages, often when the load is cancelled or redirected.  Occasionally, it *seems*
2470         the IconLoader is getting failed/cancelled twice.
2471         
2472         This patch adds some assertions and a "fail gracefully in a release build" check that will have to
2473         serve us until we know more about the cause.
2474
2475         * loader/icon/IconLoader.cpp:
2476         (WebCore::IconLoader::didFail): Add an assertion to catch this case
2477         (WebCore::IconLoader::finishLoading): Add an assertion to catch the case, and fail
2478           gracefully in debug builds.  Also add an efficiency check to not commit to the DB if there is no
2479           IconURL
2480
2481 2007-03-20  Antti Koivisto  <antti@apple.com>
2482
2483         Reviewed by Darin.
2484
2485         - fix http://bugs.webkit.org/show_bug.cgi?id=10747
2486         REGRESSION: Using two fingers on a trackpad to scroll inside a text area makes the whole page move
2487         <rdar://problem/5045710>
2488         
2489         Eat smooth scroll events in WebCore if pointer is over scrollable area. Not
2490         really a good fix, smooth scrolling should be supported properly. It should do for now.
2491
2492         * page/EventHandler.cpp:
2493         (WebCore::EventHandler::handleWheelEvent):
2494         * rendering/RenderListBox.cpp:
2495         (WebCore::RenderListBox::isScrollable):
2496         * rendering/RenderListBox.h:
2497         * rendering/RenderObject.cpp:
2498         (WebCore::RenderObject::isScrollable):
2499         * rendering/RenderObject.h:
2500         * rendering/RenderTextControl.cpp:
2501         (WebCore::RenderTextControl::isScrollable):
2502         * rendering/RenderTextControl.h:
2503
2504 2007-03-20  Beth Dakin  <bdakin@apple.com>
2505
2506         Reviewed by Geoff.
2507
2508         Covered by existing test case.
2509
2510         Fix for <rdar://problem/5072678> Crash in 
2511         RenderLayer::scrollRectToVisible with MallocScribble enabled
2512
2513         This removes some code that was added with http://bugs.webkit.org/
2514         show_bug.cgi?id=8360. This code was not needed to fix that bug, but 
2515         the idea behind it was that there are times when it is safe for 
2516         scheduleEvent() to propagate the event immediately. The 
2517         MallocScribble crash revealed that this assumption was a bit too 
2518         broad; the cause of the crash was that we were propagating events 
2519         immediately when it was not safe. Mitz and I discussed this online 
2520         and we agree that the safest solution is to revert to the old 
2521         behavior here, and always delay the propagation of the event. 
2522
2523         * page/FrameView.cpp:
2524         (WebCore::FrameViewPrivate::FrameViewPrivate):
2525         (WebCore::FrameView::layout):
2526         (WebCore::FrameView::scheduleEvent):
2527
2528 2007-03-20  Brady Eidson  <beidson@apple.com>
2529
2530         Reviewed by John Sullivan
2531
2532         Add some very helpful logging to the IconLoader's SubresourceLoaderClient impl.
2533
2534         * loader/icon/IconLoader.cpp:
2535         (WebCore::IconLoader::didReceiveResponse):
2536         (WebCore::IconLoader::didReceiveData):
2537         (WebCore::IconLoader::didFail):
2538         (WebCore::IconLoader::didFinishLoading):
2539
2540 2007-03-20  Justin Garcia  <justin.garcia@apple.com>
2541
2542         Reviewed by darin
2543
2544         <rdar://problem/5071074> 
2545         REGRESSION: Links are pasted as plain text at certain positions
2546         
2547         moveParagraphs calls createMarkup without annotation, which leaves
2548         out anchor elements that aren't fully selected.
2549
2550         * editing/CompositeEditCommand.cpp:
2551         (WebCore::CompositeEditCommand::moveParagraphs): We don't want 
2552         createMarkup to do full annotation here.  Doing so could include 
2553         special ancestor blocks, which would prevent the copied content 
2554         from appearing in the destination paragraph when it's re-inserted.  
2555         Annotation would also inline styles from style sheets,  which is 
2556         unnecessary because the content is being moved to the same 
2557         document it's being moved from.
2558         Added a new bool to createMarkup that when true allows markup for 
2559         special ancestors as long as they are inline when annotation is off.
2560         * editing/markup.cpp:
2561         (WebCore::createMarkup): Don't set specialCommonAncestor if annotation
2562         is off, unless it's inline and we've been told it's ok to include such
2563         elements.
2564         * editing/markup.h:
2565
2566 2007-03-20  Alexey Proskuryakov  <ap@webkit.org>
2567
2568         Reviewed by Darin.
2569
2570         http://bugs.webkit.org/show_bug.cgi?id=12497
2571         Implement XPath result ordering.
2572
2573         XPath::NodeVector typedef is replaced with a real XPath::NodeSet class that knows how 
2574         to sort itself, and can remember whether it has been already sorted.
2575
2576         * CMakeLists.txt:
2577         * WebCore.pro:
2578         * WebCore.xcodeproj/project.pbxproj:
2579         * WebCoreSources.bkl:
2580         Added XPathNodeSet files.
2581
2582         * xml/XPathExpression.cpp: Fixed includes.
2583
2584         * xml/XPathFunctions.cpp:
2585         (WebCore::XPath::FunId::evaluate): Mark the resulting node-set as unsorted.
2586         (WebCore::XPath::FunLocalName::evaluate): Replacing NodeVector with NodeSet.
2587         (WebCore::XPath::FunNamespaceURI::evaluate): Ditto.
2588         (WebCore::XPath::FunName::evaluate): Ditto.
2589         (WebCore::XPath::FunCount::evaluate): Ditto.
2590         (WebCore::XPath::FunSum::evaluate): Ditto.
2591
2592         * xml/XPathNodeSet.cpp: Added.
2593         (WebCore::XPath::parentWithDepth):
2594         (WebCore::XPath::sortBlock):
2595         (WebCore::XPath::NodeSet::sort): Sort the node-set in document order.
2596         (WebCore::XPath::NodeSet::reverse): Reverse the order (useful for making axes such as 
2597         parent or ancestor sorted).
2598         (WebCore::XPath::NodeSet::firstNode): Returns the first node in document order; currently
2599         implemented via fully sorting the node-set, but this can obviously be optimized.
2600         (WebCore::XPath::NodeSet::anyNode): Added for symmetry with firstNode().
2601         
2602         * xml/XPathNodeSet.h: Added.
2603         (WebCore::XPath::NodeSet::NodeSet):
2604         (WebCore::XPath::NodeSet::operator=):
2605         (WebCore::XPath::NodeSet::size):
2606         (WebCore::XPath::NodeSet::isEmpty):
2607         (WebCore::XPath::NodeSet::operator[]):
2608         (WebCore::XPath::NodeSet::reserveCapacity):
2609         (WebCore::XPath::NodeSet::clear):
2610         (WebCore::XPath::NodeSet::swap):
2611         (WebCore::XPath::NodeSet::append):
2612         (WebCore::XPath::NodeSet::markSorted):
2613         (WebCore::XPath::NodeSet::isSorted):
2614         Most of these methods just call Vector counterparts. 
2615
2616         * xml/XPathParser.cpp: Updated the copyright notice.
2617
2618         * xml/XPathPath.cpp:
2619         (WebCore::XPath::Filter::evaluate): Replacing NodeVector with NodeSet.
2620         (WebCore::XPath::Path::evaluate): Ditto.
2621         (WebCore::XPath::LocationPath::evaluate): Replacing NodeVector with NodeSet. This function
2622         always marks the result as unsorted, because it is hard to tell whether a step breaks node order.
2623         Identifying and implementing special cases when it is not necessary to do so is an important
2624         future optimization.
2625
2626         * xml/XPathPath.h: Replacing NodeVector with NodeSet.
2627         * xml/XPathPredicate.cpp:
2628         (WebCore::XPath::EqTestOp::compare): Replacing NodeVector with NodeSet.
2629         (WebCore::XPath::Union::evaluate): Replacing NodeVector with NodeSet. Currently, Union just
2630         marks the result as unordered; we can consider using merge sort to avoid this.
2631
2632         * xml/XPathResult.cpp:
2633         (WebCore::XPathResult::XPathResult): Replacing NodeVector with NodeSet.
2634         (WebCore::XPathResult::singleNodeValue): Ditto.
2635         (WebCore::XPathResult::snapshotLength): Ditto.
2636         (WebCore::XPathResult::iterateNext): Ditto.
2637         (WebCore::XPathResult::snapshotItem): Ditto.
2638         (WebCore::XPathResult::convertTo): Ditto. Sort the result when requested to.
2639
2640         * xml/XPathResult.h: Replacing NodeVector with NodeSet.
2641
2642         * xml/XPathStep.cpp:
2643         (WebCore::XPath::Step::evaluate): If the input is not sorted, mark the output as such, too.
2644         (WebCore::XPath::Step::nodesInAxis): Fixed a number of bugs when enumerating with an
2645         attribute context node.
2646         (WebCore::XPath::Step::nodeTestMatches): Replacing NodeVector with NodeSet.
2647         * xml/XPathStep.h: Ditto.
2648
2649         * xml/XPathUtil.cpp:
2650         (WebCore::XPath::isValidContextNode): XPath data model doesn't put attribute data into child
2651         nodes, so passing such node as a context could cause problems.
2652
2653         * xml/XPathUtil.h: Removed NodeVector typedef.
2654
2655         * xml/XPathValue.cpp:
2656         (WebCore::XPath::Value::Value):
2657         (WebCore::XPath::Value::toNodeSet):
2658         (WebCore::XPath::Value::toBoolean):
2659         (WebCore::XPath::Value::toNumber):
2660         (WebCore::XPath::Value::toString):
2661         * xml/XPathValue.h:
2662         (WebCore::XPath::Value::):
2663         (WebCore::XPath::Value::isNodeSet):
2664         Replacing NodeVector with NodeSet.
2665
2666 2007-03-21  Mark Rowe  <mrowe@apple.com>
2667
2668         Build fix.
2669
2670         * bindings/objc/WebScriptObject.mm:
2671         (-[WebScriptObject methodForSelector:]):
2672         (-[WebScriptObject respondsToSelector:]):
2673
2674 2007-03-21  Mark Rowe  <mrowe@apple.com>
2675
2676         Reviewed by Tim Hatcher.
2677
2678         Fix for http://bugs.webkit.org/show_bug.cgi?id=13129.
2679         Bug 13129: Democracy Player dies in NSException from WebScriptObject on startup.
2680
2681         Some cross-language scripting bridges use the presence of -(int)count to determine
2682         whether to treat objects as sequence-like.  All WebScriptObject's exposed this method
2683         which lead to non-collection WebScriptObject's being mishandled by PyObjC.  We now
2684         expose -count only when the object we wrap looks like a collection from a JavaScript
2685         point of view (eg, it has a length property).
2686
2687         * bindings/objc/WebScriptObject.mm:
2688         (-[WebScriptObject _shouldRespondToCount]):
2689         (-[WebScriptObject methodForSelector:]):
2690         (-[WebScriptObject respondsToSelector:]):
2691         (-[WebScriptObject _count]):
2692         * bindings/objc/WebScriptObjectPrivate.h:
2693
2694 2007-03-20  Darin Adler  <darin@apple.com>
2695
2696         * page/EventHandler.cpp: (WebCore::EventHandler::handleMouseMoveEvent):
2697         Fix obvious typo in the change from last night -- forgot to assign to the variable.
2698
2699 2007-03-20  Dave Hyatt  <hyatt@apple.com>
2700
2701         Refactor fonts a bit for portability.
2702        
2703         Reviewed by aroben
2704
2705         * platform/Font.cpp:
2706         (WebCore::Font::drawSimpleText):
2707         (WebCore::Font::drawGlyphBuffer):
2708         (WebCore::Font::floatWidthForSimpleText):
2709         * platform/Font.h:
2710         * platform/FontData.h:
2711         (WebCore::FontData::isSystemFont):
2712         (WebCore::FontData::scriptCache):
2713         * platform/GlyphBuffer.h:
2714         (WebCore::GlyphBuffer::add):
2715
2716 2007-03-20  Anders Carlsson  <acarlsson@apple.com>
2717
2718         Reviewed by Adam.
2719
2720         Stub out a couple of CFNetwork backend functions.
2721         
2722         * platform/network/ResourceHandle.h:
2723
2724 2007-03-19  Oliver Hunt  <oliver@apple.com>
2725
2726         Reviewed by Ada.
2727
2728         Protect against possibility of JS detaching a frame (and losing its view)
2729         midway through a mouse move.
2730
2731         * page/EventHandler.cpp:
2732         (WebCore::EventHandler::handleMouseMoveEvent):
2733
2734 2007-03-19  Alexey Proskuryakov  <ap@webkit.org>
2735
2736         Reviewed by Darin.
2737
2738         http://bugs.webkit.org/show_bug.cgi?id=13107
2739         XPath should raise an exception when trying to parse an unknown function
2740
2741         Test: fast/xpath/invalid-functions.html
2742
2743         * xml/XPathFunctions.cpp:
2744         (WebCore::XPath::createFunction): Return 0 if the function couldn't be created.
2745         * xml/XPathGrammar.y: Handle nulls returned from createFunction().
2746
2747 2007-03-19  Adele Peterson  <adele@apple.com>
2748
2749         Reviewed by Beth.
2750
2751         Fix for http://bugs.webkit.org/show_bug.cgi?id=13087
2752         <rdar://problem/5064316> REGRESSION: Allow setting the checked attribute in js and in markup for unnamed radio buttons (dominos.com)
2753
2754         Test: fast/forms/radio_checked_name.html
2755
2756         We were matching a WinIE quirk that does not allow a user to check and uncheck an unnamed radio button.  But they still
2757         allow the checked attribute to be set in html, and changed in javascript.  So this change matches that behavior.
2758
2759         * html/HTMLInputElement.cpp:
2760         (WebCore::HTMLInputElement::parseMappedAttribute): We no longer need a special call to setChecked when parsing the name
2761          attribute, since we setChecked will now work with unnamed radio buttons.
2762         (WebCore::HTMLInputElement::preDispatchEventHandler): Added comment.
2763         (WebCore::HTMLInputElement::setChecked): Don't check for the unnamed radio button case here.
2764         (WebCore::HTMLInputElement::postDispatchEventHandler): Don't call setChecked for unnamed radio buttons.
2765         (WebCore::HTMLInputElement::defaultEventHandler): ditto.
2766
2767 2007-03-19  Adam Roben  <aroben@apple.com>
2768
2769         Rubberstamped by Oliver.
2770
2771         * bridge/JavaScriptStatistics.cpp: Added missing header for
2772         correctness.
2773
2774 2007-03-19  Andrew Wellington  <proton@wiretapped.net>
2775
2776         Reviewed by Maciej.
2777
2778         Really set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
2779
2780         * WebCore.xcodeproj/project.pbxproj:
2781
2782 2007-03-19  Justin Garcia  <justin.garcia@apple.com>
2783
2784         Reviewed by darin
2785         
2786         <rdar://problem/5071074> 
2787         REGRESSION: Links that aren't fully selected copy and paste as only text
2788         
2789         We stopped adding markup for all commonAncestorBlocks
2790         and the ancestors of lastClosed up to them because it 
2791         was adding a lot of unnecessary markup.
2792
2793         * editing/markup.cpp:
2794         (WebCore::createMarkup): Also include markup for nodes
2795         up to an enclosing anchor.  Cleaned up the code for
2796         including special common ancestors a bit.
2797
2798 2007-03-19  Nikolas Zimmermann  <zimmermann@kde.org>
2799
2800         Reviewed by Lars Knoll.
2801
2802         Fix crash when opening a SVG document which contains SVG elements, but no <svg> root element.
2803         Moving the mouse was crashing WebKit. Fixes svg/hixie/dynamic/006.xml.
2804
2805         * rendering/RenderObject.cpp:
2806         (WebCore::RenderObject::updateHitTestResult):
2807
2808 2007-03-19  Mitz Pettel  <mitz@webkit.org>
2809
2810         Reviewed by Hyatt.
2811
2812         - fix http://bugs.webkit.org/show_bug.cgi?id=13117
2813         REGRESSION (r14658): Flickering text fields when updating via javascript
2814
2815         * page/Frame.cpp:
2816         (WebCore::Frame::forceLayout): Added a flag to allow partial relayout.
2817         * page/Frame.h:
2818         * page/mac/WebCoreFrameBridge.mm:
2819         (-[WebCoreFrameBridge forceLayoutAdjustingViewSize:]): Allow partial relayout
2820         if not adjusting view size.
2821         (-[WebCoreFrameBridge needsLayout]): Changed to check for pending subtree
2822         layout instead of just whether the root needs layout.
2823
2824 2007-03-18  Nikolas Zimmermann  <zimmermann@kde.org>
2825
2826         Reviewed by Maciej.
2827
2828         Make JS function calls on POD-types (ie. SVGLength) take effect.
2829         Calling ie. newValueInSpecifiedUnits on SVGLength works as expected.
2830
2831         This worked fine before we switched to SVGLength POD type, so this
2832         can be considered as P1 regression fix.
2833
2834         Partly fix svg/hixie/dynamic/005-broken.svg. We match Opera now though
2835         it's not yet completly fixed. Setting baseVal attribute on SVGAnimatedString
2836         doesn't work as expected - needs a seperated fix.
2837
2838         * bindings/scripts/CodeGeneratorJS.pm:
2839
2840 2007-03-19  Adele Peterson  <adele@apple.com>
2841
2842         Reviewed by Adam.
2843
2844         Adding comments and a little cleanup from my last checkin.
2845
2846         * html/HTMLSelectElement.cpp:
2847         (WebCore::HTMLSelectElement::setSelectedIndex): Removed commented out assert.  Added comment about how we use onChange.
2848         (WebCore::HTMLSelectElement::selectAll): Added comment about how we use saveLastSelection and onChange.
2849         (WebCore::HTMLSelectElement::dispatchFocusEvent): ditto.
2850         (WebCore::HTMLSelectElement::dispatchBlurEvent): ditto.
2851         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): ditto.
2852         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): ditto.
2853         (WebCore::HTMLSelectElement::menuListOnChange): Added assert that usesMenuList() is true.
2854         (WebCore::HTMLSelectElement::listBoxOnChange): Added assert that usesMenuList() is false.
2855         (WebCore::HTMLSelectElement::saveLastSelection): Added early return for menu lists.
2856
2857 2007-03-19  Mitz Pettel  <mitz@webkit.org>
2858
2859         Reviewed by Tim Hatcher.
2860
2861         - fix http://bugs.webkit.org/show_bug.cgi?id=13091
2862           REGRESSION (r20075): Wrong text style and pixel break in Apple Store Locator HUD
2863
2864         Test: fast/innerHTML/additional-inline-style.html
2865
2866         * editing/markup.cpp:
2867         (WebCore::startMarkup): Changed to add inline style based on CSS rules only
2868         in AnnotateForInterchange mode.
2869
2870 2007-03-19  Zack Rusin  <zrusin@trolltech.com>
2871
2872         Compile fix.
2873
2874         * platform/qt/ScrollViewQt.cpp:
2875         (WebCore::ScrollView::update):
2876
2877 2007-03-19  Adam Roben  <aroben@apple.com>
2878
2879         Reviewed by Hyatt and Maciej.
2880
2881         Renamed WebCoreJavaScript to JavaScriptStatistics and made it C++ as
2882         part of <rdar://problem/5071653>.
2883
2884         All layout tests pass.
2885
2886         * WebCore.exp: Updated.
2887         * WebCore.xcodeproj/project.pbxproj: Updated.
2888         * bridge/JavaScriptStatistics.cpp: Moved from
2889         bridge/mac/WebCoreJavaScript.mm, and converted to C++.
2890         (WebCore::collect):
2891         (WebCore::JavaScriptStatistics::objectCount):
2892         (WebCore::JavaScriptStatistics::interpreterCount):
2893         (WebCore::JavaScriptStatistics::protectedObjectCount):
2894         (WebCore::JavaScriptStatistics::rootObjectTypeCounts):
2895         (WebCore::JavaScriptStatistics::garbageCollect):
2896         (WebCore::JavaScriptStatistics::garbageCollectOnAlternateThread):
2897         (WebCore::JavaScriptStatistics::shouldPrintExceptions):
2898         (WebCore::JavaScriptStatistics::setShouldPrintExceptions):
2899         * bridge/JavaScriptStatistics.h: Added.
2900         * bridge/mac/WebCoreJavaScript.h: Removed.
2901         * bridge/mac/WebCoreJavaScript.mm: Removed.
2902
2903 2007-03-18  Maciej Stachowiak  <mjs@apple.com>
2904
2905         Reviewed by Mark.
2906
2907         - avoid static construction (and global variable access) in a smarter, more portable way,
2908         to later enable MUTLI_THREAD mode to work on other platforms and compilers.
2909         
2910         * bindings/js/JSCustomXPathNSResolver.cpp:
2911         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
2912         * bindings/js/JSHTMLInputElementBase.cpp:
2913         (WebCore::JSHTMLInputElementBaseFunction::JSHTMLInputElementBaseFunction):
2914         * bindings/js/JSHTMLOptionElementConstructor.cpp:
2915         (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor):
2916         * bindings/js/JSXMLHttpRequest.cpp:
2917         (KJS::JSXMLHttpRequestConstructorImp::JSXMLHttpRequestConstructorImp):
2918         * bindings/js/JSXSLTProcessor.cpp:
2919         (KJS::XSLTProcessorConstructorImp::XSLTProcessorConstructorImp):
2920         * bindings/js/kjs_dom.cpp:
2921         (KJS::DOMNamedNodeMap::getOwnPropertySlot):
2922         (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
2923         * bindings/js/kjs_events.cpp:
2924         (KJS::JSAbstractEventListener::handleEvent):
2925         * bindings/js/kjs_html.cpp:
2926         (KJS::HTMLElementFunction::HTMLElementFunction):
2927         (KJS::JSHTMLCollection::getOwnPropertySlot):
2928         * bindings/js/kjs_window.cpp:
2929         (KJS::ScheduledAction::execute):
2930         * bindings/objc/WebScriptObject.mm:
2931         * bindings/scripts/CodeGeneratorJS.pm:
2932
2933 2007-03-18  Andrew Wellington  <proton@wiretapped.net>
2934
2935         Reviewed by Mark Rowe
2936
2937         Set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
2938
2939         * WebCore.xcodeproj/project.pbxproj:
2940
2941 2007-03-18  David Hyatt  <hyatt@apple.com>
2942
2943         Fix for REGRESSION bug 13108, frame borders being painted when they shouldn't be.  Rework both frame borders
2944         and resizing to be more like other browsers.
2945
2946         Reviewed by ggaren
2947
2948         fast/frames/no-frame-borders.html
2949
2950         * html/HTMLFrameElement.cpp:
2951         (WebCore::HTMLFrameElement::HTMLFrameElement):
2952         (WebCore::HTMLFrameElement::attach):
2953         (WebCore::HTMLFrameElement::parseMappedAttribute):
2954         * html/HTMLFrameElement.h:
2955         (WebCore::HTMLFrameElement::hasFrameBorder):
2956         * html/HTMLFrameElementBase.cpp:
2957         (WebCore::HTMLFrameElementBase::HTMLFrameElementBase):
2958         (WebCore::HTMLFrameElementBase::parseMappedAttribute):
2959         * html/HTMLFrameElementBase.h:
2960         * html/HTMLFrameSetElement.cpp:
2961         (WebCore::HTMLFrameSetElement::attach):
2962         * html/HTMLFrameSetElement.h:
2963         (WebCore::HTMLFrameSetElement::hasFrameBorder):
2964         * html/HTMLIFrameElement.cpp:
2965         (WebCore::HTMLIFrameElement::HTMLIFrameElement):
2966         * rendering/RenderFrame.cpp:
2967         (WebCore::RenderFrame::edgeInfo):
2968         * rendering/RenderFrame.h:
2969         * rendering/RenderFrameSet.cpp:
2970         (WebCore::RenderFrameSet::paint):
2971         (WebCore::RenderFrameSet::GridAxis::resize):
2972         (WebCore::RenderFrameSet::fillFromEdgeInfo):
2973         (WebCore::RenderFrameSet::computeEdgeInfo):
2974         (WebCore::RenderFrameSet::edgeInfo):
2975         (WebCore::RenderFrameSet::layout):
2976         (WebCore::RenderFrameSet::startResizing):
2977         (WebCore::RenderFrameSet::continueResizing):
2978         (WebCore::RenderFrameSet::canResizeRow):
2979         (WebCore::RenderFrameSet::canResizeColumn):
2980         (WebCore::RenderFrameSet::splitPosition):
2981         (WebCore::RenderFrameSet::hitTestSplit):
2982         (WebCore::RenderFrameSet::dump):
2983         * rendering/RenderFrameSet.h:
2984         (WebCore::):
2985         (WebCore::FrameEdgeInfo::FrameEdgeInfo):
2986         (WebCore::FrameEdgeInfo::preventResize):
2987         (WebCore::FrameEdgeInfo::allowBorder):
2988         (WebCore::FrameEdgeInfo::setPreventResize):
2989         (WebCore::FrameEdgeInfo::setAllowBorder):
2990
2991 2007-03-19  Mark Rowe  <mrowe@apple.com>
2992
2993         Rubber-stamped by Brady.
2994
2995         Update references to bugzilla.opendarwin.org with bugs.webkit.org.
2996
2997         * ChangeLog:
2998         * WebCore.vcproj/WebCore/build-generated-files.sh:
2999         * manual-tests/ATSU-bad-layout.html:
3000         * manual-tests/accidental-strict-mode.html:
3001         * manual-tests/applet-param-no-name.html:
3002         * manual-tests/bidi-parens.html:
3003         * manual-tests/bugzilla-3855.html:
3004         * manual-tests/bugzilla-4840.html:
3005         * manual-tests/bugzilla-6821.html:
3006         * manual-tests/containing-block-position-chage.html:
3007         * manual-tests/contenteditable-link.html:
3008         * manual-tests/css3-cursor-fallback-quirks.html:
3009         * manual-tests/css3-cursor-fallback-strict.html:
3010         * manual-tests/custom-cursors.html:
3011         * manual-tests/dictionary-scrolled-iframe.html:
3012         * manual-tests/dom-manipulation-on-resize.html:
3013         * manual-tests/drag-image-to-address-bar.html:
3014         * manual-tests/empty-link-target.html:
3015         * manual-tests/empty-title-popup.html:
3016         * manual-tests/first-line-style-crash.html:
3017         * manual-tests/invalid-mouse-event.html:
3018         * manual-tests/left-overflow-repaint.html:
3019         * manual-tests/linkjump-3.html:
3020         * manual-tests/log-keypress-events.html:
3021         * manual-tests/named-window-blank-target.html:
3022         * manual-tests/plain-text-paste.html:
3023         * manual-tests/plugin-controller-datasource.html:
3024         * manual-tests/pre-tab-selection-rect.html:
3025         * manual-tests/redirection-target.html:
3026         * manual-tests/redraw-page-cache-visited-links.html:
3027         * manual-tests/reset-initiatedDrag.html:
3028         * manual-tests/resources/named-window-blank-target-step2.html:
3029         * manual-tests/resources/named-window-blank-target-step3.html:
3030         * manual-tests/resources/named-window-blank-target-step4.html:
3031         * manual-tests/resources/redraw-page-cache-visited-links-2.html:
3032         * manual-tests/scrollbar-hittest.html:
3033         * manual-tests/scrollbar-hittest2.html:
3034         * manual-tests/subview-click-assertion.html:
3035         * manual-tests/tabbing-input-google.html:
3036         * manual-tests/text-field-autoscroll.html:
3037         * manual-tests/textarea-after-stylesheet-link.html:
3038         * manual-tests/textarea-focus.html:
3039         * manual-tests/whitespace-pre-affinity.html:
3040
3041 2007-03-18  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3042
3043         Not reviewed - gdk build fix.
3044
3045         * platform/gdk/ScrollViewGdk.cpp:
3046         (WebCore::ScrollView::update): add a stub
3047
3048 2007-03-18  Brady Eidson  <beidson@apple.com>
3049
3050         Reviewed by Hyatt
3051
3052         http://bugs.webkit.org/show_bug.cgi?id=13111
3053         When stopped a load before it completes, partial images become the 
3054         broken image icon
3055
3056         * loader/loader.cpp:
3057         (WebCore::Loader::didFail): Split off into a method that knows the 
3058           difference between failed and cancelled.  If a load is cancelled,
3059           don't call error() on the object - only remove it from the cache
3060         (WebCore::Loader::cancelRequests): Call didFail(loader, true)
3061         * loader/loader.h: Added didFail(SubresourceLoader*, bool cancelled)
3062
3063 2007-03-18  Mitz Pettel  <mitz@webkit.org>
3064
3065         Reviewed by Adele.
3066
3067         - fix http://bugs.webkit.org/show_bug.cgi?id=13101
3068           REGRESSION (NativeTextField): Specifying word-wrap:break-word makes text field wrap
3069
3070         Test: fast/forms/input-text-word-wrap.html
3071
3072         * rendering/RenderTextControl.cpp:
3073         (WebCore::RenderTextControl::createInnerTextStyle): Force the inner block to
3074         'word-wrap:normal'.
3075
3076 2007-03-18  Dan Waylonis  <waylonis@mac.com>
3077
3078         Reviewed by Tim Hatcher.
3079
3080         Fix http://bugs.webkit.org/show_bug.cgi?id=13005
3081         Bug 13005: WebScriptObject +throwException needs NULL check.
3082
3083         Add checking for NULL interpreter before throwing exception.
3084
3085         * bindings/objc/WebScriptObject.mm:
3086         (+[WebScriptObject throwException:]):
3087
3088 2007-03-18  Geoffrey Garen  <ggaren@apple.com>
3089
3090         Reviewed by Oliver Hunt.
3091         
3092         Fixed http://bugs.webkit.org/show_bug.cgi?id=13106
3093         REGRESSION: Incomplete document.all implementation breaks abtelectronics.com 
3094         (Style Change Through JavaScript Blanks Content)
3095         
3096         When indexing into collections, treat the empty string as an invalid argument,
3097         instead of the number 0.
3098
3099         * bindings/js/kjs_html.cpp:
3100         (KJS::JSHTMLCollection::getOwnPropertySlot):
3101         (KJS::JSHTMLCollection::callAsFunction):
3102         (KJS::JSHTMLCollectionPrototypeFunction::callAsFunction):
3103
3104 2007-03-18  David Hyatt  <hyatt@apple.com>
3105
3106         Use fillRect instead of drawLine, since drawLine has some odd behavior (it's only used for borders).
3107
3108         Reviewed by aroben
3109
3110         * platform/graphics/IntRect.h:
3111         * rendering/RenderFrameSet.cpp:
3112         (WebCore::RenderFrameSet::paintColumnBorder):
3113         (WebCore::RenderFrameSet::paintRowBorder):
3114
3115 2007-03-18  David Hyatt  <hyatt@apple.com>
3116
3117         Change the frameborder color to be light gray for framesets.
3118
3119         Reviewed by aroben
3120
3121         * rendering/RenderFrameSet.cpp:
3122         (WebCore::borderFillColor):
3123         (WebCore::RenderFrameSet::paintColumnBorder):
3124         (WebCore::RenderFrameSet::paintRowBorder):
3125
3126 2007-03-18  David Hyatt  <hyatt@apple.com>
3127
3128         Make iframes work properly with frameborder="0".
3129
3130         Reviewed by aroben
3131
3132         * html/HTMLIFrameElement.cpp:
3133         (WebCore::HTMLIFrameElement::mapToEntry):
3134         (WebCore::HTMLIFrameElement::parseMappedAttribute):
3135
3136 2007-03-18  David Hyatt  <hyatt@apple.com>
3137
3138         Add a 2px border by default to <iframe>s for compatibility with other browsers.
3139
3140         Reviewed by aroben
3141
3142         * css/html4.css:
3143
3144 2007-03-18  David Hyatt  <hyatt@apple.com>
3145
3146         Move frame borders out of WebKit and into WebCore.
3147
3148         Reviewed by aroben, olliej
3149
3150         * bridge/mac/FrameViewMac.mm:
3151         * css/html4.css:
3152         * html/HTMLFrameSetElement.cpp:
3153         (WebCore::HTMLFrameSetElement::HTMLFrameSetElement):
3154         (WebCore::HTMLFrameSetElement::mapToEntry):
3155         (WebCore::HTMLFrameSetElement::parseMappedAttribute):
3156         (WebCore::HTMLFrameSetElement::attach):
3157         * html/HTMLFrameSetElement.h:
3158         (WebCore::HTMLFrameSetElement::hasBorderColor):
3159         * page/FrameView.cpp:
3160         (WebCore::FrameViewPrivate::FrameViewPrivate):
3161         * page/FrameView.h:
3162         * page/mac/WebCoreFrameBridge.h:
3163         * platform/graphics/IntRect.h:
3164         (WebCore::IntRect::topLeft):
3165         (WebCore::IntRect::topRight):
3166         (WebCore::IntRect::bottomLeft):
3167         (WebCore::IntRect::bottomRight):
3168         * rendering/RenderFrame.cpp:
3169         (WebCore::RenderFrame::viewCleared):
3170         * rendering/RenderFrameSet.cpp:
3171         (WebCore::borderStartEdgeColor):
3172         (WebCore::borderEndEdgeColor):
3173         (WebCore::RenderFrameSet::paintColumnBorder):
3174         (WebCore::RenderFrameSet::paintRowBorder):
3175         (WebCore::RenderFrameSet::paint):
3176         * rendering/RenderFrameSet.h:
3177         * rendering/RenderPartObject.cpp:
3178         (WebCore::RenderPartObject::viewCleared):
3179         * rendering/RenderView.cpp:
3180         (WebCore::RenderView::repaintViewRectangle):
3181
3182 2007-03-17  David Hyatt  <hyatt@apple.com>
3183
3184         Make onload do an explicit paint when a top-level document is ready (to ensure that a first paint always
3185         happens before any timers set by the onload can fire).
3186
3187         Reviewed by aroben
3188
3189         * dom/Document.cpp:
3190         (WebCore::Document::implicitClose):
3191         * platform/ScrollView.h:
3192         * platform/mac/ScrollViewMac.mm:
3193         (WebCore::ScrollView::update):
3194
3195 2007-03-17  Dave Hyatt  <hyatt@apple.com>
3196
3197         Prevent starvation of user input and painting when processing timers.
3198         If we are already in the processing of a custom timer message, don't allow that
3199         processing to do another PostMessage.  Force SetTimer to be used instead.
3200       
3201         Reviewed by ggaren
3202
3203        * platform/win/SharedTimerWin.cpp:
3204         (WebCore::TimerWindowWndProc):
3205         (WebCore::setSharedTimerFireTime):
3206
3207 2007-03-17  Geoffrey Garen  <ggaren@apple.com>
3208
3209         Reviewed by Beth Dakin.
3210
3211         Fixed <rdar://problem/5070967> REGRESSION (r20211): Repro crash when 
3212         closing View Source window
3213         
3214         I award myself 0 points, and may God have mercy on my soul.
3215
3216         * bindings/js/kjs_proxy.cpp:
3217         (WebCore::KJSProxy::~KJSProxy):
3218
3219 2007-03-17  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3220
3221         Not reviewed - gdk build fix.
3222
3223         * platform/gdk/TemporaryLinkStubs.cpp:
3224         (Pasteboard::writeURL):
3225
3226 2007-03-17  David Hyatt  <hyatt@apple.com>
3227
3228         Fix tiny PLT regression.  Don't examine the border/background data for RenderImage when images change
3229         unless we actually have a border/background.
3230
3231         Reviewed by Brady
3232
3233         * rendering/RenderImage.cpp:
3234         (WebCore::RenderImage::imageChanged):
3235
3236 2007-03-17  Nikolas Zimmermann  <zimmermann@kde.org>
3237
3238         Reviewed by Sam Weinig.
3239
3240         Fixes: http://bugs.webkit.org/show_bug.cgi?id=13046 (CSS styles on hover and focus are broken for <use>)
3241         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12838 (SVG <use> CSS styles broken)
3242         Added test: svg/custom/use-css-events.svg
3243
3244         In general this fixes the peepo.co.uk website.
3245
3246         Forgot to pass the actual StyleChange to the recalcStyle() function,
3247         when calling it on the shadow tree root element.
3248
3249         * ksvg2/svg/SVGUseElement.cpp:
3250         (WebCore::SVGUseElement::recalcStyle):
3251
3252 2007-03-17  Timothy Hatcher  <timothy@apple.com>
3253
3254         Reviewed by Mark Rowe.
3255
3256         Made Version.xcconfig smarter when building for different configurations.
3257         Now uses the 522+ OpenSource version for Debug and Release, while using the
3258         full 522.4 version for Production builds. The system prefix is also computed
3259         based on the current system, so 4522.4 on Tiger and 5522.4 on Leopard.
3260
3261         * Configurations/Version.xcconfig:
3262         * Configurations/WebCore.xcconfig:
3263
3264 2007-03-17  Antti Koivisto  <antti@apple.com>
3265
3266         Reviewed by Adele.
3267
3268         Fix http://bugs.webkit.org/show_bug.cgi?id=12595
3269         REGRESSION: Can't add item to cart at lnt.com (JS type error)
3270         <rdar://problem/4722863>
3271         
3272         Emulate Firefox behavior where form elements accessed by a name
3273         can be accessed with that name later even if the name changes or
3274         even if element is removed from the document.
3275         
3276         This is loosely based on Darin's earlier patch for the same problem but
3277         is much less expansive. It takes somewhat different approach to more closely
3278         mimic Firefox behavior. Includes expanded test case.
3279
3280         * bindings/js/JSHTMLFormElementCustom.cpp:
3281         (WebCore::JSHTMLFormElement::canGetItemsForName):
3282             Use new the HTMLFormElement::getNamedElements() method
3283         (WebCore::JSHTMLFormElement::nameGetter):
3284             Use new the HTMLFormElement::getNamedElements() method
3285         * html/HTMLFormElement.cpp:
3286         (WebCore::HTMLFormElement::HTMLFormElement):
3287         (WebCore::HTMLFormElement::~HTMLFormElement):
3288         (WebCore::HTMLFormElement::elementForAlias):
3289         (WebCore::HTMLFormElement::addElementAlias):
3290             Maintain a map of known element aliases
3291         (WebCore::HTMLFormElement::getNamedElements):
3292             Get a list of elements matching the name, based both their
3293             current names and known aliases (earlier names).
3294             Keep the alias list in sync.
3295         * html/HTMLFormElement.h:
3296
3297 2007-03-17  Adele Peterson  <adele@apple.com>
3298
3299         Reviewed by Hyatt.
3300
3301         Fix for <rdar://problem/4990050> REGRESSION: onchange gets fired when clicking on a programmatically selected element in a listbox
3302         http://bugs.webkit.org/show_bug.cgi?id=12725
3303
3304         Test: updated fast/forms/listbox-onchange.html
3305
3306         Added HTMLSelectElement::saveLastSelection that is called before changing a selection that could result
3307         in onChange being called.  m_lastOnChangeIndex and m_lastOnChangeSelection no longer have to be up-to date all the time, 
3308         they just have to be up-to-date before we execute an action that may trigger onChange.
3309
3310         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::setSelectedState): Added.
3311           The HTMLSelectElement will only set an option's selected state with this method.  This ensures
3312           that notifyOptionSelected won't get called when the call originates from the select element.
3313         * html/HTMLOptionElement.h:
3314
3315         * html/HTMLSelectElement.cpp:
3316         (WebCore::HTMLSelectElement::deselectItems): Calls setSelectedState.
3317         (WebCore::HTMLSelectElement::setSelectedIndex): ditto. Don't update the last selection variables here.  Scroll to the new selection.
3318          The scrolling call used to only be in notifyOptionSelected.  There's no reason we shouldn't scroll when the selection is set through
3319          the HTMLSelectElement.
3320         (WebCore::HTMLSelectElement::setValue): Call setSelectedIndex to update all options selected state.
3321         (WebCore::HTMLSelectElement::restoreState): Call setSelectedState.
3322         (WebCore::HTMLSelectElement::selectAll): Call saveLastSelection before making the selection, and calling onChange.
3323         (WebCore::HTMLSelectElement::recalcListItems): Call setSelectedState.  Don't need to save selection here anymore, 
3324          since it will get saved before we call onChange.
3325         (WebCore::HTMLSelectElement::reset): ditto.
3326         (WebCore::HTMLSelectElement::dispatchFocusEvent): Added. Call saveLastSelection for menu lists, since onChange can be fired
3327          on blur.
3328         (WebCore::HTMLSelectElement::dispatchBlurEvent): Call menuListOnChange.
3329         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): Call saveLastSelection before showing the popup window.
3330         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):  Call saveLastSelection during mousedown (to prepare for an 
3331          onchange during mouseup, or after autoscroll).
3332         (WebCore::HTMLSelectElement::updateListBoxSelection): Call setSelectedState.
3333
3334         (WebCore::HTMLSelectElement::menuListOnChange): Added. Compares the m_lastOnChangeIndex to the selectedIndex().
3335         (WebCore::HTMLSelectElement::listBoxOnChange): Move the m_lastOnChangeSelection creation to saveLastSelection.
3336         (WebCore::HTMLSelectElement::saveLastSelection): Added. Sets m_lastOnChangeIndex or m_lastOnChangeSelection.
3337         * html/HTMLSelectElement.h:
3338         * platform/PopupMenu.h:
3339
3340 2007-03-16  Oliver Hunt  <oliver@apple.com>
3341
3342         Reviewed by Hyatt.
3343
3344         The old canSaveAsWebArchive call was necessary as stand alone
3345         images used to be rendered by ImageDocument.
3346
3347         Fixes rdar://problem/5061252
3348
3349         * dom/Clipboard.cpp:
3350         * dom/Clipboard.h:
3351         (WebCore::Clipboard::setDragHasStarted):
3352         * page/DragClient.h:
3353         (WebCore::DragClient::declareAndWriteDragImage):
3354         * platform/mac/ClipboardMac.mm:
3355         (WebCore::ClipboardMac::declareAndWriteDragImage):
3356
3357 2007-03-16  Anders Carlsson  <acarlsson@apple.com>
3358
3359         Reviewed by Maciej.
3360
3361         <rdar://problem/4869095>
3362         default content type changed for XMLHttpRequest POSTs changed (breaks Flickrator 0.1 widget)
3363         
3364         * xml/xmlhttprequest.cpp:
3365         (WebCore::XMLHttpRequest::send):
3366
3367 2007-03-16  Brady Eidson  <beidson@apple.com>
3368
3369         Rubberstamped by Tim Hatcher
3370
3371         Update the hash table header for Window object properties
3372
3373         * bindings/js/kjs_window.cpp:
3374
3375 2007-03-16  Brady Eidson  <beidson@apple.com>
3376
3377         Reviewed by Anders
3378
3379         <rdar://problem/5061826> and
3380         http://bugs.webkit.org/show_bug.cgi?id=12863
3381         Implement window.stop()
3382
3383         * bindings/js/kjs_window.cpp:
3384         (KJS::WindowFunc::callAsFunction): Add case Window::Stop
3385         * bindings/js/kjs_window.h:
3386         (KJS::Window::): Add "Stop"
3387
3388 2007-03-16  Geoffrey Garen  <ggaren@apple.com>
3389
3390         Reviewed by Brady Eidson.
3391
3392         Fixed dir creation to account for already existing dirs and missing leading
3393         dirs in path.
3394         
3395         * loader/icon/IconDatabase.cpp:
3396         (WebCore::makeAllDirectories):
3397
3398 2007-03-16  David Hyatt  <hyatt@apple.com>
3399
3400         Fix for 13084, assertion failure in the Cache.  Convert the client list
3401         to a HashCountedSet so that multiple refs and derefs are allowed.
3402
3403         Fix RenderImage so that if it has the same image used as a background/border
3404         and as the foreground that it will repaint properly (can be tested using
3405         border-image and a foreground image).
3406
3407         Optimize list marker so that it doesn't waste time in the base class method,
3408         since list markers don't support background or border images.
3409
3410         Reviewed by andersca
3411
3412         * ChangeLog:
3413         * loader/CachedResource.cpp:
3414         (WebCore::CachedResource::ref):
3415         * loader/CachedResource.h:
3416         * loader/CachedResourceClientWalker.cpp:
3417         (WebCore::CachedResourceClientWalker::CachedResourceClientWalker):
3418         * loader/CachedResourceClientWalker.h:
3419         * rendering/RenderImage.cpp:
3420         (WebCore::RenderImage::imageChanged):
3421         * rendering/RenderListMarker.cpp:
3422         (WebCore::RenderListMarker::imageChanged):
3423
3424 2007-03-16  Geoffrey Garen  <ggaren@apple.com>
3425
3426         Reviewed by Anders Carlsson.
3427         
3428         Fixed <rdar://problem/5065399> REGRESSION: leaks in Frame::bindingRootObject 
3429         seen on buildbot
3430
3431         The problem was that we were initializing the same WebScriptObject twice.
3432         This caused it to leak its original set of ivars.
3433         
3434         I think some refactoring could prevent this situation from arising in the
3435         first place, but I'm just adding a check at the call site for now, to do 
3436         the simplest thing.
3437
3438         * bindings/objc/WebScriptObject.mm:
3439         (-[WebScriptObject _setImp:originRootObject:rootObject:]): Added ASSERTs
3440         against multiple calls.
3441
3442         * bindings/objc/WebScriptObjectPrivate.h: Renamed _initializeWithObjectImp
3443         to setImp because "init" vs "initialize" was a too subtle indication that
3444         one was a Cocoa initializer and one was not.
3445
3446 2007-03-16  Lars Knoll <lars@trolltech.com>
3447
3448         don't use #import in .cpp files.
3449
3450         * editing/qt/EditorQt.cpp:
3451
3452 2007-03-16  Lars Knoll <lars@trolltech.com>
3453
3454         Fix the Qt build once again.
3455
3456         * platform/qt/PasteboardQt.cpp:
3457         (WebCore::Pasteboard::Pasteboard):
3458         (WebCore::Pasteboard::writeSelection):
3459         (WebCore::Pasteboard::plainText):
3460         (WebCore::Pasteboard::documentFragment):
3461         (WebCore::Pasteboard::writeURL):
3462         (WebCore::Pasteboard::writeImage):
3463         (WebCore::Pasteboard::clear):
3464
3465 2007-03-15  Shrikant Gangoda  <shrikant.gangoda@celunite.com>
3466
3467         Gdk build fix.
3468
3469         * loader/gdk/FrameLoaderClientGdk.cpp:
3470         (WebCore::FrameLoaderClientGdk::blockedError):
3471         * loader/gdk/FrameLoaderClientGdk.h:
3472
3473 2007-03-15  Beth Dakin  <bdakin@apple.com>
3474
3475         Reviewed by Geoff.
3476
3477         Fix for http://bugs.webkit.org/show_bug.cgi?id=13088 REGRESSION
3478         (r19761-19779): Copy image no longer includes image address 
3479         (rdar://5067927)
3480
3481         writeURL() does not need an isImage parameter. Now that it accepts 
3482         the types as a parameter, we can just declare the appropriate image 
3483         types within writeImage and send them to writeURL(). Also, 
3484         declaring the types twice is what broke this.
3485
3486         * platform/Pasteboard.h:
3487         * platform/mac/PasteboardMac.mm:
3488         (WebCore::Pasteboard::writeURL):
3489         (WebCore::Pasteboard::writeImage):
3490
3491 2007-03-15  Adele Peterson  <adele@apple.com>
3492
3493         Reviewed by Kevin Decker.
3494
3495         Fix for <rdar://problem/4926179> Text in menulist control should never update if menu is open
3496
3497         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
3498           Only setTextFromOption if the menu isn't visible.
3499
3500 2007-03-15  Brady Eidson  <beidson@apple.com>
3501
3502         Reviewed by Oliver
3503
3504         A few platform specific tweaks
3505
3506         * platform/cf/RetainPtr.h:
3507         (WebCore::RetainPtr::releaseRef): Fixed releaseRef to work with CF
3508         
3509         * platform/network/ResourceHandle.h: Added a "releaseRef" style call
3510
3511 2007-03-15  Maciej Stachowiak  <mjs@apple.com>
3512
3513         Reviewed by Geoff and Steve.
3514
3515         * config.h: Remove unneeded hack.
3516
3517 2007-03-15  Justin Garcia  <justin.garcia@apple.com>
3518
3519         Reviewed by john
3520         
3521         <rdar://problem/5062376> 
3522         REGRESSION: In Mail and Gmail, can't change alignment to text after it has been applied
3523         
3524         Bring back the remove step in applyBlockStyle.  It's 
3525         necessary because addBlockStyleIfNeeded assumes that 
3526         the properties it adds aren't already on the block that 
3527         it adds them to.
3528
3529         * editing/ApplyStyleCommand.cpp:
3530         (WebCore::ApplyStyleCommand::applyBlockStyle): 
3531         Bring back the remove step (added a testcase).
3532         Don't do the add step if m_removeOnly is true (no testcase
3533         because there aren't any clients using removeOnly functionality
3534         to remove styles yet, only styled elemets).
3535         Moved the code for creating new blocks up one level
3536         to this function so that we can pass blocks to removeCSSStyle.
3537         When converting VisiblePositions to indices and vice versa,
3538         use the highest node in the shadow tree if we're in one as
3539         the scope (working on a testcase).
3540         (WebCore::ApplyStyleCommand::addBlockStyle): Moved code to
3541         applyBlockStyle.
3542         * editing/ApplyStyleCommand.h: 
3543
3544 2007-03-15  Brady Eidson  <beidson@apple.com>
3545
3546         Reviewed by Maciej
3547
3548         <rdar://problem/4429701>
3549         Implements a port blocking black list that matches Firefox's
3550
3551         * loader/FrameLoader.cpp:
3552         (WebCore::FrameLoader::blockedError): Call through to the client for blockedError 
3553         * loader/FrameLoader.h:
3554
3555         * loader/FrameLoaderClient.h: Get the "port blocked" error for the current platform
3556
3557         * loader/ResourceLoader.cpp:
3558         (WebCore::ResourceLoader::wasBlocked): ResourceHandleClient method to pass on the didFail(error)
3559         (WebCore::ResourceLoader::blockedError): Following the pattern of "CancelledError()", get the 
3560           error to fail with for the didFail() call
3561         * loader/ResourceLoader.h:
3562
3563         * platform/graphics/svg/SVGImageEmptyClients.h:
3564         (WebCore::SVGEmptyFrameLoaderClient::blockedError): Added stub
3565
3566         * platform/network/ResourceHandle.cpp:
3567         (WebCore::ResourceHandle::create): If the port is blocked, create the handle but schedule it for
3568           deferred failure on a timer
3569         (WebCore::ResourceHandle::scheduleBlockedFailure): Do the timer scheduling
3570         (WebCore::ResourceHandle::fireBlockedFailure): Fire the timer here
3571         (WebCore::ResourceHandle::portAllowed): Implements checking of Mozilla's
3572         * platform/network/ResourceHandle.h:
3573         * platform/network/ResourceHandleClient.h:
3574         (WebCore::ResourceHandleClient::wasBlocked): Virtual for clients to get the "blocked" message
3575
3576 2007-03-15  Beth Dakin  <bdakin@apple.com>
3577
3578         Reviewed by Hyatt.
3579
3580         Fix for <rdar://problem/5065396> REGRESSION: leaks in 
3581         RenderBlock::layoutInlineChildren seen on buildbot
3582
3583         This leak appeared after http://trac.webkit.org/projects/webkit/
3584         changeset/20188. This change shifted line boxes around in 
3585         removeChild(). But since removeChild() calls 
3586         setNeedsLayoutAndMinMaxRecalc(), all of the line boxes will be 
3587         removed once we actually lay out anyway. So this patch fixes the 
3588         leak by deleting the line boxes instead of shifting them around.