11945bd93cf40cdbde868f8539e54b6376edc745
[WebKit-https.git] / WebCore / ChangeLog
1 2006-07-27  Alexander Kellett  <lypanov@kde.org>
2
3         Reviewed by Darin.
4
5         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9867
6           REGRESSION: code that modifies form element in Firefox modifies form attribute in WebKit
7
8         * bindings/scripts/CodeGeneratorJS.pm: add new attribute - HasOverridingNameGetter
9         * html/HTMLFormElement.idl:
10
11 2006-07-27  Rob Buis  <buis@kde.org>
12
13         Reviewed by Anders.
14
15         http://bugzilla.opendarwin.org/show_bug.cgi?id=8992
16         Some HTML DOM attributes have incorrect types
17
18         Adjust idl and dom source code for HTMLImageElement and
19         HTMLBaseFontElement to choose correct type for
20         HTMLImageElement::border and HTMLBaseFontElement::size
21         attributes.
22
23         * html/HTMLBaseFontElement.cpp:
24         (WebCore::HTMLBaseFontElement::size):
25         (WebCore::HTMLBaseFontElement::setSize):
26         * html/HTMLBaseFontElement.h:
27         * html/HTMLBaseFontElement.idl:
28         * html/HTMLImageElement.cpp:
29         (WebCore::HTMLImageElement::border):
30         (WebCore::HTMLImageElement::setBorder):
31         * html/HTMLImageElement.h:
32         * html/HTMLImageElement.idl:
33
34 2006-07-27  Justin Garcia  <justin.garcia@apple.com>
35
36         Reviewed by levi
37         
38         <rdar://problem/4628409>
39         Safari crashes in CompositeEditCommand::removeBlockPlaceholder entering text in a web page form
40
41         * editing/CompositeEditCommand.cpp:
42         (WebCore::CompositeEditCommand::removeBlockPlaceholder): 
43         A script on the page shrinks the textarea down to zero rows just
44         before insertion.  That gives the shadow div a zero height, removing
45         [div, 0] as a candidate for a VisiblePosition.  Then 
46         InsertTextCommand::input() tries to create a VisiblePosition from 
47         [div, 0] and fails.  A nil check is a quick fix.  Another might
48         be to make positions where there is a caret selection candidates.
49         Another might be to make any [div, 0] where div is a shadow div inside
50         a form element a candidate.
51
52 2006-07-27  Graham Dennis  <graham.dennis@gmail.com>
53
54         Reviewed by Darin.
55
56         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=10094
57           Japanese characters improperly rendering in TOT
58           
59         Test: fast/encoding/denormalised-voiced-japanese-chars.html
60
61         * platform/Font.cpp:
62         (WebCore::WidthIterator::advance): pass currentCharacter to normalizeVoicingMarks
63         (WebCore::WidthIterator::normalizeVoicingMarks): turn the currentCharacter variable
64         into an argument as WidthIterator::advance doesn't update m_currentCharacter while
65         looping
66
67 2006-07-27  Eric Seidel  <eric@eseidel.com>
68
69         Reviewed by ap.
70
71         Complex entities seem to fail on TOT
72         http://bugzilla.opendarwin.org/show_bug.cgi?id=6390
73         Use an alternative work-around to an XML Entity parsing bug.
74
75         * dom/XMLTokenizer.cpp:
76         (WebCore::XMLTokenizer::write):
77         (WebCore::hackAroundLibXMLEntityBug): added.
78         (WebCore::startElementNsHandler):
79         (WebCore::endElementNsHandler):
80         (WebCore::charactersHandler):
81         (WebCore::processingInstructionHandler):
82         (WebCore::cdataBlockHandler):
83         (WebCore::commentHandler):
84         (WebCore::getEntityHandler):
85
86 2006-07-27  Rob Buis  <buis@kde.org>
87
88         Reviewed by Darin.
89
90         http://bugzilla.opendarwin.org/show_bug.cgi?id=9938
91         Fix viewBox issues in Hixie's test
92
93         Do a more accurate and quicker job of parsing the viewBox
94         attribute. Handle properly on negative width/height and
95         invalid syntax in general.
96
97         * ksvg2/svg/SVGFitToViewBox.cpp:
98         (SVGFitToViewBox::parseViewBox):
99
100 2006-07-27  Eric Seidel  <eric@eseidel.com>
101
102         Reviewed by ap.
103
104         Enables getSVGDocument() support for HTMLObjectElement and HTMLEmbedElement
105         http://bugzilla.opendarwin.org/show_bug.cgi?id=9237
106         This patch does not try to autogenerate anything, but enables the SVG functionality.
107         Also fix HTMLObjectElement vspace and hspace to be numbers instead of strings to match IE & Firefox.
108
109         * bindings/js/kjs_dom.cpp:
110         (KJS::toJS):
111         * bindings/js/kjs_html.cpp:
112         (KJS::JSHTMLElement::objectGetter):
113         (KJS::HTMLElementFunction::callAsFunction):
114         (KJS::JSHTMLElement::objectSetter):
115         * bindings/js/kjs_html.h:
116         (KJS::JSHTMLElement::):
117         * dom/Document.h:
118         (WebCore::Document::isSVGDocument):
119         * html/HTMLEmbedElement.cpp:
120         (WebCore::HTMLEmbedElement::contentDocument):
121         (WebCore::HTMLEmbedElement::getSVGDocument):
122         * html/HTMLEmbedElement.h:
123         * html/HTMLObjectElement.cpp:
124         (WebCore::HTMLObjectElement::HTMLObjectElement):
125         (WebCore::HTMLObjectElement::getInstance):
126         (WebCore::HTMLObjectElement::parseMappedAttribute):
127         (WebCore::HTMLObjectElement::contentDocument):
128         (WebCore::HTMLObjectElement::rendererIsNeeded):
129         (WebCore::HTMLObjectElement::createRenderer):
130         (WebCore::HTMLObjectElement::setCode):
131         (WebCore::HTMLObjectElement::setArchive):
132         (WebCore::HTMLObjectElement::setBorder):
133         (WebCore::HTMLObjectElement::setCodeBase):
134         (WebCore::HTMLObjectElement::setCodeType):
135         (WebCore::HTMLObjectElement::setData):
136         (WebCore::HTMLObjectElement::hspace):
137         (WebCore::HTMLObjectElement::setHspace):
138         (WebCore::HTMLObjectElement::setStandby):
139         (WebCore::HTMLObjectElement::setType):
140         (WebCore::HTMLObjectElement::setUseMap):
141         (WebCore::HTMLObjectElement::vspace):
142         (WebCore::HTMLObjectElement::setVspace):
143         (WebCore::HTMLObjectElement::getSVGDocument):
144         * html/HTMLObjectElement.h:
145         * ksvg2/svg/SVGDocument.h:
146         (WebCore::SVGDocument::isSVGDocument):
147         * rendering/RenderWidget.h:
148         (WebCore::RenderWidget::frameView):
149
150 2006-07-26  Alexey Proskuryakov  <ap@nypop.com>
151
152         Reviewed by Darin.
153
154         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9901
155         XSLTProcessor cannot parse text nodes for INPUT ELEMENTS in an XSLT stylesheet
156
157         Test: fast/js/xhtml-serialize.html
158
159         * editing/markup.cpp:
160         (WebCore::endMarkup): If the element has child nodes, write a closing tag even if it 
161         is not permitted in HTML, to make it valid XML.
162
163 2006-07-26  Alice Liu  <alice.liu@apple.com>
164
165         Reviewed by John Sullivan (and Kevin and Timo).
166
167         landing this patch for John et al.  
168         Fixed <rdar://problem/4651380> REGRESSION (9A232->9A234): existing web clips don't render if you restart Dashboard
169
170         * page/FrameView.cpp:
171         (WebCore::FrameView::layout):
172         moved the call to didFirstLayout to above the check for needsLayout
173         because we need to call didFirstLayout for every webview, not just
174         ones we think need layout.  
175
176 2006-07-26  Justin Garcia  <justin.garcia@apple.com>
177
178         Reviewed by darin
179         
180         <rdar://problem/4652788>
181         REGRESSION: Can't change size or style of any text in message body
182
183         * dom/Node.cpp:
184         (WebCore::Node::isContentRichlyEditable): Mimic Node::isContentEditable.
185         * html/HTMLElement.cpp:
186         (WebCore::HTMLElement::isContentRichlyEditable): First check
187         the frame for editability, then userModify, like what
188         HTMLElement::isContentEditable() does.
189         * html/HTMLElement.h:
190
191 2006-07-26  Mitz Pettel  <opendarwin.org@mitzpettel.com>
192
193         Reviewed by ap.
194
195         - fix debug-only information() string for table cells
196
197         * rendering/RenderObject.cpp:
198         (WebCore::RenderObject::information):
199
200 2006-07-25  David Harrison  <harrison@apple.com>
201
202         Reviewed by timo and Darin.
203
204         <rdar://problem/4618584> "Paste and Match Style" is not working in Mail (add SPI)
205         
206         * WebCore.xcodeproj/project.pbxproj:
207         * bridge/mac/WebCoreFrameBridge.h:
208         * bridge/mac/WebCoreFrameBridge.mm:
209         (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
210         Add matchStyle parameter for use by WebKit.
211
212 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
213
214         Reviewed by adele
215         
216         <rdar://problem/4649560>
217         REGRESSION: Can't Select All when the body is contentEditable="true"
218
219         * editing/VisiblePosition.cpp:
220         (WebCore::VisiblePosition::canonicalPosition): Allow descent from a non-editable html
221         element into an editable body as a convenience.
222
223 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
224
225         Reviewed by darin
226         
227         <rdar://problem/4468458> Incoming HTML message is editable <body contenteditable="true">
228
229         * dom/Document.cpp:
230         (WebCore::Document::inDesignMode): Removed some spaces.
231         * page/Frame.cpp:
232         (WebCore::Frame::applyEditingStyleToElement): Just add CSS properties needed for editing.
233         (WebCore::Frame::removeEditingStyleFromElement): Made this a no-op, we'll remove
234         it eventually.
235
236 2006-07-25  David Kilzer  <ddkilzer@kilzer.net>
237
238         Reviewed by Darin.
239
240         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9717
241           Replace IDL ConvertUndefinedToTrue parameter attribute with Optional attribute
242
243         No test added because there is no change in functionality.
244
245         * bindings/js/kjs_binding.cpp: Removed valueToBooleanTreatUndefinedAsTrue() method.
246         * bindings/js/kjs_binding.h: Ditto.
247         * bindings/scripts/CodeGeneratorJS.pm: Removed support for ConvertUndefinedToTrue parameter attribute.
248         * dom/Element.h: Set default value to true for scrollIntoView() and scrollIntoViewIfNeeded() arguments.
249         * dom/Element.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
250           Fixed name of scrollIntoViewIfNeeded() argument to match implementation.
251         * page/DOMWindow.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
252
253 2006-07-24  Dan Waylonis  <waylonis@google.com>
254
255         Reviewed and tweaked a bunch by Darin.
256
257         Test: plugins/bindings-test.html
258
259         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9902
260           jsNull and NSNull not properly converted between JS and ObjC
261
262         * bindings/objc/WebScriptObject.mm:
263         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
264         Added case that converts jsNull to NSNull.
265
266 2006-07-24  Darin Adler  <darin@apple.com>
267
268         Reviewed by Adele and Justin.
269
270         - fix <rdar://problem/4613616> REGRESSION: some spaces typed in <textarea> are posted as non-breaking spaces (9630)
271           http://bugzilla.opendarwin.org/show_bug.cgi?id=9630
272         - also fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=9939
273           REGRESSION: Pasting text into native text area with newline at end does not preserve newline
274         - removed some uses of DeprecatedPtrList in the markup code
275
276         Test: fast/forms/textarea-type-spaces.html
277         Test: fast/forms/textarea-paste-newline.html
278
279         * bindings/objc/DOMHTML.mm: (-[DOMHTMLDocument createDocumentFragmentWithText:]):
280         Updated call to pass a range -- in this case it is the range of the entire document,
281         so this will not handle the whitespace properly.
282
283         * bridge/mac/WebCoreFrameBridge.h: Added range context parameter to the
284         documentFragmentWithText: method, so we can handle whitespace properly.
285         * bridge/mac/WebCoreFrameBridge.mm:
286         (-[WebCoreFrameBridge nodesFromList:]): Changed from DeprecatedPtrList to Vector.
287         (-[WebCoreFrameBridge markupStringFromNode:nodes:]): Ditto.
288         (-[WebCoreFrameBridge markupStringFromRange:nodes:]): Ditto.
289         (-[WebCoreFrameBridge documentFragmentWithText:inContext:]): Added range context
290         parameter -- pass it on to createFragmentFromText.
291         (-[WebCoreFrameBridge documentFragmentWithNodesAsParagraphs:]): Changed from
292         DeprecatedPtrList to Vector.
293         (-[WebCoreFrameBridge replaceSelectionWithText:selectReplacement:smartReplace:]):
294         Pass the range of the current selection as context when creating the fragment.
295
296         * dom/Position.cpp: (WebCore::Position::inRenderedText): Replace range check with
297         a call to the new containsCaretOffset function -- helps make the caret work right when
298         it is past the end of the last line in a textarea.
299
300         * editing/CompositeEditCommand.cpp:
301         (WebCore::CompositeEditCommand::rebalanceWhitespaceAt): Don't do anything if the
302         style does not call for collapsing whitespace.
303         (WebCore::CompositeEditCommand::rebalanceWhitespace): Call replaceWhitespaceAt
304         to share code, including the new logic mentioned above.
305
306         * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply):
307         Use a text node instead of a break element when inserting and the style is preserveNewline.
308
309         * editing/JSEditor.cpp: (WebCore::execRemoveFormat): Pass the selection range
310         to createFragmentFromText.
311
312         * editing/RebalanceWhitespaceCommand.cpp: (WebCore::RebalanceWhitespaceCommand::doApply):
313         Assert that we're in a style that collapses whitespace. It's the caller's responsibility
314         not to call otherwise.
315
316         * editing/ReplaceSelectionCommand.h: Removed unused destructor, type, isSingleTextNode,
317         isTreeFragment, m_type, and added a context parameter to inertFragmentForTestRendering.
318         Also changed the constructor to take a selection rather than a pointer to the root
319         editable element, replaced removeEndBRIfNeeded with shouldRemoveEndBR and removed an
320         unused parameter from shouldMergeEnd.
321         * editing/ReplaceSelectionCommand.cpp:
322         (WebCore::ReplacementFragment::ReplacementFragment): Removed code to set up m_type.
323         Compute root editable element from passed-in selection. Used the start of the selection
324         as a base node for style purposes for the test rendering. Removed the special case
325         "single text node" alternative to createFragmentFromText in the plain text case, since
326         createFragmentFromText now handles that correctly.
327         (WebCore::ReplacementFragment::insertFragmentForTestRendering): Copy the whitespace
328         property from the source location when creating a temporary element for test rendering.
329         (WebCore::ReplacementFragment::shouldMergeEnd): Removed unneeded boolean
330         parameter fragmentHadInterchangeNewlineAtEnd, which is always false.
331         (WebCore::ReplaceSelectionCommand::doApply): Update for ReplacementFragment changes,
332         change code to not remove end BR when it can be re-used instead, don't call the
333         paragraph separator insertion when the position is at the start of a paragraph already,
334         removed redundant computation of identical "next" value, removed unneeded boolean
335         parameter to shouldMergeEnd, add case for merging when all we need to do is to delete
336         a newline character, removed unneeded code to set insertionPos after all code that uses
337         it, and  use spaces instead of non-breaking spaces when doing smart paste if the
338         context is one where we do not collapse white space.
339         (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR): Renamed and changed to return
340         a boolean instead of doing the removal.
341
342         * editing/markup.h: Use Vector instead of DeprecatedPtrList. Change the
343         createFragmentFromText function to take a range for context instead of a document.
344         * editing/markup.cpp:
345         (WebCore::markup): Use Vector instead of DeprecatedPtrList.
346         (WebCore::createMarkup): Ditto.
347         (WebCore::createParagraphContentsFromString): Remove unneeded document parameter
348         and changed a couple places to use isEmpty instead of comparing with "".
349         (WebCore::createFragmentFromText): Given the new context parameter, if the context
350         is one that preserves newlines, then use "\n" instead of <br> elements.
351         (WebCore::createFragmentFromNodes): Use Vector instead of DeprecatedPtrList.
352
353         * html/HTMLElement.cpp: (WebCore::HTMLElement::setInnerText): Do not use <br>
354         elements if the context of this node is one where we preserve newlines.
355
356         * rendering/InlineTextBox.h:
357         * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::containsCaretOffset):
358         Added. Implements the appropriate rule for determining if a caret position is
359         in this line or not. Returns true for both one line and the next in cases where
360         affinity must be considered to determine which line the caret is on.
361
362         * rendering/RenderText.h: Make atLineWrap no longer be a member function.
363         * rendering/RenderText.cpp:
364         (WebCore::atLineWrap): Remove special rule about preserveNewline and isLineBreak,
365         which will no longer apply due to the new containsCaretOffset function logic.
366         (WebCore::RenderText::caretRect): Use containsCaretOffset.
367         (WebCore::RenderText::inlineBox): Ditto.
368
369         * rendering/RenderTextControl.cpp:
370         (WebCore::RenderTextControl::updateFromElement): Make a placeholder <br> element
371         after calling setInnerText so that the last newline in the string has the effect
372         we expect outside the HTML world (an additional line).
373         (WebCore::RenderTextControl::setSelectionRange): Set granularity of the selection
374         too. The layout tests caught this problem, which needs a better solution long term.
375         (WebCore::RenderTextControl::text): Call textContent with the parameter false
376         so it will not include newlines for <br> elements. Now the only <br> element
377         that will ever be in the shadow DOM tree is the one to prevent collapsing, and
378         that one should not show up in the text value.
379
380         * rendering/bidi.cpp: (WebCore::RenderBlock::findNextLineBreak): Took a rule
381         that specifically called out the pre whitespace mode and made it work for all
382         the modes that preserve newlines. This makes sure we get a last line box for
383         text after the last "\n" even in cases where there is no <br> afterward.
384
385         * editing/DeleteSelectionCommand.cpp:
386         (WebCore::DeleteSelectionCommand::fixupWhitespace):
387         * editing/InsertParagraphSeparatorCommand.cpp:
388         (WebCore::InsertParagraphSeparatorCommand::doApply):
389         Added assertions to make sure we don't do anything when we're not collapsing
390         whitespace.
391
392         * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::setDefaultValue):
393         Changed to use Vector instead of DeprecatedPtrList.
394
395         * editing/HTMLInterchange.cpp: Removed obsolete comment.
396
397         * loader/Cache.h: Removed a stray include.
398
399 2006-07-24  Adele Peterson  <adele@apple.com>
400
401         Reviewed by Justin.
402
403         - Fix for <rdar://problem/4632132> Changing style of content with mixed editability fails
404
405         Test: * editing/style/apple-style-editable-mix.html
406
407         * dom/Node.cpp: (WebCore::Node::isContentRichlyEditable): Doesn't need to check the editable root.  It now just
408           checks the user modify property of its own renderer, since that is inherited.
409         * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyInlineStyle): If the end position is in a table,
410         Adjust the end node to the last descendant of the table, so we don't skip over any runs.
411
412 2006-07-24  Darin Adler  <darin@apple.com>
413
414         Reviewed by Hyatt.
415
416         - implement String::createCFString
417
418         * WebCore.xcodeproj/project.pbxproj: Added StringImplMac.mm and StringMac.mm.
419
420         * bindings/objc/DOMInternal.mm: Moved NSString conversion functions out of here.
421
422         * platform/mac/StringImplMac.mm: Added. Moved NSString conversion members here
423         and added the CFStringRef ones.
424         * platform/mac/StringMac.mm: Added. Ditto.
425
426 2006-07-24  David Hyatt  <hyatt@apple.com>
427
428         Two bug fixes.
429
430         (1) Make sure to mark positioned objects that depend on line position to
431         mark themselves as needing layout when their line box placeholder gets
432         repositioned.
433
434         * rendering/RenderBox.cpp:
435         (WebCore::RenderBox::position):
436        
437         (2) Improve highlighting to factor the inflation into overflow so that
438         invalidation and repainting will work properly.
439
440         * rendering/RootInlineBox.cpp:
441         (WebCore::RootInlineBox::addHighlightOverflow):
442         * rendering/RootInlineBox.h:
443         * rendering/bidi.cpp:
444         (WebCore::RenderBlock::layoutInlineChildren):
445
446 2006-07-24  Anders Carlsson  <acarlsson@apple.com>
447
448         Reviewed by Adele.
449
450         <rdar://problem/4641824> REGRESSION: Wikipedia widget fails to complete a search after pressing return key
451         
452         * html/HTMLInputElement.cpp:
453         (WebCore::HTMLInputElement::defaultEventHandler):
454         Don't eat enter events for search fields that have no enclosing form; they need to be passed to AppKit so
455         that onsearch can be invoked.
456         
457         * manual-tests/onsearch-enter.html: Added.
458
459 2006-07-24  Dave MacLachlan  <dmaclach@mac.com>
460
461         Reviewed by Darin and Alexey.
462         
463         Fix for: <http://bugzilla.opendarwin.org/show_bug.cgi?id=8425> 
464         and <http://bugzilla.opendarwin.org/show_bug.cgi?id=6947>
465
466         Test: svg/custom/non-opaque-filters.svg
467
468         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
469         (WebCore::KCanvasFilterQuartz::prepareFilter):
470         We create an autorelease pool so we can control the deallocation of the
471         CIContext that we're creating. The CIContext retains the CGContext that 
472         you pass it internally so when the CIContext is released, the 
473         CGContext is released as well.
474         This is all fine and dandy unless you wrap the creation of the CIFilter
475         with a pair of CGBegin/EndTransparencyLayer calls which swap the context
476         out from underneath you. So if you start with context A, 
477         CGBeginTransparencyLayer swaps it out and gives you B. You create a CIFilter
478         with it and add a reference to B. CGEndTransparencyLayer swaps out B and
479         gives you back A. Autorelease pool comes and cleans up the Filter, and calls
480         release on A, but A never got the refcount in the first place. B did. BOOM!
481         So we create a pool, then do a retain, then release the pool so that we 
482         don't have to worry about the pool releasing it at a later time.
483         See <rdar://problem/4647735> for reduction of CGEndTransparencyLayer case
484
485 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
486
487         Reviewed by Hyatt.
488
489         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9669
490           Incomplete repaint when changing an inline's border
491
492         Test: fast/repaint/line-overflow.html
493
494         * rendering/RenderBlock.h:
495         * rendering/bidi.cpp:
496         (WebCore::RenderBlock::layoutInlineChildren): Added repaintTop and repaintBottom
497         variables to track the vertical edges of the area that changed, accounting for
498         lines that were deleted, inserted or moved. Removed unnecessary updating of
499         m_overflowHeight.
500         (WebCore::RenderBlock::determineStartPosition): Removed unnecessary updating of
501         m_overflowHeight.
502         (WebCore::RenderBlock::determineEndPosition):
503         (WebCore::RenderBlock::matchedEndLine): Added repaintTop and repaintBottom
504         arguments, which this method updates to account for deleted lines.
505         (WebCore::RenderBlock::checkLinesForOverflow): Removed outdated FIXME.
506
507 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
508
509         Reviewed by Darin.
510
511         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10075
512           REGRESSION: Reversed pop-up text in visually-ordered Hebrew pages
513
514         Test: fast/forms/select-visual-hebrew.html
515
516         * css/html4.css: Set "-webkit-rtl-ordering: logical" on select elements.
517
518 2006-07-24  Alexey Proskuryakov  <ap@nypop.com>
519
520         Reviewed by Darin.
521
522         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10009
523         REGRESSION: Schubert-IT PDF Plug-in not working for full page (works in frames)
524
525         * page/Frame.cpp:
526         (WebCore::Frame::begin): Give PDF plugins a chance to handle frame content, before ImageDocument
527         claims it.
528
529 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
530
531         Reviewed by Darin.
532
533         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10083
534           REGRESSION (r15584): editing/selection/select-from-textfield-outwards failing
535
536         * rendering/RenderBlock.cpp:
537         (WebCore::RenderBlock::positionForCoordinates): Added back change from the fix
538         for bug 9312: For coordinates outside a replaced object, return the position
539         just before (after) the element if the coordinates are above or to the left (below
540         or to the right).
541
542 2006-07-23  Mark Rowe  <opendarwin.org@bdash.net.nz>
543
544         Reviewed by maciej.
545
546         Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
547         http://bugzilla.opendarwin.org/show_bug.cgi?id=9686
548
549         WebCore portion of the fix.
550
551         * bridge/mac/WebCoreScriptDebugger.h:
552         (-[WebScriptDebugger exceptionRaised:sourceId:line::]): Add delegate method.
553         * bridge/mac/WebCoreScriptDebugger.mm:
554         (WebCoreScriptDebuggerImp::exception): Call delegate method when an exception is raised.
555
556 2006-07-23  Alice Liu  <alice.liu@apple.com>
557
558         Reviewed by Adele.
559         Actually Adele figured out how to fix the layout test failures.  Landing this patch for her.  Layout test failures exposed but not caused by  r15584 (my patch earlier today).
560
561         * editing/visible_units.cpp:
562         (WebCore::previousLinePosition):
563         When setting selection endpoints, don't traverse down into nodes where editing would ignore its contents. Use the parent node instead.  
564         (WebCore::nextLinePosition):
565         same as above
566
567 2006-07-23  David Harrison  <harrison@apple.com>
568
569         Reviewed by timo.
570
571         <rdar://problem/4646759> Mail crash editing To Do - WebCore::InsertTextCommand::prepareForTextInsertion
572         
573         * Test: editing/deleting/delete-mixed-editable-content-001.html
574
575         * editing/visible_units.cpp:
576         (WebCore::startOfParagraph):
577         Respect editable boundary the same way endOfParagraph does.
578
579 2006-07-23  Beth Dakin  <bdakin@apple.com>
580
581         Reviewed by Maciej. (Patch by me, Maciej, and Harrison.)
582
583         Fix for <rdar://problem/4529398> WebCore crashes when pasting rich 
584         text - WebCore::InlineBox::root()
585
586         The initial rendering crash was due to a render object having a 
587         stale reference to an inline box that had already been deleted and 
588         then recreated in the exact same location in memory. (Crazy, I 
589         know.) The situation seemed pretty specific to list markers 
590         according to Hyatt according to Maciej, so that is what I patched 
591         specifically. Fixing this crash unearthed a separate editing crash 
592         where we were trying to insert a block into itself. I worked on 
593         that with Maciej and Harrison, and Harrison came up with a fix.
594
595         * editing/CompositeEditCommand.cpp:
596         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): This is the fix for the editing crash. If paragraphStart is an atomic 
597         node, insert the new block into the parent instead.
598         * rendering/InlineBox.cpp:
599         (WebCore::InlineBox::isChildOfParent): This function is for 
600         posterity. It will help keep the linebox tree in check.
601         * rendering/InlineBox.h:
602         * rendering/InlineFlowBox.cpp:
603         (WebCore::InlineFlowBox::addToLine): Added assert.
604         (WebCore::InlineFlowBox::deleteLine): Added assert.
605         * rendering/ListMarkerBox.cpp:
606         (WebCore::ListMarkerBox::destroy): If this has a parent, call 
607         removeChild on this.
608         (WebCore::ListMarkerBox::operator delete):
609         * rendering/ListMarkerBox.h:
610
611 2006-07-23  Alice Liu  <alice.liu@apple.com>
612
613         Reviewed by Darin.
614
615         fixed <rdar://problem/4617841> REGRESSION (NativeTextField): You can move keyboard focus to a field without getting insertion point
616
617         * rendering/RenderBlock.cpp:
618         (WebCore::RenderBlock::positionForCoordinates):
619         removed some unnecessary vertical position checks and added a fudge factor to be more forgiving for clicks near lines.
620         * rendering/RenderTextControl.cpp:
621         (WebCore::RenderTextControl::nodeAtPoint):
622         added implementation
623         * rendering/RenderTextControl.h:
624         added function protocol
625
626 2006-07-23  Adele Peterson  <adele@apple.com>
627
628         Reviewed by Darin.
629
630         Updating fix from last checkin.
631
632         * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutVerticalBox):
633         Only tell the view about this flexbox if there isn't another flexbox already cached.
634
635 2006-07-23  Adele Peterson  <adele@apple.com>
636
637         Reviewed by Maciej.
638
639         - Fix for <rdar://problem/4644614> REGRESSION: Typing, pasting or dragging in new text areas causes unnecessary scrolling
640
641         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::layoutBlock): Don't updateScrollInfoAfterLayout if an ancestor flexible box is just on
642         its first layout.
643         * rendering/RenderFlexibleBox.cpp:
644         (WebCore::RenderFlexibleBox::layoutBlock): ditto.
645         (WebCore::RenderFlexibleBox::layoutVerticalBox): Let the view know if this flex box is doing its first pass at layout.
646
647         * rendering/RenderView.cpp: (WebCore::RenderView::RenderView): Caches a flexible box that's doing its first layout.
648         * rendering/RenderView.h:
649         (WebCore::RenderView::setFlexBoxInFirstLayout):
650         (WebCore::RenderView::flexBoxInFirstLayout):
651
652 2006-07-22  Alexey Proskuryakov  <ap@nypop.com>
653
654         Reviewed by Darin.
655
656         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10038
657         REGRESSION: Length of navigator.mimeTypes collection returns number of installed plugins, not number 
658         of registered mime types
659
660         * bindings/js/kjs_navigator.cpp:
661         (KJS::MimeTypes::getValueProperty): Return the length of the mime types vector, not the plugins one.
662         (KJS::MimeTypes::getOwnPropertySlot): Fixed another typo, which prevented MimeTypes::getValueProperty()
663         from even being called.
664
665 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
666
667         Reviewed by Adele and Tim Omernick.
668
669         <rdar://problem/4641004> 9A224: Safari crashes in WebCore::RenderMenuList::showPopup when changing a input select field to input text field
670
671         Couldn't figure out how to make layout test, here's a manual test:
672         * manual-tests/remove-select-onchange.html: Added.
673         
674         * rendering/RenderMenuList.cpp:
675         (WebCore::RenderMenuList::showPopup): Don't add the RenderPopupMenu to the render
676         tree so it doesn't get destroyed if we do.
677         
678         The remaining changes are to let the RenderPopupMenu know its menu list w/o having
679         to be in the render tree:
680         
681         * rendering/RenderPopupMenu.cpp:
682         (WebCore::RenderPopupMenu::RenderPopupMenu):
683         * rendering/RenderPopupMenu.h:
684         (WebCore::RenderPopupMenu::menuList):
685         * rendering/RenderPopupMenuMac.h:
686         * rendering/RenderPopupMenuMac.mm:
687         (WebCore::RenderPopupMenuMac::RenderPopupMenuMac):
688         * rendering/RenderPopupMenuWin.h:
689         (WebCore::RenderPopupMenuWin::RenderPopupMenuWin):
690         * rendering/RenderTheme.h:
691         * rendering/RenderThemeMac.h:
692         * rendering/RenderThemeMac.mm:
693         (WebCore::RenderThemeMac::createPopupMenu):
694         * rendering/RenderThemeWin.cpp:
695         (WebCore::RenderThemeWin::createPopupMenu):
696         * rendering/RenderThemeWin.h:
697
698 2006-07-21  Adele Peterson  <adele@apple.com>
699
700         Reviewed by Darin.
701
702         Fix for: <rdar://problem/4643238> REGRESSION: Can't set insertion point at the end of a line of text
703
704         Test: fast/forms/textarea-scrolled-endline-caret.html
705
706         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForCoordinates):
707         When looking for the closest line box, take the scroll offset into account.
708
709 2006-07-21  Tim Omernick  <timo@apple.com>
710
711         Reviewed by Geoff & Maciej.
712
713         <rdar://problem/4632505> REGRESSION: Crash at WebCore::Widget::getView() const + 6
714
715         Geoff is working on a layout test for this.
716
717         * bridge/mac/FrameMac.mm:
718         (WebCore::FrameMac::focusWindow):
719         (WebCore::FrameMac::unfocusWindow):
720         Check for a NULL view.  The view can be NULL if the frame has not yet loaded any data.  This fixes the crash, but the behavior is still
721         wrong -- we should focus the frame once it gets a view.  I've filed <rdar://problem/4645685> to track that.  It's not as urgent as this
722         crasher.
723         
724 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
725
726         Reviewed by Darin.
727
728         <rdar://problem/4523976> REGRESSION (NativeTextField): Crash occurs when choosing "Undo Typing" after typing and setting the value
729
730         * rendering/RenderTextControl.cpp:
731         (WebCore::RenderTextControl::updateFromElement): Clear the undo
732         chain when the text control contents have been set
733         programmatically.
734         * bridge/mac/FrameMac.mm:
735         (WebCore::FrameMac::clearUndoRedoOperations): Before clearing undo
736         stack, close all open undo groups and then open an equal number,
737         since otherwise NSUndoManager ends up in an inconsistent state
738         leading to uncaught ObjC exceptions.
739
740 2006-07-21  Beth Dakin  <bdakin@apple.com>
741         
742         Reviewed by Darin.
743
744         Just moving this assertion down a couple of lines. It was hitting 
745         every time you try to print a page because we put it too early in 
746         the function.
747
748         * bridge/mac/WebCoreFrameBridge.mm:
749         (-[WebCoreFrameBridge drawRect:]):
750
751 2006-07-21  Justin Garcia  <justin.garcia@apple.com>
752
753         Reviewed by levi
754         
755         <rdar://problem/4548238>
756         REGRESSION: Can't remove the first OL/UL list item in a Mail's compose window
757
758         * editing/CompositeEditCommand.cpp:
759         (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): 
760         Moved from InsertParagraphSeparator.  Does its own typing style restoration.
761         * editing/CompositeEditCommand.h:
762         * editing/InsertParagraphSeparatorCommand.cpp:
763         (WebCore::InsertParagraphSeparatorCommand::doApply): Call breakOutOfEmptyListItem.
764         * editing/TypingCommand.cpp:
765         (WebCore::TypingCommand::deleteKeyPressed): Call breakOutOfEmptyListItem if
766         the endingSelection is at the start of an editable region.
767         * editing/htmlediting.cpp:
768         (WebCore::embeddedSublist): Moved from InsertParagraphSeparator.
769         (WebCore::appendedSublist): Ditto.
770         (WebCore::enclosingEmptyListItem): Ditto.
771         * editing/htmlediting.h:
772
773 === Safari-521.20 ===
774
775 2006-07-21  Tim Omernick  <timo@apple.com>
776
777         Reviewed by Beth Dakin & John Sullivan.
778
779         <rdar://problem/4633717> 9A218: Reproducible crash in -[NSScroller mouseDown:]
780
781         Beth is in the middle of making a layout test for this; she will land it soon.
782
783         * platform/mac/ScrollBarMac.mm:
784         (ScrollBar::~ScrollBar):
785         Call Widget::removeFromSuperview() rather than -removeFromSuperview directly on the scroll bar view.
786         Widget::removeFromSuperview() obeys the "mustStayInWindow" flag, which is set while tracking the mouse
787         in view-based widgets to prevent their destruction while the tracking is in progress.
788         I searched around WebCore and this is the only Widget subclass that directly removes its view rather
789         than using removeFromSuperview().
790
791 2006-07-21  Mitz Pettel  <opendarwin.org@mitzpettel.com>
792
793         Reviewed by Darin.
794
795         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9312
796           REGRESSION: Selection bug in new text fields when selecting past the first letter
797
798         Test: editing/selection/select-from-textfield-outwards.html
799
800         * editing/Selection.cpp:
801         (WebCore::Selection::adjustForEditableContent): Added code to handle the case
802         where the selection starts (resp. ends) in the last (resp. first) visual position
803         inside an editable root.
804         * editing/htmlediting.cpp:
805         (WebCore::comparePositions): Fixed the case of comparing a position inside a shadow
806         tree with a position in the shadow ancestor.
807         * rendering/RenderBlock.cpp:
808         (WebCore::RenderBlock::positionForCoordinates): For coordinates outside a replaced
809         object, return the position just before (after) the element if the coordinates are above or
810         to the left (below or to the right).
811         * rendering/RenderObject.cpp:
812         (WebCore::RenderObject::caretMaxOffset): Changed to return 1 for replaced objects.
813         * rendering/RenderText.cpp:
814         (WebCore::RenderText::positionForCoordinates): Changed to return the last position
815         in the lowest text box if the y coordinate is below all text boxes.
816
817 2006-07-21  Geoffrey Garen  <ggaren@apple.com>
818
819         Reviewed by Darin.
820         
821         - Fixed <rdar://problem/4507265> REGRESSION: overlays don't work on 
822         HousingMaps.com (Google Maps-based site)
823         
824         - Made style.filter undetectable, like document.all.
825         
826         Unfortunately, the SVG spec-makers invented a CSS attribute named 'filter',
827         which conflicts with IE's custom CSS attribute by the same name. Web programs 
828         like the Google maps API test for style.filter, and assume it's the IE 
829         style.filter if they find it, so we need to make style.filter undetectable 
830         to avoid breaking them.
831         
832         An alternative solution would be to hotwire a delorean, go back in time,
833         and beg the web standards makers to make standards that work on the web.
834
835         * bindings/js/kjs_css.cpp:
836         (KJS::DOMCSSStyleDeclaration::cssPropertyGetter):
837
838 2006-07-20  Justin Garcia  <justin.garcia@apple.com>
839
840         Reviewed by john
841         
842         <rdar://problem/4641033>
843         REGRESSION: Pasting from web pages into Mail (or Blot) often loses most of the content
844         
845         * editing/markup.cpp:
846         (WebCore::createMarkup): We surround the currently accumulated markup with markup 
847         for ancestors of the startNode when the pre-order traversal leaves the trees rooted 
848         at those ancestors.  We assumed that any ancestors of the current node not in the 
849         ancestorsToClose list were those kind of ancestors.  But we don't add renderer-less 
850         containers to the ancestorsToClose list.  So, we were incorrectly surrounding the 
851         currently accumulated markup with markup for render-less containers.  Most of the
852         content at apple.com was being put inside an <optgroup> inside a <select> element.  
853         Then on Paste createContextualFragment would drop it.
854
855 2006-07-21  Anders Carlsson  <acarlsson@apple.com>
856
857         Reviewed by Geoff.
858
859         * dom/Document.h:
860         (WebCore::Document::):
861         * dom/EventTargetNode.cpp:
862         (WebCore::EventTargetNode::addEventListener):
863         * page/FrameView.cpp:
864         (WebCore::FrameView::layout):
865         * rendering/RenderLayer.cpp:
866         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
867         Only dispatch overflowchanged events if overflowchanged event listeners have been registered on the document.
868
869 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
870
871         Reviewed by Geoff.
872
873         <rdar://problem/4637807> REGRESSION: "Features & Options" page at volvocars.us fails
874
875         * xml/XSLTProcessor.cpp:
876         (WebCore::xsltParamArrayFromParameterMap):
877         Turns out parameters never worked. String parameters need to be escaped so we create a transform context,
878         add the parameters to it quoted and then use xsltApplyStylesheetUser which lets us pass the transform context to it.
879         This also works around a bug in libxslt where a hash table isn't allocated.
880
881 2006-07-20  Alice Liu  <alice.liu@apple.com>
882
883         Reviewed by Tim Omernick.
884
885         Fixed <rdar://problem/4621649> repro crash: Upload link causes crash on pages.google.com in Frame::nodeForWidget
886         added manual test because there is no way to change the value of an <input type=file> via the DOM.  It's not supported because it's a security risk. 
887
888         * manual-tests/remove-input-file-onchange.html: Added.
889         * platform/mac/FileButtonMac.mm:
890         (-[WebFileChooserButton chooseFilename:]):
891         swapped the calls to changeFilename and bridgeForWidget because changeFilename will destroy the widget that is accessed in bridgeForWidget 
892
893 2006-07-20  Alice Liu  <alice.liu@apple.com>
894
895         Reviewed by Adele.
896
897         Fixed <rdar://problem/4532113> REGRESSION (NativeTextField): Crash occurs after modifying field then reloading page -[FormDelegate frameLayoutHasChanged:]
898         added a manual test because of the need to use AutoFill.
899
900         * dom/Node.h:
901         (WebCore::Node::aboutToUnload):
902         added virtual function prototype
903         * html/HTMLInputElement.cpp:
904         (WebCore::HTMLInputElement::aboutToUnload):
905         added implementation that sends textFieldDidEndEditing notification
906         * html/HTMLInputElement.h:
907         added virtual function prototype
908         * manual-tests/input-type-file-autocomplete-frame-1.html: Added.
909         * manual-tests/input-type-file-autocomplete-frame-2.html: Added.
910         * manual-tests/input-type-file-autocomplete-refresh.html: Added.
911         * page/Frame.cpp:
912         (WebCore::Frame::stopLoading):
913         before unloading, call aboutToUnload on the current focused node
914
915 2006-07-20  Brady Eidson  <beidson@apple.com>
916
917         Reviewed by Maciej
918
919         fixed <rdar://problem/4611303> REGRESSION: repro crash in WebCore::EventTargetNode::dispatchWindowEvent at aeropostale.com
920         There was an attempt to deref an EventListener that got cleaned up in GC.  Changing Document's EventListener list from 
921         vanilla ptrs to refptrs to prevent GC, following EventTargetNode's proven example.
922
923         * dom/Document.cpp:
924         (WebCore::Document::Document):
925         (WebCore::Document::clear):
926         (WebCore::Document::handleWindowEvent):
927         (WebCore::Document::getHTMLWindowEventListener):
928         (WebCore::Document::removeHTMLWindowEventListener):
929         (WebCore::Document::removeWindowEventListener):
930         (WebCore::Document::hasWindowEventListener):
931         Changed all of the list iterators to work with RefPtrs instead of vanilla ptrs
932
933         * dom/Document.h:
934         Changed the EventListener list to be a vanilla pointer list to a refptr list
935
936 2006-07-20  John Sullivan  <sullivan@apple.com>
937
938         Reviewed by Maciej
939
940         - WebCore part of fix for:
941         <rdar://problem/4557386> REGRESSION (419.3-521.19): repro Safari world leak involving 
942         closing tabs after clicking in a web page
943         
944         * bridge/mac/WebCoreFrameBridge.h:
945         (-[WebCoreFrameBridge textViewWasFirstResponderAtMouseDownTime:])
946         renamed to be more specific (formerly wasFirstResponderAtMouseDownTime:)
947         * bridge/mac/FrameMac.mm:
948         (WebCore::FrameMac::passMouseDownEventToWidget):
949         updated for name change
950
951 2006-07-19  Alexey Proskuryakov  <ap@nypop.com>
952
953         Reviewed by Darin.
954
955         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8272
956         Use of window.open & window.close can cause crash
957
958         * platform/PlatformMouseEvent.h:
959         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
960         * platform/mac/PlatformMouseEventMac.mm:
961         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
962         The default constructor now creates a "zero" event, and a new one was added to create the "current" one.
963
964         * bridge/mac/FrameMac.mm:
965         (WebCore::FrameMac::handleMouseMoveEvent):
966         * rendering/RenderFormElement.cpp:
967         (WebCore::RenderFormElement::clicked): 
968         Updated for the above changes.
969
970         * platform/gdk/MouseEventGdk.cpp:
971         * platform/gdk/TemporaryLinkStubs.cpp:
972         (PlatformMouseEvent::PlatformMouseEvent):
973         * platform/win/MouseEventWin.cpp:
974         * platform/win/TemporaryLinkStubs.cpp:
975         (PlatformMouseEvent::PlatformMouseEvent):
976         Trying not to break other platforms.
977
978         * manual-tests/invalid-mouse-event.html: Added.
979
980 2006-07-20  Maciej Stachowiak  <mjs@apple.com>
981         
982         Reviewed by Anders.
983
984         - delete line that I only commented in the last patch - meant to do this before landing
985
986         * html/HTMLFrameElement.cpp:
987         (WebCore::HTMLFrameElement::close): 
988
989 2006-07-19  Maciej Stachowiak  <mjs@apple.com>
990
991         Reviewed by Geoff.
992
993         - fixed <rdar://problem/4634484> REGRESSION: Project Change Request form should have vertical scroll bar, but doesn't
994         
995         I couldn't figure out how to make an automated test case for this,
996         or even a manual one. It seems to be timing-related in some way.
997
998         * html/HTMLFrameElement.cpp:
999         (WebCore::HTMLFrameElement::close): detach the child frame from
1000         its element, not the frame containing this element.
1001
1002 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
1003
1004         Reviewed by Darin.
1005
1006         * bridge/mac/FrameMac.mm:
1007         (WebCore::FrameMac::nextKeyViewInFrame):
1008         Hold a ref to the node in case it gets destroyed by an event handler.
1009
1010 2006-07-19  Mark Rowe  <opendarwin.org@bdash.net.nz>
1011
1012         Reviewed by Darin.
1013
1014         http://bugzilla.opendarwin.org/show_bug.cgi?id=10021
1015         Bug 10021: REGRESSION: Stack overflow due to infinite recursion in 
1016         Image::checkForSolidColor
1017
1018         * platform/Image.cpp:
1019         (WebCore::Image::cacheFrame): Don't call checkForSolidColor unless 
1020         the frame was decoded successfully.
1021
1022 2006-07-19  Adele Peterson  <adele@apple.com>
1023
1024         Reviewed by Maciej.
1025
1026         - Fix for: 
1027         <rdar://problem/4422657> REGRESSION: member name field or password field should have focus after loading webmail.mac.com (7405)
1028         http://bugzilla.opendarwin.org/show_bug.cgi?id=7405
1029
1030         <rdar://problem/4614181> REGRESSION: Crash in WebCore::RenderTextField::text() when quoting post at the Ars Technica forum (9707)
1031         http://bugzilla.opendarwin.org/show_bug.cgi?id=9707
1032
1033         Needs an http test. (http://bugzilla.opendarwin.org/show_bug.cgi?id=10020)
1034
1035         These bugs were both cases where focus() was called on an element which didn't have a renderer yet because stylesheets hadn't finished loading yet.
1036         Now, we detect this case and let setFocusNode be called.  And when the stylesheet finishes loading, and the element attaches, a timer will fire, 
1037         which will cause the correct selection & scrolling behavior to occur. 
1038
1039         This fix removes selection and scrolling behavior from the focus method.  This code is now in a new method, updateFocusAppearance.
1040         updateFocusAppearance can now be called directly from focus(), but it can also be called when a timer fires.  This timer gets set
1041         up when an element attaches, and its already been focused by the focus method.  We have to use a timer, because updateFocusAppearance can cause
1042         a layout to happen, and we don't want that to happen in the middle of attach().
1043
1044         * bindings/objc/DOM.mm: (-[DOMElement isFocused]): Added SPI for autofill.
1045         * bindings/objc/DOMPrivate.h:
1046
1047         * dom/Element.cpp:
1048         (WebCore::Element::Element): Initializes timer and needFocusAppearanceUpdate bool.
1049         (WebCore::Element::attach): Checks needsFocusAppearanceUpdate, and if the node is focused, then starts the timer.
1050         (WebCore::Element::focus): Updated to check supportsFocus before calling setFocusNode, 
1051         and only requiring the element to be focusable now before updating focus appearance.
1052         (WebCore::Element::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1053         (WebCore::Element::updateFocusAppearanceTimerFired): Stops the timer, and if the element is focusable, calls updateFocusAppearance.
1054         (WebCore::Element::stopUpdateFocusAppearanceTimer):  Cancels timer, and setsNeedsFocusAppearanceUpdate(false).
1055         (WebCore::Element::detach): Calls stopUpdateFocusAppearanceTimer.
1056         (WebCore::Element::blur): ditto.
1057         * dom/Element.h:
1058         (WebCore::Element::needsFocusAppearanceUpdate): Added so the timer only fires when focus() methods have caused an element to be focused.
1059         (WebCore::Element::setNeedsFocusAppearanceUpdate): Added so focus methods can set this flag.
1060
1061         * dom/Node.h: (WebCore::Node::supportsFocus): Added.  Base class just calls isFocusable.
1062         * html/HTMLAnchorElement.h: Added supportsFocus.
1063         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::supportsFocus): Added. Checks for the case where stylesheets haven't loaded yet,
1064         so we can still focus the node without a renderer, and when it gets a renderer, we'll update the focus appearance.
1065         * html/HTMLGenericFormElement.h: (WebCore::HTMLGenericFormElement::supportsFocus): ditto.
1066         * html/HTMLGenericFormElement.cpp: Removed include of Document.h since this is now in the header.
1067
1068         * html/HTMLInputElement.cpp:
1069         (WebCore::HTMLInputElement::focus): Updated to check supportsFocus before calling setFocusNode, 
1070         and only requiring the element to be focusable now before updating focus appearance.
1071         (WebCore::HTMLInputElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1072         * html/HTMLInputElement.h:
1073
1074         * html/HTMLTextAreaElement.cpp:
1075         (WebCore::HTMLTextAreaElement::focus): Updated to check supportsFocus before calling setFocusNode, 
1076         and only requiring the element to be focusable now before updating focus appearance.
1077         (WebCore::HTMLTextAreaElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1078         * html/HTMLTextAreaElement.h:
1079
1080 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
1081
1082         Reviewed by levi
1083         
1084         <rdar://problem/4631972>
1085         REGRESSION: Mail crashes when pasting entire contents of http://www.apple.com/support/ into a new mail message
1086
1087         * dom/Position.cpp:
1088         (WebCore::Position::upstream): Deployed isBlock and enclosingBlock.
1089         (WebCore::Position::downstream): Ditto.
1090         * editing/CompositeEditCommand.cpp:
1091         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Ditto.
1092         * editing/htmlediting.cpp:
1093         (WebCore::canHaveChildrenForEditing): Added !iframe.
1094         (WebCore::isBlock): Added, returns !node->renderer()->isInline()
1095         (WebCore::enclosingBlock): Added.
1096         * editing/htmlediting.h:
1097
1098 2006-07-19  Anders Carlsson  <acarlsson@apple.com>
1099
1100         Reviewed by Adele.
1101
1102         <rdar://problem/4631272> REGRESSION: Crash tabbing out of hostname field at autorestore.apple.com
1103         
1104         * bridge/mac/FrameMac.mm:
1105         (WebCore::FrameMac::nextKeyViewInFrame):
1106         Take into account that focus handlers can cause a node's renderer to be destroyed.
1107         
1108 2006-07-19  David Hyatt  <hyatt@apple.com>
1109
1110         Fix for 4638376.  The 1x1 solid color image optimization was broken when
1111         I re-architected image.  This patch restores the optimization for CG.  Cairo
1112         will still need the optimization.
1113
1114         Reviewed by darin
1115
1116         WARNING: NO TEST CASES ADDED OR CHANGED (need test cases still)
1117
1118         * platform/Image.cpp:
1119         (WebCore::Image::Image):
1120         (WebCore::Image::invalidateData):
1121         (WebCore::Image::cacheFrame):
1122         * platform/Image.h:
1123         (WebCore::Image::setIsPDF):
1124         * platform/cairo/ImageCairo.cpp:
1125         (WebCore::Image::checkForSolidColor):
1126         * platform/mac/ImageMac.mm:
1127         (WebCore::Image::initNativeData):
1128         (WebCore::Image::invalidateNativeData):
1129         (WebCore::Image::checkForSolidColor):
1130         (WebCore::Image::draw):
1131         (WebCore::Image::drawTiled):
1132
1133 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
1134
1135         Reviewed by levi
1136         
1137         <rdar://problem/4613519>
1138         REGRESSION: Pasting text in native text area inserts text one character before it should (9527)
1139
1140         * editing/InsertParagraphSeparatorCommand.cpp:
1141         (WebCore::InsertParagraphSeparatorCommand::doApply): Turn into an InsertLineBreakCommand instead of bailing
1142         if the enclosingBlockFlowElement doesn't have a parent.
1143
1144 2006-07-19  David Harrison  <harrison@apple.com>
1145
1146         Reviewed by Tim Hatcher.
1147
1148         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
1149         <rdar://problem/4062218> pasting in contents of web.apple.com strips off the <table> element from the first table
1150         
1151         Better patch than previous checkin.
1152
1153         * test: editing/pasteboard/paste-table-003.html
1154         
1155         * editing/markup.cpp:
1156         (WebCore::createMarkup):
1157         Make sure to include the table when including a tbody.
1158
1159 === Safari-521.19 ===
1160
1161 2006-07-19  David Harrison  <harrison@apple.com>
1162
1163         Reviewed by Tim Hatcher.
1164
1165         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
1166
1167         No test case as this can only be reproduced through ObjC APIs.
1168
1169         * editing/markup.cpp:
1170         (WebCore::createMarkup):
1171         Adjust the range for ancestor markup handling when main loop skips first node.
1172
1173 2006-07-18  David Hyatt  <hyatt@apple.com>
1174
1175         Fix for radar 4611287, make resizable text fields opt-in rather than
1176         opt-out.  Open source users will need to write the pref into their defaults
1177         to see the resizers on textareas now.
1178
1179         Reviewed by mjs and adele
1180
1181         * WebCore.xcodeproj/project.pbxproj:
1182         * bridge/mac/WebCoreSettings.mm:
1183         (-[WebCoreSettings setTextAreasAreResizable:]):
1184         * css/cssparser.cpp:
1185         (WebCore::CSSParser::parseValue):
1186         * css/cssstyleselector.cpp:
1187         (WebCore::CSSStyleSelector::applyProperty):
1188         * css/html4.css:
1189
1190 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
1191
1192         Reviewed by Darin.
1193
1194         http://bugzilla.opendarwin.org/show_bug.cgi?id=9959
1195         REGRESSION: iframes stop rendering after 200th one on successive reloads
1196         
1197         * html/HTMLFrameElement.cpp:
1198         (WebCore::HTMLFrameElement::attach):
1199         (WebCore::HTMLFrameElement::close):
1200         * html/HTMLIFrameElement.cpp:
1201         (WebCore::HTMLIFrameElement::insertedIntoDocument):
1202         (WebCore::HTMLIFrameElement::willRemove):
1203         Remove calls to incrementFrameCount and decrementFrameCount.
1204         
1205         * page/Frame.cpp:
1206         (WebCore::Frame::Frame):
1207         Call incrementFrameCount here.
1208         
1209         (WebCore::Frame::~Frame):
1210         Call disconnectOwnerElement.
1211         
1212         (WebCore::Frame::disconnectOwnerElement):
1213         Call decrementFrameCount here.
1214         
1215 2006-07-18  Alexey Proskuryakov  <ap@nypop.com>
1216
1217         Reviewed by Darin.
1218
1219         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9013
1220         Let correct CSS custom cursor declarations parse
1221
1222         * css/cssparser.cpp:
1223         (WebCore::CSSParser::parseValue): Ignore any values following a custom CSS cursor URI, instead of
1224         requiring that it is the only one in the list (which is actually illegal, according to the spec). 
1225         This is only a temporary hack, with a real implementation to follow in bug 6001/6002.
1226
1227         * manual-tests/custom-cursors.html: Added a test for this issue.
1228         * manual-tests/resources/helpCursor.tiff: A cursor image used in the test.
1229
1230 2006-07-18  Timothy Hatcher  <timothy@apple.com>
1231
1232         Reviewed by Anders.
1233         
1234         <rdar://problem/4636216> NetNewsWire fails to launch on 9A224 - missing symbols
1235         
1236         WebCore needs to add -sub_library libobjc to maintain
1237         backwards compatibility with binaries linked with WebKit
1238         before JavaScriptCore moved out of WebKit.
1239
1240         * WebCore.xcodeproj/project.pbxproj:
1241
1242 2006-07-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1243
1244         Reviewed by Justin.
1245
1246         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9978
1247           REGRESSION (r12949-r12988): Clicking the first letter on a line places the caret at the end of the previous line
1248
1249         Test: editing/selection/click-start-of-line.html
1250
1251         * rendering/RenderText.cpp:
1252         (WebCore::RenderText::positionForCoordinates): Changed to return downstream
1253         affinity if the x coordinate is to the left of the middle of the first character
1254         in the text box.
1255
1256 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
1257
1258         Reviewed by Darin.
1259
1260         http://bugzilla.opendarwin.org/show_bug.cgi?id=9695
1261         <rdar://problem/4614085> 
1262         TOT REGRESSION: NativeTextArea: Text area does not respond to Cmd-UpArrow/Cmd-DownArrow (9695)
1263         
1264         * editing/SelectionController.cpp:
1265         (WebCore::SelectionController::modifyExtendingRightForward):
1266         (WebCore::SelectionController::modifyMovingRightForward):
1267         (WebCore::SelectionController::modifyExtendingLeftBackward):
1268         (WebCore::SelectionController::modifyMovingLeftBackward):
1269         If the caret is inside an editable region, the beginning/end of the document should actually be the
1270         beginning/end of the editable region.
1271
1272 2006-07-17  Tim Omernick  <timo@apple.com>
1273
1274         Reviewed by Maciej.
1275
1276         <rdar://problem/4612079> need a way to prevent pages from scrolling to reveal elements that are focused
1277         by script
1278
1279         * bridge/mac/WebCoreFrameBridge.h:
1280         * bridge/mac/WebCoreFrameBridge.mm:
1281         (-[WebCoreFrameBridge setProhibitsScrolling:]):
1282         * page/Frame.cpp:
1283         (WebCore::Frame::prohibitsScrolling):
1284         (WebCore::Frame::setProhibitsScrolling):
1285         * page/Frame.h:
1286         * page/FramePrivate.h:
1287         (WebCore::FramePrivate::FramePrivate):
1288         * page/FrameView.cpp:
1289         (WebCore::FrameView::scrollPointRecursively):
1290         (WebCore::FrameView::setContentsPos):
1291         * page/FrameView.h:
1292         * platform/ScrollView.h:
1293
1294 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1295
1296         Reviewed by Dave Harrison.
1297         
1298         - fixed <rdar://problem/4618089> Blot crashes when I paste in all the contents of http://www.apple.com/startpage/
1299
1300         * editing/htmlediting.cpp:
1301         (WebCore::editingIgnoresContent):
1302
1303 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1304
1305         Reviewed by levi
1306         
1307         <rdar://problem/4621728>
1308         REGRESSION: Selecting by dragging down creates selection in wrong direction, with certain steps
1309         <rdar://problem/4604932>
1310         REGRESSION: Dragging too far left on a line will select all lines above it.
1311  
1312         No layout test because of 9980.
1313
1314         * rendering/RenderBlock.cpp:
1315         (WebCore::RenderBlock::positionForCoordinates): Don't return positions inside editable roots
1316         for coordinates outside those roots, except for coordinates outside a document that is entirely 
1317         editable.
1318
1319 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1320
1321         Reviewed by Darin.
1322
1323         <rdar://problem/4635281> JSCanvasRenderingContext2D::drawImage needs to initialize the exception code to zero
1324
1325         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
1326         (WebCore::JSCanvasRenderingContext2D::drawImage): initialize ec to zero
1327         * html/CanvasRenderingContext2D.cpp:
1328         (WebCore::CanvasRenderingContext2D::drawImage): initialize ec before earlier return
1329
1330 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1331
1332         Reviewed by Maciej.
1333
1334         <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
1335
1336         Moves WebScriptObject and WebUndefined to WebCore.
1337
1338         * WebCore.exp:
1339         * WebCore.xcodeproj/project.pbxproj:
1340         * bindings/objc/DOM.mm:
1341         * bindings/objc/DOMCore.h:
1342         * bindings/objc/DOMInternal.mm:
1343         * bindings/objc/DOMUtility.mm:
1344         * bindings/objc/WebScriptObject.mm: Added.
1345         (+[WebUndefined allocWithZone:]):
1346         (-[WebUndefined initWithCoder:]):
1347         (-[WebUndefined encodeWithCoder:]):
1348         (-[WebUndefined copyWithZone:]):
1349         * bindings/objc/WebScriptObjectPrivate.h: Added.
1350         * bridge/mac/FrameMac.mm:
1351         * bridge/mac/WebCoreScriptDebugger.mm:
1352
1353 2006-07-17  David Hyatt  <hyatt@apple.com>
1354
1355         Back out the fix for 5564, since it turns out font:x-small; is a pretty
1356         prominent IE-specific CSS hack.  Because Web sites rely on IE's incorrect
1357         font parsing as a means of also correcting IE's incorrect font size rules.
1358
1359         This fixes Yahoo.com.
1360
1361         Reviewed by darin
1362
1363         * css/cssparser.cpp:
1364         (WebCore::CSSParser::parseFont):
1365
1366 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1367
1368         Reviewed by levi
1369         
1370         <rdar://problem/4618389> REGRESSION: After applying a link to the last word of a sentence, a new selection is created at the start of the sentence
1371         
1372         * dom/Document.cpp:
1373         (WebCore::Document::updateSelection):
1374
1375 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1376
1377         Reviewed by Beth.
1378         
1379         <rdar://problem/4604946> REGRESSION: 'checkboxRef.checked = true' fires onchange event in Leopard
1380
1381         * html/HTMLInputElement.cpp:
1382         (WebCore::HTMLInputElement::setChecked):
1383         (WebCore::HTMLInputElement::preDispatchEventHandler):
1384         * html/HTMLInputElement.h:
1385
1386 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
1387
1388         Reviewed by Darin.
1389
1390         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9954
1391           REGRESSION: document.dir should return empty string in <head>
1392
1393         Test: fast/dom/document-dir-property.html
1394
1395         * bindings/js/kjs_html.cpp:
1396         (KJS::JSHTMLDocument::getValueProperty): Return an empty string instead of an
1397         undefined value for an unset document.dir property.
1398
1399 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
1400
1401         Reviewed by Darin.
1402
1403         * dom/NodeFilter.idl:
1404         Removed "No newline at end of file" that snuck in as part of the "apply patch" process.
1405         * manual-tests/input-empty-on-focus.html:
1406         Removed "Property changes" that snuck in as part of the "apply patch" process.
1407
1408 2006-07-16  Darin Adler  <darin@apple.com>
1409
1410         Reviewed by John Sullivan.
1411
1412         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9943
1413           <rdar://problem/4590613>
1414           REGRESSION (Tiger-TOT): menus are offset to the right at http://movies.aol.com/movie-photo-bts/superman-returns
1415
1416         The problem turns out to be the fact that body.offsetLeft is returning a non-zero value.
1417         I have no idea why the menus worked in Tiger Safari, because body.offsetLeft behavior has not changed.
1418         Presumably some other bug that we fixed had been compensating.
1419
1420         Test: fast/html/body-offset-properties.html
1421
1422         * rendering/RenderObject.cpp:
1423         (WebCore::RenderObject::offsetLeft): Always return 0 for any object without an offsetParent.
1424         (WebCore::RenderObject::offsetTop): Ditto.
1425         (WebCore::RenderObject::offsetParent): Return 0 for the body (treat as a special case).
1426
1427 2006-07-16  Beth Dakin  <bdakin@apple.com>
1428
1429         Reviewed by Maciej.
1430
1431         Fix for <rdar://problem/4616595> REGRESSION: Problems with world 
1432         clock widget clock hand motion on 9A211 + 4604574
1433
1434         The second hand on the widget was jiggling because the rotation was 
1435         messing up the use of the affine transformation matrix while 
1436         rounding to pixel boundaries in device space. We are mainly 
1437         concerned with rounding to pixel boundaries with the scale in mind, 
1438         so this patch extracts the scale to device space from the matrix, 
1439         and rounds to pixel boundaries using only the scale. This doesn't 
1440         seem like it is a perfect solution, but it definitely solves the 
1441         immediate problem. We will probably need to re-address what should 
1442         happen to avoid pixel cracks with rotations at non-integral scale 
1443         factors. 
1444
1445         * platform/cg/GraphicsContextCG.cpp:
1446         (WebCore::GraphicsContext::roundToDevicePixels):
1447
1448 2006-07-15  Darin Adler  <darin@apple.com>
1449
1450         - fix mistake from fix for 8952 that was breaking layout tests
1451
1452         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
1453         Justin was right! I changed the behavior of the function by accident. Changed it
1454         back so that it doesn't blow away the selection on the DOM side in the case where
1455         it didn't before.
1456
1457         I will write 100 times on the blackboard: "When Justin says something about editing,
1458         assume he is right."
1459
1460 2006-07-15  Darin Adler  <darin@apple.com>
1461
1462         - try to fix Windows build
1463
1464         * WebCore.vcproj/WebCore/WebCore.vcproj: Added StreamingTextDecoderICU.cpp/h.
1465
1466 2006-07-15  Darin Adler  <darin@apple.com>
1467
1468         Reviewed by John Sullivan.
1469
1470         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8952
1471           <rdar://problem/4575185>
1472           REGRESSION: crash on drag of highlighted Google custom home page modules
1473
1474         Test: fast/dynamic/move-node-with-selection.html
1475
1476         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
1477         Call updateRendering before calling clearSelection(), since it's important to do any
1478         work beforehand, and there are calls inside clearSelection that will indirectly do an
1479         updateRendering. Also change code to make fewer assumptions about object lifetime.
1480
1481 2006-07-15  Darin Adler  <darin@apple.com>
1482
1483         Reviewed by John Sullivan.
1484
1485         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8587
1486           <rdar://problem/4631844>
1487           REGRESSION: {display:list-item} on items outside an ol or ul element no longer causes incremental numbering
1488
1489         Test: fast/lists/numeric-markers-outside-list.html
1490
1491         * rendering/RenderListItem.cpp: (WebCore::previousListItem):
1492         Look for list items, even when we're outside any list.
1493
1494 2006-07-15  Adele Peterson  <adele@apple.com>
1495
1496         Reviewed by John.
1497
1498         - Fix for <rdar://problem/4593970> REGRESSION (NativeTextField): autofill menu disappears after typing a 2nd character
1499
1500         This was caused by composite editing commands, (like typing or pasting) that include a DeleteCommand, being
1501         interpreted by the form delegate as an actual delete.  This fix doesn't notify the form delegate if the deletion is
1502         part of an editing command to replace the selected text.
1503
1504         * editing/DeleteSelectionCommand.h: Added m_replace to keep track of whether this deletion is 
1505           part of a composite command to replace the text being deleted.
1506         * editing/DeleteSelectionCommand.cpp:
1507         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand): Initialize m_replace.
1508         (WebCore::DeleteSelectionCommand::doApply): Only notify the form delegate of the deletion if the text is not being replaced.
1509         * editing/CompositeEditCommand.h:
1510         * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::deleteSelection): 
1511           Added replace argument to construct DeleteSelectionCommand.
1512           
1513         * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::input): Call deleteSelection with replace argument.
1514         * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply): ditto.
1515
1516 2006-07-15  Geoffrey Garen  <ggaren@apple.com>
1517
1518         Reviewed by Maciej, tweaked to match Darin's patch.
1519         
1520         - Fixed <rdar://problem/4631837> REGRESSION: Reproducible crash on 
1521         FCKeditor demo (9911)
1522         
1523         * WebCore.xcodeproj/project.pbxproj:
1524         * bindings/js/kjs_html.cpp:
1525         (KJS::JSHTMLDocument::putValueProperty): Check for a null body element before
1526         forwarding the put request to it. I confirmed that no other parts of the 
1527         file use 'body' or 'bodyElement' without checking for null. 
1528         
1529         Also, use 'body' rather than 'bodyElement' because dir can bet set on 
1530         any element, not just HTMLBodyElement.
1531
1532 2006-07-15  Darin Adler  <darin@apple.com>
1533
1534         Reviewed by Adele.
1535
1536         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8871
1537           <rdar://problem/4575417>
1538           REGRESSION: Pressing Enter/Return in a text input removes the selected text
1539
1540         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9743
1541           <rdar://problem/4614228>
1542           REGRESSION: crash dispatching JavaScript-created keyboard event to input element
1543
1544         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::doTextFieldCommandFromEvent):
1545         Add a null check to fix the crash, and a FIXME explaining why this is not necessarily
1546         enough for the future.
1547
1548         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
1549         Consume Enter key keypress events even if the element is not in a form.
1550
1551         * platform/mac/KeyEventMac.mm: (WebCore::keyIdentifierForKeyEvent): Added \n to the
1552         characters that turn into "Enter". Actual keyboard events always are \r or \003 on
1553         the Macintosh, but in layout tests we can use \n, and everything other than the
1554         code path here works, so worth fixing.
1555
1556 2006-07-15  Darin Adler  <darin@apple.com>
1557
1558         Reviewed by John Sullivan.
1559
1560         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9883
1561           <rdar://problem/4631821>
1562           REGRESSION: NativePopups don't work correctly in some forum software
1563
1564         Test: fast/forms/select-selected.html
1565
1566         * rendering/RenderMenuList.h:
1567         * rendering/RenderMenuList.cpp:
1568         (WebCore::RenderMenuList::updateFromElement): Added code to map the selected option
1569         index to a list index before using it to index into the list.
1570         (WebCore::RenderMenuList::showPopup): Added code to map the selection option index
1571         to a list index before passing it to the menu renderer.
1572         (WebCore::RenderMenuList::valueChanged): Added code to map the list index back to a
1573         option index before calling setSelectedIndex (that function takes an option index).
1574
1575 2006-07-15  Darin Adler  <darin@apple.com>
1576
1577         Reviewed by John Sullivan.
1578
1579         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9928
1580           REGRESSION: Text Encoding menu inoperative (after gcc protocol build fix)
1581
1582         * bindings/objc/DOM.mm:
1583         (-[DOMNode addEventListener:::]): Moved into DOMEventTarget category.
1584         (-[DOMNode removeEventListener:::]): Ditto.
1585         (-[DOMNode dispatchEvent:]): Ditto.
1586
1587         * WebCore.xcodeproj/project.pbxproj: Allow Xcode to do its thing.
1588
1589 2006-07-15  Maciej Stachowiak  <mjs@apple.com>
1590
1591         Reviewed by Anders.
1592
1593         <rdar://problem/4632144> REGRESSION: table column tests failing as a result of very recent fix
1594
1595         * rendering/RenderTable.cpp:
1596         (WebCore::RenderTable::addChild): columns and colgroups are valid children of a table too, not
1597         just table sections!
1598
1599 2006-07-15  Anders Carlsson  <acarlsson@apple.com>
1600
1601         Reviewed by Darin.
1602
1603         http://bugzilla.opendarwin.org/show_bug.cgi?id=9866
1604         <rdar://problem/4631561>
1605         REGRESSION: Repro crash from mangleme using iframe, only from server.
1606         
1607         * html/HTMLIFrameElement.cpp:
1608         (WebCore::HTMLIFrameElement::attach):
1609         Add null check for contentFrame() since content frames won't be created for invalid URLs.        
1610
1611 2006-07-14  Alexey Proskuryakov  <ap@nypop.com>
1612
1613         Reviewed by Darin.
1614
1615         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4195
1616         REGRESSION: KOI8-U encoding no longer supported.
1617
1618         Tests:
1619         * http/tests/misc/BOM-override.pl
1620         * http/tests/misc/BOM-override-script.html
1621         * fast/encoding/charset-koi8-u.html
1622         * fast/encoding/charset-x-nextstep.html
1623
1624         Restored a TEC code path for encodings that are not supported by ICU (but which currently
1625         passes all layout tests even by itself with ICU disabled). A lot of refactoring is 
1626         still needed - most importantly, round-tripping encoding names via CFStringEncoding 
1627         makes little sense now.
1628
1629         * WebCore.exp:
1630         * bridge/mac/WebCoreTextDecoder.h: Removed.
1631         * bridge/mac/WebCoreTextDecoder.mm: Removed.
1632         WebCoreTextDecoder was not used anywhere since WebTextView was moved into WebCore.
1633
1634         * loader/Decoder.cpp:
1635         (Decoder::Decoder):
1636         (Decoder::setEncodingName):
1637         (Decoder::decode):
1638         Use StreamingTextDecoder::create().
1639
1640         * platform/StreamingTextDecoder.cpp:
1641         (WebCore::StreamingTextDecoder::create):
1642         (WebCore::StreamingTextDecoder::~StreamingTextDecoder):
1643         * platform/StreamingTextDecoder.h:
1644         StreamingTextDecoder is just an abstract interface to implementations now.
1645
1646         * platform/StreamingTextDecoderICU.cpp: Added.
1647         (WebCore::StreamingTextDecoderICU::StreamingTextDecoderICU):
1648         (WebCore::StreamingTextDecoderICU::~StreamingTextDecoderICU):
1649         (WebCore::StreamingTextDecoderICU::releaseICUConverter):
1650         (WebCore::StreamingTextDecoderICU::textEncodingSupported):
1651         (WebCore::StreamingTextDecoderICU::convertUTF16):
1652         (WebCore::StreamingTextDecoderICU::convertIfASCII):
1653         (WebCore::StreamingTextDecoderICU::createICUConverter):
1654         (WebCore::StreamingTextDecoderICU::appendOmittingBOM):
1655         (WebCore::StreamingTextDecoderICU::convertUsingICU):
1656         (WebCore::StreamingTextDecoderICU::convert):
1657         (WebCore::StreamingTextDecoderICU::toUnicode):
1658         (WebCore::StreamingTextDecoderICU::fromUnicode):
1659         * platform/StreamingTextDecoderICU.h: Added.
1660         Renamed from StreamingTextDecoder; added a way to tell whether the encoding is actually
1661         supported by the decoder; minor cleanup.
1662
1663         * platform/TextEncoding.cpp:
1664         (WebCore::TextEncoding::effectiveEncoding): Moved from StreamingTextDecoder.
1665         (WebCore::TextEncoding::toUnicode): Use StreamingTextDecoder::create().
1666         (WebCore::TextEncoding::fromUnicode): Moved to StreamingTextDecoderICU.
1667         
1668         * platform/TextEncoding.h: Changed __APPLE__ to PLATFORM(MAC); added effectiveEncoding().
1669
1670         * platform/mac/StreamingTextDecoderMac.cpp: Added.
1671         (WebCore::StreamingTextDecoderMac::StreamingTextDecoderMac):
1672         (WebCore::StreamingTextDecoderMac::~StreamingTextDecoderMac):
1673         (WebCore::StreamingTextDecoderMac::releaseTECConverter):
1674         (WebCore::StreamingTextDecoderMac::textEncodingSupported):
1675         (WebCore::StreamingTextDecoderMac::convertUTF16):
1676         (WebCore::StreamingTextDecoderMac::convertIfASCII):
1677         (WebCore::StreamingTextDecoderMac::createTECConverter):
1678         (WebCore::StreamingTextDecoderMac::appendOmittingBOM):
1679         (WebCore::StreamingTextDecoderMac::convertOneChunkUsingTEC):
1680         (WebCore::StreamingTextDecoderMac::convertUsingTEC):
1681         (WebCore::StreamingTextDecoderMac::convert):
1682         (WebCore::StreamingTextDecoderMac::toUnicode):
1683         (WebCore::StreamingTextDecoderMac::fromUnicode):
1684         * platform/mac/StreamingTextDecoderMac.h: Added.
1685         (WebCore::StreamingTextDecoderMac::convert):
1686         This is a TEC+CFString code path for decoding, basically restored from a year-old revision.
1687
1688         * platform/mac/TextEncodingMac.cpp: Removed. Code moved to StreamingTextDecoderMac.
1689
1690         * WebCore.xcodeproj/project.pbxproj:
1691
1692 === Safari-521.17 ===
1693
1694 2006-07-14  Timothy Hatcher  <timothy@apple.com>
1695
1696         <rdar://problem/4623957> SWB: gcc-5412 (new?) objc warning causes WebCore project failure
1697
1698         Made a DOMNode category in DOMEvents.h that lets DOMNode conform to the
1699         DOMEventTarget protocol that works with GCC 5412.
1700
1701         Removed forward declarations of WebCoreWidgetHolder and imported WebCoreWidgetHolder.h.
1702
1703         Removed all <Cocoa/Cocoa.h> and <Foundation/Foundation.h> imports in other headers,
1704         we import <Cocoa/Cocoa.h> in the prefix header for ObjC.
1705
1706         * WebCore.xcodeproj/project.pbxproj:
1707         * bindings/objc/DOMCore.h:
1708         * bindings/objc/DOMEvents.h:
1709         * bridge/mac/FormDataMac.h:
1710         * bridge/mac/WebCoreAXObject.h:
1711         * bridge/mac/WebCoreCache.h:
1712         * bridge/mac/WebCoreEncodings.h:
1713         * bridge/mac/WebCoreFrameBridge.h:
1714         * bridge/mac/WebCoreFrameNamespaces.h:
1715         * bridge/mac/WebCoreJavaScript.h:
1716         * bridge/mac/WebCorePageBridge.h:
1717         * bridge/mac/WebCorePageState.h:
1718         * bridge/mac/WebCoreResourceLoader.h:
1719         * bridge/mac/WebCoreScriptDebugger.h:
1720         * bridge/mac/WebCoreSettings.h:
1721         * bridge/mac/WebCoreStringTruncator.h:
1722         * bridge/mac/WebCoreStringTruncator.mm:
1723         * bridge/mac/WebCoreTextDecoder.h:
1724         * bridge/mac/WebDashboardRegion.h:
1725         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
1726         * platform/mac/CookieJar.mm:
1727         * platform/mac/DeprecatedStringMac.mm:
1728         * platform/mac/FontDataMac.mm:
1729         * platform/mac/FoundationExtras.h:
1730         * platform/mac/TextBoundaries.mm:
1731         * platform/mac/WebCoreHistory.h:
1732         * platform/mac/WebCoreHistory.m:
1733         * platform/mac/WebCoreKeyGenerator.h:
1734         * platform/mac/WebCoreTextArea.h:
1735         * platform/mac/WebCoreTextField.h:
1736         * platform/mac/WebCoreTextRenderer.h:
1737         * platform/mac/WebCoreView.h:
1738         * platform/mac/WebCoreWidgetHolder.h:
1739
1740 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
1741
1742         Reviewed by Maciej.
1743
1744         - Updated ScriptInterpreter to work with Interpreter ref-counting in 
1745         JavaScriptCore.
1746
1747         (KJS::ScriptInterpreter::~ScriptInterpreter): Now protected to catch
1748         manual delete.
1749
1750 2006-07-14  Anders Carlsson  <acarlsson@apple.com>
1751
1752         Reviewed by Adele and Justin.
1753
1754         http://bugzilla.opendarwin.org/show_bug.cgi?id=9658
1755         <rdar://problem/4613948>
1756         REGRESSION: Check Spelling does not work in textarea elements
1757         
1758         * bridge/mac/FrameMac.mm:
1759         (WebCore::FrameMac::advanceToNextMisspelling):
1760         Don't use setStartBefore or setEndAfter on the search range because for shadow trees, there
1761         is no notion of before and after. Instead, use setStart and setEnd and pass in the start and end
1762         indices respectively.
1763         
1764         * dom/Range.cpp:
1765         (WebCore::Range::checkNodeBA):
1766         Allow range operations on shadow trees.
1767
1768         * manual-tests/form-element-spelling.html: Added.
1769
1770 2006-07-14  Beth Dakin  <bdakin@apple.com>
1771
1772         Reviewed by Hyatt.
1773
1774         Fix for <rdar://problem/4621660> REGRESSION: Safari crashing in 
1775         WebCore::FrameView::updateOverflowStatus
1776
1777         m_viewportRenderer is never initialized for framesets, and it 
1778         shouldn't be. So we just need to nil-check for it in 
1779         updateOverflowStatus() and return early.
1780
1781         * page/FrameView.cpp:
1782         (WebCore::FrameView::updateOverflowStatus): Nil check.
1783
1784 2006-07-14  Adele Peterson  <adele@apple.com>
1785
1786         RS by Darin.
1787
1788         Backing out fix for <rdar://problem/4604703> 
1789         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
1790
1791         Darin had a better fix in WebKit for this.
1792
1793         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
1794
1795 2006-07-14  Adele Peterson  <adele@apple.com>
1796
1797         Reviewed by Darin.
1798
1799         - Fix for <rdar://problem/4614054> REGRESSION: Safari submits forms when the Return key is hit to complete inline inputs
1800
1801         * page/Frame.h: (WebCore::Frame::inputManagerHasMarkedText): Added.
1802         * bridge/mac/FrameMac.h: ditto.
1803         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::inputManagerHasMarkedText): Added. Asks the input manager if there's marked text.
1804         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler): For text fields, don't submit the form on Enter
1805         if the input manager says there's marked text.  I added this code for all text field paths.  For widgets, WebCoreTextField.mm
1806         has code to deal with this case.  But as we convert search, password, and isindex, they will need to do this check too.
1807
1808 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1809
1810         Reviewed by Darin.
1811
1812         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9907
1813           REGRESSION (r15418): editing/pasteboard/paste-table-001 fails in pixel  mode
1814
1815         * rendering/RenderText.cpp:
1816         (WebCore::RenderText::caretRect): Fixed the calculation of the max/min allowed caret
1817         position.
1818
1819 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1820
1821         Reviewed by Darin.
1822
1823         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9905
1824           REGRESSION (r15404-r15415): Repro crash when pressing delete in an empty editable div
1825
1826         Test: editing/deleting/delete-at-start-or-end.html
1827
1828         * editing/TypingCommand.cpp:
1829         (WebCore::TypingCommand::deleteKeyPressed): Added null check.
1830         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
1831
1832 2006-07-14  David Kilzer  <ddkilzer@kilzer.net>
1833
1834         Reviewed by Geoffrey.
1835
1836         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9903
1837           Simplify logic in JSHTMLOptionsCollection::setLength() by using no-arg getNumber()
1838
1839         No test cases since there is no change in functionality.
1840
1841         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
1842         (WebCore::JSHTMLOptionsCollection::setLength):  Simplified logic by using the
1843         no-argument getNumber() method.
1844
1845 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
1846
1847         Reviewed by Adele.
1848
1849         - Build fix: don't need BLOCK_OBJC_EXCEPTIONS because we already have
1850         one surrounding this function, and the nested one makes the compiler
1851         think our local variable is volatile (seems like a compiler bug to me).
1852         
1853         * bridge/mac/FrameMac.mm:
1854         (WebCore::FrameMac::sendContextMenuEvent):
1855
1856 2006-07-14  Timothy Hatcher  <timothy@apple.com>
1857
1858         Reviewed by Maciej.
1859
1860         Make JavaScriptCore a public framework. Adjusted the paths.
1861
1862         * WebCore.xcodeproj/project.pbxproj:
1863
1864 2006-07-14  Maciej Stachowiak  <mjs@apple.com>
1865
1866         Reviewed by Hyatt.
1867
1868         - fixed <rdar://problem/4567031> REGRESSION: Crash at WebCore::RenderBlock::createLineBoxes (seems to be a security hole?)
1869         
1870         I also fixed all the similar crash / assertion failure cases I could think of.
1871
1872         * dom/Node.cpp:
1873         (WebCore::Node::nextRendererWithSameParent): Helper function for some of the above.
1874         * dom/Node.h:
1875         * rendering/RenderTable.cpp:
1876         (WebCore::RenderTable::addChild): Don't allow inserting forms when not in
1877         an HTML document, since we don't need that quirk and because parsing won't
1878         do certain render tree fixups. Also watch out for case when inserting before
1879         the renderer of a misnested child.
1880         * rendering/RenderTableRow.cpp:
1881         (WebCore::RenderTableRow::addChild): ditto
1882         * rendering/RenderTableSection.cpp:
1883         (WebCore::RenderTableSection::addChild): ditto
1884
1885 2006-07-13  Adele Peterson  <adele@apple.com>
1886
1887         Reviewed by Maciej.
1888
1889         - Fix for <rdar://problem/4604703> 
1890         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
1891
1892         Test:
1893         * manual-tests/password-ctrl-click-lose-focus.html: Added.
1894
1895         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
1896         If we're about to set a selection in the current view, make sure its the first responder.
1897         In this case, this will cause the password field to resign first responder at the right time.
1898
1899 2006-07-13  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1900
1901         Reviewed by Hyatt.
1902
1903         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9670
1904           REGRESSION: RTL white-space:pre-wrap text is offset to the right
1905
1906         Test: fast/text/international/rtl-white-space-pre-wrap.html
1907
1908         * rendering/RenderText.cpp:
1909         (WebCore::RenderText::caretRect): Fixed LTR case and added the RTL case
1910         of clipping the caret position to the text box when the caret is after
1911         the trailing space of an autowrapped line.
1912         * rendering/bidi.cpp:
1913         (WebCore::RenderBlock::computeHorizontalPositionsForLine): Changed to truncate-
1914         to-fit the logically last text box if it contains the trailing spaces of an
1915         autowrapped line. 
1916         (WebCore::RenderBlock::bidiReorderLine): Remember the logically last text run.
1917         In the case of autowrapped text with white space that overflows beyond the line,
1918         the last text run is the one containing the overflowing white space.
1919         (WebCore::RenderBlock::findNextLineBreak): Split overflowing white space on a
1920         line that autowraps only after white space into a separate text run.
1921
1922 2006-07-13  David Harrison  <harrison@apple.com>
1923
1924         Reviewed by Dave Hyatt.
1925
1926         <rdar://problem/4624203> -webkit-highlight should be behind images
1927
1928         * rendering/RenderImage.cpp:
1929         (WebCore::RenderImage::paint):
1930         * rendering/RenderListMarker.cpp:
1931         (WebCore::RenderListMarker::paint):
1932         * rendering/RenderWidget.cpp:
1933         (WebCore::RenderWidget::paint):
1934         Call custom highlighter before painting the image, marker, or widget.
1935
1936 2006-07-13  David Harrison  <harrison@apple.com>
1937
1938         Reviewed by Justin and Levi.
1939
1940         <rdar://problem/4620743> REGRESSION: Option-Delete doesn't delete words during typing
1941
1942         * Tests:
1943         editing/deleting/delete-by-word-001.html
1944         editing/deleting/delete-by-word-002.html
1945
1946         * editing/TypingCommand.cpp:
1947         (WebCore::TypingCommand::deleteKeyPressed):
1948         (WebCore::TypingCommand::forwardDeleteKeyPressed):
1949         (WebCore::TypingCommand::doApply):
1950         * editing/TypingCommand.h:
1951         Delete and forward delete to use specified granularity.
1952         Undo of delete and forward delete to select what had been deleted (non-char granularity only).
1953         
1954         * page/Frame.cpp:
1955         (WebCore::Frame::setSelection):
1956         Close typing and end style even if selection is not changing.
1957         * page/Frame.h:
1958         Remove unused setSelection parameter keepTypingStyle.
1959
1960 2006-07-12  Levi Weintraub  <lweintraub@apple.com>
1961
1962         Reviewed by justin
1963
1964         <rdar://problem/4622763> Deleting from beginning of paragraph following a table deletes rather than selects the table
1965
1966         * editing/DeleteSelectionCommand.cpp:
1967         (WebCore::DeleteSelectionCommand::initializeStartEnd): Added selection expansion for HRs.
1968         (WebCore::DeleteSelectionCommand::initializePositionData): Now uses enclosingBlockFlowOrTableElement
1969         instead of enclosingBlockFlowElement.
1970         (WebCore::DeleteSelectionCommand::removeNode): Use to identify that we need a placeholder
1971         when the start or end block is removed.
1972         (WebCore::DeleteSelectionCommand::handleGeneralDelete): Added check for canHaveChildrenForEditing
1973         to keep things like HRs from being given children.
1974         (WebCore::DeleteSelectionCommand::doApply): Switched to use member variable for needPlaceholder.
1975         * editing/DeleteSelectionCommand.h: Made needPlaceholder a member variable.
1976         * editing/TypingCommand.cpp:
1977         (WebCore::TypingCommand::deleteKeyPressed): Fixed selection bug for tables and open typing commands.
1978         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
1979         * editing/htmlediting.cpp:
1980         (WebCore::editingIgnoresContent): Added check for HRs, since it's not considered a widget.
1981         * editing/visible_units.cpp:
1982         (WebCore::startOfParagraph): Fix for HRs and tables.
1983         (WebCore::endOfParagraph): Ditto.
1984
1985 2006-07-13  Alexey Proskuryakov  <ap@nypop.com>
1986
1987         Reviewed by Darin.
1988
1989         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9880
1990           Memory leaks running DOM-Hanoi
1991
1992         No change in behavior, thus no test included.
1993
1994         * bridge/mac/FrameMac.mm:
1995         (WebCore::FrameMac::setStatusBarText): Use a local autorelease pool to release the temporaries - 
1996         the test runs non-stop, and the enclosing pool doesn't get a chance to be drained.
1997
1998 2006-07-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1999
2000         Reviewed by Adele.
2001
2002         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9862
2003           REGRESSION: GMail: Crash in RenderView::repaintViewRectangle when spoofing as FF
2004         - see also <rdar://problem/4622407>
2005
2006         Test: fast/frames/repaint-display-none-crash.html
2007
2008         * rendering/RenderView.cpp:
2009         (WebCore::RenderView::repaintViewRectangle): Added null checking of the owner element's
2010         renderer, which can be null if the iframe is set to display:none.
2011
2012 2006-07-12  Justin Garcia  <justin.garcia@apple.com>
2013
2014         Reviewed by levi
2015         
2016         <rdar://problem/4509393>
2017         selected DOM range starts with <object>, 0 offset but selection should include the <object>
2018
2019         * editing/ReplaceSelectionCommand.cpp:
2020         (WebCore::ReplaceSelectionCommand::shouldMergeStart): 
2021         Don't pull content out of a table cell.
2022         * editing/htmlediting.cpp:
2023         (WebCore::editingIgnoresContent): Added <select> nodes.
2024         (WebCore::rangeCompliantEquivalent): Convert [node, 0] positions to positionBeforeNode(node)
2025         for more types of nodes.
2026         * rendering/RenderContainer.cpp:
2027         (WebCore::RenderContainer::positionForCoordinates): 
2028         Fix a crasher when right clicking on an anonymous table.
2029
2030 2006-07-12  John Sullivan  <sullivan@apple.com>
2031
2032         Reviewed by Brady Eidson
2033         
2034         - fixed <rdar://problem/4611164> REGRESSION: Crash occurs when undoing a series of 
2035         misspelled words (WebCore::RenderObject::repaint(bool)
2036
2037         * dom/Document.cpp:
2038         (WebCore::Document::removeMarkers):
2039         put (it - markers.begin()) in a local variable before altering markers, in every case where this was
2040         happening. One of the cases like this was fixed a while back, but other cases were
2041         either missed at that time or crept in since. 
2042
2043 2006-07-13  Anders Carlsson  <acarlsson@apple.com>
2044
2045         Reviewed by Justin.
2046
2047         http://bugzilla.opendarwin.org/show_bug.cgi?id=9663
2048         REGRESSION (r14948-r14956): Selection in text field remains highlighted when the text field loses focus
2049         
2050         * dom/Document.cpp:
2051         (WebCore::Document::updateSelection):
2052         Don't return early if the selection is empty.
2053
2054 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2055
2056         Reviewed by Adele.
2057
2058         <rdar://problem/4614656> REGRESSION: onpaste() handlers don't run for textarea elements
2059         
2060         * bridge/mac/FrameMac.mm:
2061         (WebCore::FrameMac::dispatchCPPEvent):
2062         If the element is a shadow node, dispatch the event to its real parent.
2063
2064         * manual-tests/textarea-onpaste.html: Added.
2065
2066 2006-07-12  Beth Dakin  <bdakin@apple.com>
2067
2068         Reviewed by Anders.
2069
2070         Fix for layout test regressions after my check-in last night. Just 
2071         a silly mistake where I should have asked if we were NOT printing 
2072         instead of if we were in the listbox code.
2073
2074         * WebCore.xcodeproj/project.pbxproj: Project file wars. Back to 
2075         XCode 2.3
2076         * platform/mac/ListBoxMac.mm:
2077         (itemTextRenderer): Inverted check.
2078         (groupLabelTextRenderer): Inverted check.
2079
2080 2006-07-12  Darin Adler  <darin@apple.com>
2081
2082         Reviewed by Maciej.
2083
2084         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9806
2085           <rdar://problem/4622622>
2086           REGRESSION: Large rowspan causes WebKit to call abort()
2087
2088         Test: fast/table/large-rowspan-crash.html
2089
2090         * rendering/RenderTableSection.cpp:
2091         (WebCore::RenderTableSection::ensureRows):
2092         Use sizeof(RowStruct) instead of sizeof(int).
2093         Clearly we'll need something better to solve this completely.
2094         I expect another smaller, but still huge, value will still cause a problem.
2095
2096 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2097
2098         Reviewed by Maciej.
2099
2100         <rdar://problem/4586665> REGRESSION: autorestore.apple.com: Crashes Safari in WebCore::Widget::client() const
2101
2102         * bridge/mac/FrameMac.h:
2103         Add focusCallResultedInViewBeingCreated argument. 
2104         
2105         * bridge/mac/FrameMac.mm:
2106         (WebCore::FrameMac::nextKeyViewInFrame):
2107         If the call to focus() caused the node to get a native widget, set focusCallResultedInViewBeingCreated to true.
2108         
2109         (WebCore::FrameMac::nextKeyViewInFrameHierarchy):
2110         Don't reset the focus node if focusCallResultedInViewBeingCreated is true. Also, add magic to prevent setting
2111         a text field as the first responder if its field editor already is the current first responder.
2112         
2113         * page/FrameView.cpp:
2114         (WebCore::FrameView::handleMousePressEvent):
2115         In some cases, get the event target node again after dispatching the mouse event.
2116
2117 2006-07-12  Beth Dakin  <bdakin@apple.com>
2118
2119         Reviewed by Adele.
2120
2121         Fix for <rdar://problem/4615765> Input[type='search' fields 
2122         initially render too large in Widgets
2123
2124         Fundamentally, the problem here is that we were miscalculating 
2125         things because [NSGraphicsContext currentContextDrawingToScreen] 
2126         was evaluating to false when widgets first load. We only ever used 
2127         this check, however, to determine if we were printing or not, so it 
2128         should not have evaluated to false for loading in Dashbaord. 
2129         Instead, if we query the RenderView about whether or not we are 
2130         printing, we will get the right answer.
2131
2132         No test case added since this appears only to affect Dashboard.
2133
2134         * bridge/mac/WebCoreFrameBridge.mm:
2135         (-[WebCoreFrameBridge drawRect:]): Ask the RenderView if we are 
2136         printing instead. This is not part of the actual bug fix, but it 
2137         seems wise to get rid of all calls to [NSGraphicsContext 
2138         currentContextDrawingToScreen] when we are just trying to determine 
2139         if we are printing or not.
2140         * platform/mac/ListBoxMac.mm:
2141         (itemTextRenderer):This function now takes a boolean, isPrinting.
2142         (groupLabelTextRenderer): Same as above.
2143         (ListBox::sizeForNumberOfLines): Ask the RenderView if we are 
2144         printing.
2145         (-[WebCoreTableView drawRow:clipRect:]): Same as above.
2146         * platform/mac/PopUpButtonMac.mm:
2147         (PopUpButton::sizeHint): Same as above.
2148         * platform/mac/TextFieldMac.mm:
2149         (-[NSSearchFieldCell _addStringToRecentSearches:]):
2150         * rendering/RenderLineEdit.cpp: Same as above.
2151
2152 2006-07-12  Adele Peterson  <adele@apple.com>
2153
2154         Reviewed by Maciej.
2155
2156         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=9813
2157         OPTION text can paint over select element's scrollbar
2158
2159         Test: fast/forms/option-text-clip.html
2160
2161         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::paintObject):
2162         When calculating the clip to apply to the button text, also consider padding.
2163         In the future, we may have separate renderers for the text part, and the arrow part
2164         of the control, and then the separation should be natural.  For now, we use padding.
2165
2166 2006-07-11  David Kilzer  <ddkilzer@kilzer.net>
2167
2168         Windows build fix.  Reviewed by NOBODY.
2169
2170         * WebCore.vcproj/WebCore/WebCore.vcproj:  Added JSHTMLOptionsCollection.cpp/h
2171         and JSHTMLOptionsCollectionCuston.cpp.  VC++ Express realphabetized the file list.
2172
2173 2006-07-11  Darin Adler  <darin@apple.com>
2174
2175         Reviewed by Adele.
2176
2177         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9809
2178           <rdar://problem/4619515>
2179           focus ring fails to appear on select element after choosing item from popup
2180
2181         - includes http://bugzilla.opendarwin.org/show_bug.cgi?id=9853
2182           improvements to select element, including some storage leak fixes
2183
2184         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::index): Use a const
2185         reference for the list items, so we don't have to copy a vector.
2186         * html/HTMLSelectElement.cpp:
2187         (WebCore::HTMLSelectElement::selectedIndex): Ditto.
2188         (WebCore::HTMLSelectElement::setSelectedIndex): Ditto.
2189         (WebCore::HTMLSelectElement::length): Ditto.
2190         (WebCore::HTMLSelectElement::remove): Ditto.
2191         (WebCore::HTMLSelectElement::value): Ditto.
2192         (WebCore::HTMLSelectElement::setValue): Ditto.
2193         (WebCore::HTMLSelectElement::stateValue): Ditto.
2194         (WebCore::HTMLSelectElement::restoreState): Ditto.
2195         (WebCore::HTMLSelectElement::appendFormData): Ditto.
2196         (WebCore::HTMLSelectElement::optionToListIndex): Ditto.
2197         (WebCore::HTMLSelectElement::listToOptionIndex): Ditto.
2198         (WebCore::HTMLSelectElement::recalcListItems): Made const, with the appropriate
2199         fields mutable.
2200         (WebCore::HTMLSelectElement::reset): Use a const reference for
2201         the list items, so we don't have to copy the vector. Remove the call to
2202         setSelectionChanged for the RenderMenuList case.
2203         (WebCore::HTMLSelectElement::notifyOptionSelected): Ditto, on both counts.
2204         (WebCore::HTMLSelectElement::defaultEventHandler): Call focus() before showing
2205         the pop-up.
2206         * html/HTMLSelectElement.h: The RenderMenuList class is no longer a friend.
2207         Changed the listItems function to return a const reference to the vector so
2208         it no longer copies the vector. Removed the const_cast to the call to
2209         recalcListItems and changed it to a const member function. Made m_recalcListItems
2210         mutable.
2211         * rendering/DeprecatedRenderSelect.cpp:
2212         (WebCore::DeprecatedRenderSelect::updateFromElement): Removed an unnecessary call
2213         to recalcListItems, which is called automatically. Use a const reference for the
2214         list items so we don't have to copy a vector.
2215         (WebCore::DeprecatedRenderSelect::layout): Ditto.
2216         (WebCore::DeprecatedRenderSelect::selectionChanged): Ditto.
2217         (WebCore::DeprecatedRenderSelect::updateSelection): Ditto.
2218         * rendering/RenderMenuList.cpp:
2219         (WebCore::RenderMenuList::RenderMenuList): Updated for renamed data members.
2220         (WebCore::RenderMenuList::createInnerBlock): Ditto.
2221         (WebCore::RenderMenuList::addChild): Ditto.
2222         (WebCore::RenderMenuList::removeChild): Ditto.
2223         (WebCore::RenderMenuList::setStyle): Ditto. Also removed code to set the style
2224         on the pop-up menu, because it's created with the correct style and destroyed
2225         before it a style change could occur.
2226         (WebCore::RenderMenuList::updateFromElement): Rearranged code to compute the
2227         maximum width in a simpler fashion, and to not bother trying to maintain
2228         the "selected" flags on the elements, since the HTMLSelectElement class
2229         takes care of that. Store the width as an int. Call setText to set the text
2230         based on the selected element's option text.
2231         (WebCore::RenderMenuList::paintObject): Don't check m_inner when setting
2232         up the clip -- always set up the clip.
2233         (WebCore::RenderMenuList::calcMinMaxWidth): Use m_optionsWidth directly
2234         instead of calling ceilf on m_longestWidth.
2235         (WebCore::RenderMenuList::showPopup): Don't use m_popupMenu to store the
2236         menu -- instead keep the pointer in a local variable. Get the selected
2237         index from the HTMLSelectElement.
2238         (WebCore::RenderMenuList::valueChanged): Call HTMLSelectElement::setSelectedIndex
2239         to do most of the work.
2240         * rendering/RenderMenuList.h: Renamed m_inner to m_innerBlock. Removed
2241         m_popupMenu, m_size, m_selectionChanged, and m_selectedIndex. Renamed
2242         m_longestWidth to m_optionsWidth and changed it to be an int. Removed
2243         unneeded override of removeLeftoverAnonymousBoxes function. Removed
2244         unneeded selectionChanged, setSelectionChanged, updateSelection, and
2245         hasPopupMenu functions. Removed extra includes.
2246         * rendering/RenderPopupMenu.cpp: (WebCore::RenderPopupMenu::populate):
2247         Change to iterate the list items instead of iterating all children
2248         of the select node.
2249         * rendering/RenderPopupMenu.h: Renamed getRenderMenuList to menuList.
2250         * rendering/RenderPopupMenuMac.mm:
2251         (WebCore::RenderPopupMenuMac::populate): Moved code to clear and create
2252         the pop-up here from the caller. Removed an extra retain that would cause
2253         the NSPopUpButtonCell to leak.
2254         (WebCore::RenderPopupMenuMac::showPopup): Removed unnecessary code to
2255         create the pop-up, which is now in populate, and also the call to the
2256         clear function, for the same reason. Reorganized code to make it a bit
2257         more readable. Removed an unnecessary if to check if frame is nil.
2258         Used a RefPtr to make sure we don't make a call on a frame after it's
2259         deleted. As part of the reorganization fixed a problem where we'd retain
2260         the event and then return early without releasing it in one case.
2261         (WebCore::RenderPopupMenuMac::addSeparator): Tweaked a little.
2262         (WebCore::RenderPopupMenuMac::addGroupLabel): Grouped all the code to
2263         manage the NSMenu at the bottom of the function.
2264         (WebCore::RenderPopupMenuMac::addOption): Ditto.
2265
2266 2006-07-11  Justin Garcia  <justin.garcia@apple.com>
2267
2268         Reviewed by levi
2269         
2270         <rdar://problem/4620686>
2271         REGRESSION: Mispelling markers are still displayed when using the delete key to place caret into a misspelled word
2272
2273         * bridge/mac/FrameMac.mm:
2274         (WebCore::FrameMac::respondToChangedSelection): Remove markers from newAdjacentWords 
2275         even if oldAdjacentWords is equal to newAdjacentWords.  This happens during a deletion.
2276         
2277
2278 2006-07-11  Tim Omernick  <timo@apple.com>
2279
2280         Reviewed by NOBODY (build fix)
2281
2282         * bindings/objc/DOMPrivate.h:
2283         Don't @class NPObject; that breaks files that actually #import <JavaScriptCore/npruntime.h>, since the NPObject
2284         there is of a different type.
2285         Also clarified a highly misleading comment from my last commit.  I meant to clarify the comment
2286         before landing.
2287
2288 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2289
2290         Reviewed by Geoff.
2291
2292         http://bugzilla.opendarwin.org/show_bug.cgi?id=9635
2293         REGRESSION: Crash when adding to cart at <http://www.yemeksepeti.com/>
2294         
2295         * html/HTMLTokenizer.cpp:
2296         (WebCore::HTMLTokenizer::scriptHandler):
2297         Don't load external scripts if the parser is stopped.
2298         
2299         * manual-tests/open-close-tokenizer-crash.html: Added.
2300         * manual-tests/resources/empty-file.js: Added.
2301         * manual-tests/resources/open-close-tokenizer-crash.html: Added.
2302         Add manual test.
2303
2304 2006-07-11  John Sullivan  <sullivan@apple.com>
2305
2306         Reviewed by Kevin, Timo O, Brady, Darin, and Hyatt (whee!)
2307
2308         - added support for creating a selection image with white text
2309
2310         * rendering/RenderObject.h:
2311         (WebCore::):
2312         add PaintRestriction enum
2313         (WebCore::RenderObject::PaintInfo::PaintInfo):
2314         add forceWhiteText boolean to PaintInfo struct
2315
2316         * page/FramePrivate.h:
2317         (WebCore::FramePrivate::FramePrivate):
2318         replaced m_selectionOnly bool with m_paintRestriction, which also handles forcing the
2319         text to white
2320
2321         * page/Frame.cpp:
2322         (WebCore::Frame::paint):
2323         updated to use & pass m_paintRestriction where it used to use & pass just m_selectionOnly
2324
2325         * bridge/mac/FrameMac.h:
2326         * bridge/mac/FrameMac.mm:
2327         (WebCore::FrameMac::selectionImage):
2328         now takes forceWhiteText parameter, stored in FramePrivate as part of PaintRestriction
2329
2330         * bridge/mac/WebCoreFrameBridge.h:
2331         * bridge/mac/WebCoreFrameBridge.mm:
2332         (-[WebCoreFrameBridge selectionImageForcingWhiteText:]):
2333         renamed from selectionImage, now takes forceWhiteText parameter, which is passed
2334         down into Frame
2335
2336         * rendering/RenderLayer.h:
2337         * rendering/RenderLayer.cpp:
2338         (WebCore::RenderLayer::paint):
2339         use a PaintRestriction value where we used to use a selectionOnly bool
2340         (WebCore::RenderLayer::paintLayer):
2341         ditto; also stores forceWhiteText in PaintInfo struct
2342
2343         * kcanvas/KCanvasResources.cpp:
2344         (WebCore::KCanvasMarker::draw):
2345         updated for changed signature of PaintInfo constructor
2346
2347         * ksvg2/svg/SVGMaskElement.cpp:
2348         (WebCore::SVGMaskElement::drawMaskerContent):
2349         ditto
2350
2351         * ksvg2/svg/SVGPatternElement.cpp:
2352         (WebCore::SVGPatternElement::drawPatternContentIntoTile):
2353         ditto
2354
2355         * rendering/InlineTextBox.cpp:
2356         (WebCore::InlineTextBox::paint):
2357         paint with white text color if forceWhiteText is set in PaintInfo struct
2358
2359 2006-07-11  Tim Omernick  <timo@apple.com>
2360
2361         Reviewed by Anders.
2362
2363         <http://bugzilla.opendarwin.org/show_bug.cgi?id=9843>:
2364         Give Netscape plug-ins access to their own DOM element
2365
2366         * html/HTMLPlugInElement.h:
2367         Just import JSC headers on Mac.  The NPObject and Bindings::Instance stuff is only used on Mac anyway.
2368         Changed __APPLE__ to PLATFORM(MAC).
2369         Added m_NPObject ivar.
2370         * html/HTMLPlugInElement.cpp:
2371         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
2372         Initialize the NPObject.
2373         (WebCore::HTMLPlugInElement::~HTMLPlugInElement):
2374         Release the NPObject when the element is destroyed.
2375         (WebCore::HTMLPlugInElement::createNPObject):
2376         Creates an NPObject for the element.
2377         (WebCore::HTMLPlugInElement::getNPObject):
2378         Returns the NPObject for the element, creating and caching it if necessary.
2379
2380         * html/HTMLAppletElement.h:
2381         Changed __APPLE__ to PLATFORM(MAC).
2382         * html/HTMLAppletElement.cpp:
2383         ditto
2384         * html/HTMLEmbedElement.h:
2385         ditto
2386         * html/HTMLEmbedElement.cpp:
2387         ditto
2388         * html/HTMLObjectElement.h:
2389         ditto
2390         * html/HTMLObjectElement.cpp:
2391         ditto
2392
2393         * bindings/objc/DOMPrivate.h:
2394         Added -[DOMElement _NPObject].
2395
2396         * bindings/objc/DOM.mm:
2397         (-[DOMElement _NPObject]):
2398         Returns the NPObject for the element.  Since this is only needed by the Netscape plug-in API, you can only get 
2399         the NPObject for applet, embed, and object elements.
2400         
2401 2006-07-11  Adele Peterson  <adele@apple.com>
2402
2403         Reviewed by Hyatt.
2404
2405         - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9861
2406         REGRESSION: Can't dynamically change list box to popup
2407         
2408         and updated fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
2409         REGRESSION: Can't dynamically change popup to list box
2410
2411         The original fix for 9859 was in the renderer, and I think we can catch the change
2412         earlier in the element to detach and reattach.
2413
2414         I also did some cleanup to remove the PopupButton code path from DeprecatedRenderSelect
2415
2416         Test: fast/forms/select-change-listbox-to-popup.html
2417
2418         * html/HTMLSelectElement.cpp:
2419         (WebCore::HTMLSelectElement::parseMappedAttribute): If the new attribute value is going to require us to change from listbox to popup or vice versa,
2420         and we're already attached, then detach and reattach to create the correct renderer.  If we're not attached, then we'll create the correct renderer
2421         when we attach.
2422         (WebCore::HTMLSelectElement::recalcStyle): Updated shouldUseMenuList since it no longer takes a RenderStyle.
2423         (WebCore::HTMLSelectElement::isKeyboardFocusable): ditto.
2424         (WebCore::HTMLSelectElement::isMouseFocusable): ditto.
2425         (WebCore::HTMLSelectElement::createRenderer): ditto.
2426         (WebCore::HTMLSelectElement::setRecalcListItems): ditto.
2427         (WebCore::HTMLSelectElement::reset): ditto.
2428         (WebCore::HTMLSelectElement::notifyOptionSelected): ditto.
2429         (WebCore::HTMLSelectElement::defaultEventHandler): ditto.
2430
2431         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList):
2432         This method no longer takes a RenderStyle.  That was leftover from when we used to use the appearance
2433         to determine whether or not to use the new menu list implementation.
2434
2435         * rendering/DeprecatedRenderSelect.h: Removed PopupButton code path.
2436         * rendering/DeprecatedRenderSelect.cpp:
2437         (WebCore::DeprecatedRenderSelect::DeprecatedRenderSelect):
2438         (WebCore::DeprecatedRenderSelect::setWidgetWritingDirection):
2439         (WebCore::DeprecatedRenderSelect::updateFromElement):
2440         (WebCore::DeprecatedRenderSelect::baselinePosition):
2441         (WebCore::DeprecatedRenderSelect::layout):
2442         (WebCore::DeprecatedRenderSelect::updateSelection):
2443
2444         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2445         Backed out previous fix since this is now done in HTMLSelectElement.
2446
2447 2006-07-11  Adele Peterson  <adele@apple.com>
2448
2449         Reviewed by Hyatt.
2450
2451         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
2452         REGRESSION: Can't dynamically change popup to list box
2453
2454         Test: fast/forms/select-change-popup-to-listbox.html
2455
2456         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2457         If the select element has the multiple property set, or has a size > 1, then it
2458         really should be a list box, so we detach and attach the element so it creates the
2459         correct type of renderer.
2460
2461 2006-07-11  John Sullivan  <sullivan@apple.com>
2462
2463         Reviewed by Beth Dakin and Tim Omernick
2464
2465         - fixed <rdar://problem/4622794> HiDPI: dragging the selection in Safari can show pixel cracks 
2466         at non-integral scale factors
2467
2468         * bridge/mac/FrameMac.mm:
2469         (WebCore::FrameMac::imageFromRect):
2470         round image rect in window coordinate space
2471
2472 2006-07-10  Darin Adler  <darin@apple.com>
2473
2474         Reviewed by Geoff.
2475
2476         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9811
2477           rdar://problem/4619572
2478           OPTION text contained in OPTGROUP appears at the wrong size
2479
2480         * dom/Node.h:
2481         * dom/Node.cpp: (WebCore::Node::renderStyle): Made a const member function.
2482         The derived classes were overriding with const member functions, and I could
2483         change either this or the derived -- decided to do this.
2484
2485 2006-07-10  Darin Adler  <darin@apple.com>
2486
2487         Reviewed by Geoff.
2488
2489         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9810
2490           rdar://problem/4619534
2491           OPTGROUP label text is using the default font instead of Lucida Grande
2492
2493         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::setFontFromControlSize):
2494         Code wants the family name, but was calling fontName, which is not the same thing.
2495         Also removed the unneeded conversion to DeprecatedString.
2496
2497 === Safari-521.16 ===
2498
2499 2006-07-10  David Kilzer  <ddkilzer@kilzer.net>
2500
2501         Reviewed by Darin.
2502
2503         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9179
2504           Implement select.options.add() method
2505
2506         Tests:
2507         - fast/dom/select-selectedIndex-multiple.html
2508         - fast/dom/select-selectedIndex.html
2509         - fast/js/select-options-add.html
2510
2511         * DerivedSources.make: Added JSHTMLOptionsCollection.h.
2512         * ForwardingHeaders/kjs/operations.h: Added.
2513         * WebCore.xcodeproj/project.pbxproj: Added new source files.
2514         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Added.
2515         (WebCore::JSHTMLOptionsCollection::length):
2516         (WebCore::JSHTMLOptionsCollection::setLength):
2517         (WebCore::JSHTMLOptionsCollection::indexSetter):
2518         * bindings/js/kjs_html.cpp: Removed JSHTMLOptionsCollection implementation.
2519         Renamed classes and methods for consistency.
2520         (KJS::JSHTMLElement::selectGetter):
2521         (KJS::JSHTMLElement::put):
2522         (KJS::JSHTMLElement::selectSetter):
2523         (KJS::JSHTMLCollection::JSHTMLCollection):
2524         (KJS::JSHTMLCollectionProtoFunc::callAsFunction):
2525         (KJS::getHTMLOptionsCollection):
2526         * bindings/js/kjs_html.h: Ditto.
2527         * bindings/scripts/CodeGeneratorJS.pm: Added support for HasCustomIndexSetter class attribute.
2528         Added support for Optional parameter attribute, which makes generated code assume overloaded
2529         implementation methods are available for a JavaScript function with optional arguments.  Changed
2530         local 'impl' variables to 'imp' so that impl() methods could be called without class designation.
2531         * html/HTMLOptionElement.idl: Added GenerateNativeConverter attribute.
2532         * html/HTMLOptionsCollection.cpp: Added methods used by generated JSHTMLOptionsCollection class.
2533         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
2534         (WebCore::HTMLOptionsCollection::add):
2535         (WebCore::HTMLOptionsCollection::selectedIndex):
2536         (WebCore::HTMLOptionsCollection::setSelectedIndex):
2537         (WebCore::HTMLOptionsCollection::setLength):
2538         * html/HTMLOptionsCollection.h: Ditto.
2539         * html/HTMLOptionsCollection.idl: Added.
2540
2541 2006-07-10  David Harrison  <harrison@apple.com>
2542
2543         Reviewed by Dave Hyatt.
2544
2545         <rdar://problem/4602408> -webkit-highlight needs to support images and elements other than text
2546
2547         * rendering/RenderBox.cpp:
2548         (WebCore::RenderBox::paintCustomHighlight):
2549         * rendering/RenderBox.h:
2550         Utility for subclasses.
2551         
2552         * rendering/RenderImage.cpp:
2553         (WebCore::RenderImage::paint):
2554         Custom highlight in front of images.
2555         
2556         * rendering/RenderListMarker.cpp:
2557         (WebCore::RenderListMarker::paint):
2558         Custom highlight in front of list markers.
2559
2560         * rendering/RenderWidget.cpp:
2561         (WebCore::RenderWidget::paint):
2562         Custom highlight in front of objects.
2563
2564 2006-07-10  David Hyatt  <hyatt@apple.com>
2565
2566         <rdar://problem/4620557> REGRESSION: In a mail message, text isn't painted
2567         correctly after choosing Redo Typing
2568
2569         Better fix for repainting issue with positioned objects when height
2570         changes.  Optimize when only a positioned child changes so that we don't
2571         incorrectly do normal flow layout.
2572
2573         Reviewed by darin
2574
2575         * WebCore.xcodeproj/project.pbxproj:
2576         * rendering/RenderBlock.cpp:
2577         (WebCore::RenderBlock::layoutBlock):
2578         * rendering/RenderFlexibleBox.cpp:
2579         (WebCore::RenderFlexibleBox::layoutBlock):
2580         * rendering/RenderTable.cpp:
2581         (WebCore::RenderTable::layout):
2582         * rendering/RenderView.cpp:
2583         (WebCore::RenderView::layout):
2584         * rendering/bidi.cpp:
2585         (WebCore::RenderBlock::layoutInlineChildren):
2586
2587 2006-07-10  Adele Peterson  <adele@apple.com>
2588
2589         Reviewed by Beth.
2590
2591         - Fix for <rdar://problem/4621442> REGRESSION (NativePopup) : Popup menus aren't drawn correctly on page at orbitz.com; cheaptickets.com
2592
2593         Test: fast/forms/select-style.html
2594
2595         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::isControlStyled):
2596         Don't let popups be style-able for now.  We'll allow it later, when we
2597         have a good way to handle border & backgrounds and still having it look like a control.
2598
2599 2006-07-10  Justin Garcia  <justin.garcia@apple.com>
2600
2601         Reviewed by harrison
2602         
2603         <rdar://problem/4619260>
2604         9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
2605         <rdar://problem/4619841>
2606         REGRESSION: Dragging selection over input field results in a crash (WebCore::maxDeepOffset(WebCore::Node const*)
2607
2608         * WebCore.xcodeproj/project.pbxproj:
2609         * editing/Selection.cpp:
2610         (WebCore::Selection::adjustForEditableContent): Iterate using next/previousVisuallyDistinctCandidate 
2611         instead of traverseNext/Previous node because we were skipping positions.  Jump out of shadow trees.  
2612         Migrate to isEditablePosition instead of isContentEditable.
2613         
2614
2615 2006-07-10  Beth Dakin  <bdakin@apple.com>
2616
2617         Reviewed by Adele.
2618
2619         Shuffling comments around from my last check-in to make things read 
2620         more clearly.
2621
2622         * page/DOMWindow.h:
2623         * page/DOMWindow.idl:
2624
2625 2006-07-10  Beth Dakin  <bdakin@apple.com>
2626
2627         Reviewed by Darin.
2628
2629         Fix for <rdar://problem/4621095> The should be a way to 
2630         access the user interface scale factor through the DOM
2631
2632         window.devicePixelRatio returns the user interface scale factor.
2633
2634         * page/DOMWindow.cpp:
2635         (WebCore::DOMWindow::devicePixelRatio):
2636         * page/DOMWindow.h:
2637         * page/DOMWindow.idl:
2638
2639 2006-07-10  Brady Eidson  <beidson@apple.com>
2640
2641         Reviewed by Alexey
2642
2643         Resolved the console error messages people got from the new DB even if they didn't have it enabled
2644
2645         * icon/IconDatabase.cpp:
2646         (WebCore::IconDatabase::pruneUnreferencedIcons):
2647         (WebCore::IconDatabase::pruneUnretainedIcons):
2648         Added quick check to bail if the DB isn't open
2649
2650 2006-07-10  David Harrison  <harrison@apple.com>
2651
2652         Reviewed by Tim Hatcher
2653
2654         Partial fix for...
2655         <rdar://problem/4619260> 9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
2656         
2657         * editing/Selection.cpp:
2658         (WebCore::Selection::adjustForEditableContent):
2659         Allow for node being 0.  This is a bandaid fix to prevent the crash.  It will still assert in a debug build.  See bug for more info.
2660
2661 2006-07-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2662
2663         Reviewed by Darin.
2664
2665         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9808
2666           REGRESSION: Incorrect layout (and ERROR) when forcing ATSU For All Text
2667
2668         * manual-tests/ATSU-bad-layout.html: Added.
2669         * platform/mac/FontMac.mm:
2670         (WebCore::Font::floatWidthForComplexText): Return 0 immediately for empty runs.
2671
2672 2006-07-10  Darin Adler  <darin@apple.com>
2673
2674         - try to fix the no-SVG build
2675
2676         * ksvg2/misc/SVGImageLoader.cpp: Move namespace brace inside the #if.
2677
2678 2006-07-10  Darin Adler  <darin@apple.com>
2679
2680         Reviewed by Anders.
2681
2682         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9833
2683           REGRESSION: Reproducible crash: RenderMenuList.cpp:58: failed assertion `!m_first'
2684
2685         * manual-tests/empty-title-popup.html: Added.
2686
2687         * rendering/RenderMenuList.h: Add createInnerBlock.
2688         * rendering/RenderMenuList.cpp:
2689         (WebCore::RenderMenuList::createInnerBlock): Factored out of addChild.
2690         (WebCore::RenderMenuList::addChild): Call createInnerBlock.
2691         (WebCore::RenderMenuList::setText): Changed parameter type.
2692         (WebCore::RenderMenuList::showPopup): Call createInnerBlock before calling
2693         the parent class's addChild.
2694
2695 2006-07-10  Rob Buis  <buis@kde.org>
2696
2697         Reviewed by Maciej via IRC.
2698
2699         Make sure the attributes are calculated against viewport width value,
2700         as defined in the spec.  http://paste.lisp.org/display/22342
2701
2702         * ksvg2/svg/SVGEllipseElement.cpp:
2703         (WebCore::SVGEllipseElement::rx): Changed LM_HEIGHT to LM_WIDTH.
2704         * ksvg2/svg/SVGLineElement.cpp:
2705         (SVGLineElement::x2): Ditto.
2706
2707 2006-07-10  Beth Dakin  <bdakin@apple.com>
2708
2709         Reviewed by Maciej.
2710
2711         Fix for <rdar://problem/4610314> Support the CSS3 content property 
2712         for images
2713
2714         This patch provides initial support for the CSS3 content property. 
2715         It lacks support for any content other than images, and only allows 
2716         content for elements that seemed safe for now.
2717
2718         * css/cssstyleselector.cpp:
2719         (WebCore::CSSStyleSelector::applyProperty): Remove restrictions for 
2720         just :before and :after
2721         * html/HTMLBRElement.cpp:
2722         (WebCore::HTMLBRElement::createRenderer):
2723         * html/HTMLFrameSetElement.cpp:
2724         (WebCore::HTMLFrameSetElement::createRenderer):
2725         * html/HTMLImageElement.cpp:
2726         (WebCore::HTMLImageElement::createRenderer):
2727         * html/HTMLLegendElement.cpp:
2728         (WebCore::HTMLLegendElement::createRenderer):
2729         * rendering/RenderImage.cpp:
2730         (WebCore::RenderImage::RenderImage):
2731         (WebCore::RenderImage::setCachedImage): Don't allow the image to be 
2732         set this way if it was already set with the content property.
2733         * rendering/RenderImage.h:
2734         (WebCore::RenderImage::setIsAnonymousImage): Anonymous images are 
2735         those set through the content property.
2736         (WebCore::RenderImage::isAnonymousImage):
2737         * rendering/RenderObject.cpp:
2738         (WebCore::RenderObject::createObject): If there is content 
2739         specified, create a RenderImage with the content and initialize the 
2740         cached image to whatever was specified in the CSS.
2741
2742 2006-07-10  Brady Eidson  <beidson@apple.com>
2743
2744         Reviewed by NOBODY (Build Fix!)
2745
2746         * icon/SiteIcon.cpp:
2747         (SiteIcon::getImage):
2748         Release build made an "unused variable" warning, which is, of course, an error.  fixed that.
2749
2750 2006-07-10  Brady Eidson  <beidson@apple.com>
2751
2752         Reviewed by Maciej
2753
2754         SQLite Icon DB now fully replicates functionality of the old DB, including pruning to keep unused
2755         information out to keep down disk usage.  For now, it is still off by default, as the critical
2756         feature of importing old icons into the new DB is still unrealized.
2757         If you'd like to test, add #define ICONDEBUG to your WebKitPrefix.h
2758
2759         * icon/IconDatabase.cpp:
2760         (WebCore::IconDatabase::IconDatabase):
2761         (WebCore::IconDatabase::open):
2762           -Sets up a timer for initial pruning
2763         (WebCore::IconDatabase::iconForPageURL):
2764           -Switched away from "dirty blob hack" as the problem is provisionally solved
2765         (WebCore::IconDatabase::retainIconForURL):
2766         (WebCore::IconDatabase::releaseIconForURL):
2767           -Same as found in WebKit
2768         (WebCore::IconDatabase::totalRetainCountForIconURL):
2769           -Adds up all retainers of icon
2770         (WebCore::IconDatabase::forgetIconForIconURLFromDatabase):
2771           -Wipes an Icon table entry out
2772         (WebCore::IconDatabase::establishTemporaryIconIDForIconURL):
2773         (WebCore::IconDatabase::establishTemporaryIconIDForEscapedIconURL):
2774         (WebCore::IconDatabase::establishIconIDForIconURL):
2775         (WebCore::IconDatabase::establishIconIDForEscapedIconURL):
2776           -Added ability to get an iconID without creating a new one if a lookup is all
2777            that is genuinely wanted
2778         (WebCore::IconDatabase::pruneUnreferencedIcons):
2779         (WebCore::IconDatabase::pruneUnretainedIcons):
2780           -Called on a timer on DB startup to clean it out
2781         * icon/IconDatabase.h:
2782         * icon/SiteIcon.cpp:
2783         (SiteIcon::SiteIcon):
2784         (SiteIcon::~SiteIcon):
2785           -Deletes the image on deletion
2786         (SiteIcon::getImage):
2787           -Cut down on no-longer-necessary debug info
2788
2789 2006-07-10  Anders Carlsson  <acarlsson@apple.com>
2790
2791         Reviewed by Adele.
2792
2793         http://bugzilla.opendarwin.org/show_bug.cgi?id=9245
2794         Quirksmode: Incorrect handling of disabled BUTTON elements
2795
2796         * html/HTMLButtonElement.cpp:
2797         (WebCore::HTMLButtonElement::defaultEventHandler):
2798         Don't call prepareSubmit if the element is disabled.
2799
2800         * html/HTMLInputElement.cpp:
2801         (WebCore::HTMLInputElement::defaultEventHandler):
2802         Don't call prepareSubmit if the element is disabled.
2803
2804 2006-07-10  Darin Adler  <darin@apple.com>
2805
2806         - try to fix Windows build
2807
2808         * platform/win/TemporaryLinkStubs.cpp: Put a few functions in the WebCore namespace.
2809         * platform/gdk/TemporaryLinkStubs.cpp: Ditto.
2810
2811 2006-07-10  Darin Adler  <darin@apple.com>
2812
2813         Reviewed by Geoff.
2814
2815         - fix failures seen in layout tests
2816
2817         * bindings/js/kjs_dom.cpp: (KJS::toJS): Restore one of the few WebCore:: prefixes
2818         that really needed to be there -- because we have two classes named JSHTMLDocument
2819         at the moment! (One in KJS and one in WebCore namespace.)
2820
2821 2006-07-10  Darin Adler  <darin@apple.com>
2822
2823         - try to fix Windows build
2824
2825         * rendering/RenderLayer.h: Correct a forward declaration of ScrollBar.
2826
2827 2006-07-09  Adele Peterson  <adele@apple.com>
2828
2829         Reviewed by Maciej.
2830
2831         Fix for <rdar://problem/4463835> Switch to use new popup menu implementation for <select>
2832
2833         * css/html4.css: Added style for new selects, and for list boxes.
2834         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList): Removed check for appearance so new popups can be styled.
2835    
2836         * rendering/RenderMenuList.cpp:
2837         (WebCore::RenderMenuList::setStyle): Removed padding.  This is now set by the theme.
2838         (WebCore::RenderMenuList::calcMinMaxWidth): Now takes minimum text size into account.
2839         * rendering/RenderMenuList.h: Removed baselinePosition since we're letting the theme calculate that.
2840
2841         * rendering/RenderTheme.cpp: (WebCore::RenderTheme::isControlContainer): Added menuList as a ControlContainer, 
2842         so RenderThemeMac will compute its baseline.
2843         * rendering/RenderTheme.h: (WebCore::RenderTheme::minimumTextSize): Added.
2844         * rendering/RenderThemeMac.h: Added minimumTextSize, setPopupPaddingFromControlSize, popupButtonSizes, popupButtonMargins, popupButtonPadding.
2845         Removed sizeOfArrowControl. 
2846         * rendering/RenderThemeMac.mm:
2847         (WebCore::): Added enum for padding.
2848         (WebCore::RenderThemeMac::adjustRepaintRect): Now inflates rect to account for control shadow.
2849         (WebCore::RenderThemeMac::baselinePosition): Now calculates baseline for menulist.
2850         (WebCore::RenderThemeMac::popupButtonMargins): Tweaked values.
2851         (WebCore::RenderThemeMac::popupButtonSizes): Added.
2852         (WebCore::RenderThemeMac::popupButtonPadding): Added, so different padding can be set for different control sizes.
2853         (WebCore::RenderThemeMac::setPopupPaddingFromControlSize): Added.
2854         (WebCore::RenderThemeMac::paintMenuList): Now inflates rect to account for control shadow.
2855         (WebCore::RenderThemeMac::adjustMenuListStyle): Resets border, sets padding, sets control size.
2856         (WebCore::RenderThemeMac::setPopupButtonCellState): Removed unnecessary class name.
2857         (WebCore::RenderThemeMac::minimumTextSize): Added.
2858
2859 2006-07-09  Darin Adler  <darin@apple.com>
2860
2861         - add back "unused code" for plain text fields, still used by <isindex>!
2862
2863         * platform/TextField.h:
2864         * platform/mac/TextFieldMac.mm:
2865         * platform/mac/WebCoreTextField.h:
2866         * platform/mac/WebCoreTextField.mm:
2867         * rendering/RenderLineEdit.cpp:
2868
2869 2006-07-09  Darin Adler  <darin@apple.com>
2870
2871         Reviewed by Tim Hatcher.
2872
2873         - put more into the WebCore namespace
2874         - removed unused code for plain text fields
2875
2876         Put more classes, class templates, enums, functions, and constants into
2877         the WebCore namespace, including all the headers in the platform directory.
2878
2879         Removed lots of unneeded "WebCore::" qualifiers and "using" directives.
2880
2881         Added some "WebCore::" qualifiers in a few places.
2882
2883         Removed "uses WebCore::" in headers that we said we'd remove "when
2884         everything is in the WebCore namespace".
2885
2886         * bindings/js/JSDOMParser.cpp:
2887         * bindings/js/JSHTMLElementWrapperFactory.cpp:
2888         * bindings/js/JSXSLTProcessor.cpp:
2889         * bindings/js/kjs_binding.cpp:
2890         * bindings/js/kjs_css.cpp:
2891         * bindings/js/kjs_dom.cpp:
2892         * bindings/js/kjs_dom.h:
2893         * bindings/js/kjs_events.cpp:
2894         * bindings/js/kjs_proxy.h:
2895         * bindings/js/kjs_window.h:
2896         * bindings/objc/DOM.mm:
2897         * bridge/History.h:
2898         * bridge/JavaAppletWidget.h:
2899         * bridge/mac/FormDataMac.h:
2900         * bridge/mac/FormDataMac.mm:
2901         * bridge/mac/WebCoreAXObject.mm:
2902         * bridge/mac/WebCoreEncodings.mm:
2903         * bridge/mac/WebCoreFrameBridge.h:
2904         * bridge/mac/WebCoreIconDatabaseBridge.mm:
2905         * bridge/mac/WebCorePageState.h:
2906         * bridge/mac/WebCoreScriptDebugger.mm:
2907         * bridge/mac/WebCoreSettings.h:
2908         * css/CSSGrammar.y:
2909         * css/CSSPageRule.cpp:
2910         * css/CSSPageRule.h:
2911         * css/MediaList.cpp:
2912         * css/cssstyleselector.h:
2913         * dom/Clipboard.h:
2914         * dom/Document.cpp:
2915         * dom/Document.h:
2916         * dom/EventTargetNode.h:
2917         * dom/Node.cpp:
2918         * dom/Node.h:
2919         * dom/Position.h:
2920         * dom/Range.cpp:
2921         * dom/XMLTokenizer.cpp:
2922         * editing/AppendNodeCommand.h:
2923         * editing/ApplyStyleCommand.cpp:
2924         * editing/BreakBlockquoteCommand.cpp:
2925         * editing/BreakBlockquoteCommand.h:
2926         * editing/CompositeEditCommand.cpp:
2927         * editing/CompositeEditCommand.h:
2928         * editing/CreateLinkCommand.h:
2929         * editing/DeleteFromTextNodeCommand.h:
2930         * editing/DeleteSelectionCommand.h:
2931         * editing/FormatBlockCommand.h:
2932         * editing/HTMLInterchange.cpp:
2933         * editing/HTMLInterchange.h:
2934         * editing/IndentOutdentCommand.h:
2935         * editing/InsertIntoTextNodeCommand.h:
2936         * editing/InsertLineBreakCommand.h:
2937         * editing/InsertListCommand.h:
2938         * editing/InsertNodeBeforeCommand.h:
2939         * editing/InsertTextCommand.cpp:
2940         * editing/InsertTextCommand.h:
2941         * editing/JSEditor.cpp:
2942         * editing/JSEditor.h:
2943         * editing/JoinTextNodesCommand.h:
2944         * editing/MergeIdenticalElementsCommand.cpp:
2945         * editing/MergeIdenticalElementsCommand.h:
2946         * editing/ModifySelectionListLevel.h:
2947         * editing/MoveSelectionCommand.h:
2948         * editing/RebalanceWhitespaceCommand.h:
2949         * editing/RemoveNodeAttributeCommand.h:
2950         * editing/RemoveNodeCommand.h:
2951         * editing/RemoveNodePreservingChildrenCommand.h:
2952         * editing/ReplaceSelectionCommand.h:
2953         * editing/SetNodeAttributeCommand.h:
2954         * editing/SplitElementCommand.cpp:
2955         * editing/SplitElementCommand.h:
2956         * editing/SplitTextNodeCommand.cpp:
2957         * editing/SplitTextNodeCommand.h:
2958         * editing/SplitTextNodeContainingElementCommand.h:
2959         * editing/TypingCommand.cpp:
2960         * editing/TypingCommand.h:
2961         * editing/UnlinkCommand.h:
2962         * editing/VisiblePosition.cpp:
2963         * editing/WrapContentsInDummySpanCommand.cpp:
2964         * editing/WrapContentsInDummySpanCommand.h:
2965         * editing/markup.cpp:
2966         * editing/markup.h:
2967         * html/HTMLAnchorElement.cpp:
2968         * html/HTMLBodyElement.cpp:
2969         * html/HTMLButtonElement.h:
2970         * html/HTMLCollection.h:
2971         * html/HTMLDocument.h:
2972         * html/HTMLEmbedElement.cpp:
2973         * html/HTMLFormElement.cpp:
2974         * html/HTMLFormElement.h:
2975         * html/HTMLFrameElement.cpp:
2976         * html/HTMLFrameSetElement.cpp:
2977         * html/HTMLKeygenElement.cpp:
2978         * html/HTMLLabelElement.cpp:
2979         * html/HTMLObjectElement.cpp:
2980         * html/HTMLObjectElement.h:
2981         * html/HTMLTableElement.cpp:
2982         * html/HTMLTablePartElement.cpp:
2983         * icon/IconDatabase.h:
2984         * kcanvas/KCanvasPath.h:
2985         * kcanvas/KCanvasResources.cpp:
2986         * kcanvas/KCanvasResources.h:
2987         * kcanvas/KCanvasTreeDebug.cpp:
2988         * kcanvas/KCanvasTreeDebug.h:
2989         * kcanvas/RenderSVGContainer.cpp:
2990         * kcanvas/RenderSVGText.h:
2991         * kcanvas/device/KRenderingPaintServer.h:
2992         * kcanvas/device/KRenderingPaintServerGradient.h:
2993         * kcanvas/device/KRenderingPaintServerSolid.cpp:
2994         * ksvg2/misc/SVGImageLoader.cpp:
2995         * ksvg2/svg/SVGElement.cpp:
2996         * ksvg2/svg/SVGElement.h:
2997         * ksvg2/svg/SVGForeignObjectElement.cpp:
2998         * ksvg2/svg/SVGForeignObjectElement.h:
2999         * ksvg2/svg/SVGImageElement.cpp:
3000         * ksvg2/svg/SVGPoint.h:
3001         * ksvg2/svg/SVGStylable.h:
3002         * ksvg2/svg/SVGTRefElement.cpp:
3003         * ksvg2/svg/SVGTRefElement.h:
3004         * ksvg2/svg/SVGTSpanElement.cpp:
3005         * ksvg2/svg/SVGTSpanElement.h:
3006         * ksvg2/svg/SVGTextElement.h:
3007         * ksvg2/svg/svgpathparser.cpp:
3008         * ksvg2/svg/svgpathparser.h:
3009         * loader/Cache.h:
3010         * loader/DocLoader.h:
3011         * loader/LoaderFunctions.h:
3012         * loader/mac/LoaderFunctionsMac.mm:
3013         * page/Frame.h:
3014         * page/FrameView.h:
3015         * page/Page.h:
3016         * page/Settings.h:
3017         * platform/AffineTransform.cpp:
3018         * platform/AffineTransform.h:
3019         * platform/Arena.cpp:
3020         * platform/Arena.h:
3021         * platform/CookieJar.h:
3022         * platform/DeprecatedCString.cpp:
3023         * platform/DeprecatedCString.h:
3024         * platform/DeprecatedPtrList.h:
3025         * platform/DeprecatedPtrListImpl.cpp:
3026         * platform/DeprecatedPtrListImpl.h:
3027         * platform/DeprecatedPtrQueue.h:
3028         * platform/DeprecatedString.cpp:
3029         * platform/DeprecatedString.h:
3030         * platform/DeprecatedStringList.cpp:
3031         * platform/DeprecatedStringList.h:
3032         * platform/DeprecatedValueList.h:
3033         * platform/DeprecatedValueListImpl.cpp:
3034         * platform/DeprecatedValueListImpl.h:
3035         * platform/FileButton.h:
3036         * platform/FloatPoint.h:
3037         * platform/FloatRect.h:
3038         * platform/FloatSize.h:
3039         * platform/FontData.h:
3040         * platform/FontFallbackList.h:
3041         * platform/GraphicsContext.h:
3042         * platform/IntPoint.h:
3043         * platform/IntRect.h:
3044         * platform/IntSize.h:
3045         * platform/KURL.cpp:
3046         * platform/KURL.h:
3047         * platform/ListBox.h:
3048         * platform/Logging.cpp:
3049         * platform/Logging.h:
3050         * platform/Pen.h:
3051         * platform/PopUpButton.h:
3052         * platform/RegularExpression.cpp:
3053         * platform/RegularExpression.h:
3054         * platform/SSLKeyGenerator.h:
3055         * platform/ScrollBar.h:
3056         * platform/SegmentedString.h:
3057         * platform/Shared.h:
3058         * platform/Slider.h:
3059         * platform/StringImpl.h:
3060         * platform/TextBox.h:
3061         * platform/TextField.h:
3062         * platform/TextStream.cpp:
3063         * platform/TextStream.h:
3064         * platform/TransferJob.h:
3065         * platform/TransferJobClient.h:
3066         * platform/Widget.h:
3067         * platform/cg/AffineTransformCG.cpp:
3068         * platform/mac/ClipboardMac.h:
3069         * platform/mac/ClipboardMac.mm:
3070         * platform/mac/DeprecatedStringListMac.mm:
3071         * platform/mac/FontCacheMac.mm:
3072         * platform/mac/KURLMac.mm:
3073         * platform/mac/ListBoxMac.mm:
3074         * platform/mac/PopUpButtonMac.mm:
3075         * platform/mac/SSLKeyGeneratorMac.mm:
3076         * platform/mac/TextBoxMac.mm:
3077         * platform/mac/TextFieldMac.mm:
3078         * platform/mac/WebCoreTextArea.h:
3079         * platform/mac/WebCoreTextArea.mm:
3080         * platform/mac/WebCoreTextField.h:
3081         * platform/mac/WebCoreTextField.mm:
3082         * rendering/DeprecatedRenderSelect.h:
3083         * rendering/RenderArena.cpp:
3084         * rendering/RenderArena.h:
3085         * rendering/RenderBlock.cpp:
3086         * rendering/RenderBox.cpp:
3087         * rendering/RenderContainer.cpp:
3088         * rendering/RenderFlexibleBox.cpp:
3089         * rendering/RenderFlow.cpp:
3090         * rendering/RenderLayer.cpp:
3091         * rendering/RenderLineEdit.cpp:
3092         * rendering/RenderObject.h:
3093         * rendering/RenderStyle.cpp:
3094         * rendering/RenderStyle.h:
3095         * rendering/RenderText.cpp:
3096         * rendering/RenderTextFragment.cpp:
3097         * rendering/RenderTheme.h:
3098         * rendering/RenderTreeAsText.cpp:
3099         * rendering/RenderTreeAsText.h:
3100         * rendering/RenderView.h:
3101         * rendering/bidi.h:
3102         * xml/XSLStyleSheet.cpp:
3103         * xml/XSLTProcessor.cpp:
3104
3105 2006-07-09  Geoffrey Garen  <ggaren@apple.com>
3106
3107         Reviewed by Beth.
3108
3109         * bindings/js/kjs_window.cpp:
3110         (KJS::Window::clear): Garbage collect after reinitalizing the global
3111         object, not before, since the reinitialization tends to create garbage.
3112
3113 2006-07-09  Timothy Hatcher  <timothy@apple.com>
3114
3115         Reviewed by Darin.
3116
3117         Bug 9820: Move new DOM API that has been through API review to public headers
3118         http://bugzilla.opendarwin.org/show_bug.cgi?id=9820
3119
3120         * bindings/objc/DOM.mm:
3121         (-[DOMElement focus]):
3122         (-[DOMElement blur]):
3123         (-[DOMRange text]):
3124         (-[DOMRange _text]):
3125         * bindings/objc/DOMCSS.mm:
3126         (-[DOMRGBColor color]):
3127         (-[DOMRGBColor _color]):
3128         * bindings/objc/DOMCore.h:
3129         * bindings/objc/DOMEvents.h:
3130         * bindings/objc/DOMExtensions.h:
3131         * bindings/objc/DOMHTML.mm:
3132         (-[DOMHTMLElement titleDisplayString]):
3133         (-[DOMHTMLDocument createDocumentFragmentWithMarkupString:baseURL:]):
3134         (-[DOMHTMLDocument createDocumentFragmentWithText:]):
3135         (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:]):
3136         (-[DOMHTMLDocument _createDocumentFragmentWithText:]):
3137         * bindings/objc/DOMPrivate.h:
3138         * bindings/objc/DOMXPath.h:
3139         * bindings/objc/DOMXPath.mm:
3140
3141 2006-07-09  Beth Dakin  <bdakin@apple.com>
3142
3143         Reviewed by Maciej.
3144
3145         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9749 A 
3146         nested content editable div causes unnecessary screen redraws.
3147         
3148         We were repainting too much because we were deciding that we needed 
3149         a full layout because we didn't have a first line box. Our code 
3150         used to hold a lot of assumptions that positioned elements would 
3151         always have line boxes, but I fixed a few bugs a while back that 
3152         appeared because this assumption isn't true. This assumption was 
3153         also causing the extra redraws because the check meant that we 
3154         would decide to do a full layout for any positioned element that 
3155         did not have any line boxes in the first place. Maciej and I talked 
3156         about this, and we couldn't figure out why the check for line boxes 
3157         was part of determining if we need a full layout in the first 
3158         place. After hunting around the code, we decided to assume that 
3159         this check is antiquated. Removing it fixes the bug and doesn't 
3160         seem to break any layout tests. So, fingers crossed!
3161
3162         Will add layout test so soon.
3163
3164         * rendering/bidi.cpp:
3165         (WebCore::RenderBlock::layoutInlineChildren): Remove firstLineBox 
3166         check.
3167
3168 2006-07-09  David Harrison  <harrison@apple.com>
3169
3170         Reviewed by John Sullivan.
3171
3172         <rdar://problem/4598149> Deleting the contents of a DOMRange and then inserting a node into it crashes in WebCore::Font::canUseGlyphCache
3173
3174         Test: fast/dom/delete-contents.html
3175         
3176         * dom/Range.cpp:
3177         (WebCore::Range::processContents):
3178
3179 2006-07-09  Darin Adler  <darin@apple.com>
3180
3181         - another round of renaming; and KWQ is dead
3182
3183         * WebCore.vcproj/WebCore/WebCore.vcproj: Remove paths for kwq and khtml directories.
3184         Move files to their new locations. Did rename.
3185         * WebCore.xcodeproj/project.pbxproj: Move files to their new locations. Did rename.
3186         * WebCoreSources.bkl: Did rename.
3187         * webcore-base.bkl: Removed kwq.
3188
3189         * kwq/AccessibilityObjectCache.h: Removed.
3190         * kwq/AccessibilityObjectCache.mm: Removed.
3191         * kwq/FormDataMac.h: Removed.
3192         * kwq/FormDataMac.mm: Removed.
3193         * kwq/WebCoreAXObject.h: Removed.
3194         * kwq/WebCoreAXObject.mm: Removed.
3195         * kwq/WebCoreEditCommand.h: Removed.
3196         * kwq/WebCoreEditCommand.mm: Removed.
3197         * kwq/WebCorePageState.h: Removed.
3198         * kwq/WebCorePageState.mm: Removed.
3199         * kwq/WebCoreResourceLoaderImp.h: Removed.
3200         * kwq/WebCoreResourceLoaderImp.mm: Removed.
3201
3202         * bridge/AXObjectCache.h: Added.
3203         * bridge/mac/AXObjectCacheMac.mm: Added.
3204         * bridge/mac/WebCoreAXObject.h: Added.
3205         * bridge/mac/WebCoreAXObject.mm: Added.
3206
3207         * loader/CachedObject.cpp: Removed.
3208         * loader/CachedObject.h: Removed.
3209         * loader/CachedObjectClient.h: Removed.
3210         * loader/CachedObjectClientWalker.cpp: Removed.
3211         * loader/CachedObjectClientWalker.h: Removed.
3212
3213         * loader/CachedResource.cpp: Added.
3214         * loader/CachedResource.h: Added.
3215         * loader/CachedResourceClient.h: Added.
3216         * loader/CachedResourceClientWalker.cpp: Added.
3217         * loader/CachedResourceClientWalker.h: Added.
3218
3219         * bridge/mac/FrameMac.mm:
3220         * bridge/mac/WebCoreFrameBridge.mm:
3221         * css/CSSImageValue.h:
3222         * css/CSSImportRule.h:
3223         * dom/Document.cpp:
3224         * dom/Document.h:
3225         * dom/Notation.h:
3226         * dom/ProcessingInstruction.h:
3227         * dom/XMLTokenizer.cpp:
3228         * html/CanvasPattern.h:
3229         * html/HTMLDocument.h:
3230         * html/HTMLImageLoader.cpp:
3231         * html/HTMLImageLoader.h:
3232         * html/HTMLLinkElement.h:
3233         * html/HTMLScriptElement.cpp:
3234         * html/HTMLScriptElement.h:
3235         * html/HTMLTokenizer.cpp:
3236         * html/HTMLTokenizer.h:
3237         * kcanvas/KCanvasFilters.h:
3238         * ksvg2/svg/SVGCursorElement.cpp:
3239         * ksvg2/svg/SVGCursorElement.h:
3240         * ksvg2/svg/SVGFEImageElement.cpp:
3241         * ksvg2/svg/SVGFEImageElement.h:
3242         * loader/Cache.cpp:
3243         * loader/Cache.h:
3244         * loader/CachedCSSStyleSheet.cpp:
3245         * loader/CachedCSSStyleSheet.h:
3246         * loader/CachedImage.cpp:
3247         * loader/CachedImage.h:
3248         * loader/CachedScript.cpp:
3249         * loader/CachedScript.h:
3250         * loader/CachedXBLDocument.cpp:
3251         * loader/CachedXBLDocument.h:
3252         * loader/CachedXSLStyleSheet.cpp:
3253         * loader/CachedXSLStyleSheet.h:
3254         * loader/DocLoader.cpp:
3255         * loader/DocLoader.h:
3256         * loader/LoaderFunctions.h:
3257         * loader/Request.cpp:
3258         * loader/Request.h:
3259         * loader/loader.cpp:
3260         * loader/loader.h:
3261         * loader/mac/LoaderFunctionsMac.mm:
3262         * page/Frame.cpp:
3263         * page/FrameView.cpp:
3264         * platform/gdk/TemporaryLinkStubs.cpp:
3265         * platform/mac/ClipboardMac.h:
3266         * platform/win/TemporaryLinkStubs.cpp:
3267         * rendering/RenderBox.h:
3268         * rendering/RenderContainer.cpp:
3269         * rendering/RenderImage.cpp:
3270         * rendering/RenderImage.h:
3271         * rendering/RenderLayer.h:
3272         * rendering/RenderObject.cpp:
3273         * rendering/RenderObject.h:
3274         * rendering/RenderStyle.cpp:
3275         * rendering/RenderStyle.h:
3276         * xml/XSLImportRule.h:
3277         Did renaming.
3278
3279         * platform/mac/can-convert.mm: Removed.
3280
3281 2006-07-09  Anders Carlsson  <acarlsson@apple.com>
3282
3283         Reviewed by Tim O.
3284
3285         * WebCore.exp:
3286         Add wkPathFromFont.
3287         
3288         * platform/mac/FontDataMac.mm:
3289         (-[NSFont WebCore]):
3290         Use wkPathFromFont.
3291         
3292         * platform/mac/WebCoreSystemInterface.h:
3293         * platform/mac/WebCoreSystemInterface.mm:
3294         Declare wkPathFromFont.
3295
3296 2006-07-09  Brady Eidson  <beidson@apple.com>
3297
3298         Reviewed by Maciej
3299
3300         Set the stage to remove the workaround for the SQLite BLOB corruption.  A few other small cleanups, and
3301         preparation for pruning unreferenced and unretained icons.
3302
3303         * icon/IconDatabase.cpp:
3304         (WebCore::IconDatabase::recreateDatabase):  Added another trigger to assist in icon removal
3305         (WebCore::IconDatabase::deletePrivateTables):  Cleaned up logging messages
3306         (WebCore::IconDatabase::imageDataForIconID):  #ifdefed the blobbing hack for impending removal, use the real blob by default
3307         (WebCore::IconDatabase::imageDataForIconURL):  same
3308         (WebCore::IconDatabase::imageDataForPageURL):  same
3309         (WebCore::IconDatabase::pruneUnreferencedIcons):  Will delete any icons and their data that are not referenced
3310           by any PageURL
3311         * icon/IconDatabase.h:
3312
3313         * icon/SQLDatabase.h:  Changed BlobAsVector to be unsigned char as thats the most reasonable type for
3314           a byte-buffer, and is what CFData expects
3315         * icon/SQLStatement.cpp:
3316         (WebCore::SQLStatement::getColumnBlobAsVector):
3317
3318 2006-07-09  Darin Adler  <darin@apple.com>
3319
3320         - move all but the last 12 files out of kwq directory
3321         - removed a few unused source files I discovered
3322
3323         * WebCore.vcproj/WebCore/WebCore.vcproj: Update for new file locations.
3324         * WebCore.xcodeproj/project.pbxproj: Ditto.
3325
3326         * bridge/mac/FrameMac.mm:
3327         * dom/Element.h:
3328         * html/HTMLImageLoader.cpp:
3329         * loader/Cache.cpp:
3330         * loader/Cache.h:
3331         * loader/CachedCSSStyleSheet.cpp:
3332         * loader/CachedCSSStyleSheet.h:
3333         * loader/CachedImage.cpp:
3334         * loader/CachedImage.h:
3335         * loader/CachedObject.h:
3336         * loader/CachedScript.cpp:
3337         * loader/CachedScript.h:
3338         * loader/CachedXBLDocument.cpp:
3339         * loader/CachedXBLDocument.h:
3340         * loader/CachedXSLStyleSheet.cpp:
3341         * loader/CachedXSLStyleSheet.h:
3342         * loader/DocLoader.cpp:
3343         * loader/DocLoader.h:
3344         * page/Frame.cpp:
3345         * page/Frame.h:
3346         * page/FramePrivate.h:
3347         * platform/gdk/TemporaryLinkStubs.cpp:
3348         * platform/win/TemporaryLinkStubs.cpp:
3349         * rendering/DeprecatedSlider.cpp:
3350         * rendering/RenderObject.h:
3351         * xml/xmlhttprequest.cpp:
3352         Updated includes as needed for file location changes. Changed
3353         CachePolicy uses to match new filename and enum names.
3354
3355         * loader/CachedResource.cpp: Removed.
3356         * loader/CachedResource.h: Removed.
3357         * loader/CachedResourceClient.h: Removed.
3358         * loader/CachedResourceClientWalker.cpp: Removed.
3359         * loader/CachedResourceClientWalker.h: Removed.
3360         The above files were checked in by accident a while back. The rename of
3361         CachedObject to CachedResource is now reflected in do-webcore-rename,
3362         and will be done soon.
3363
3364         * kwq/AffineTransform.cpp: Removed.
3365         * kwq/AffineTransform.h: Removed.
3366         * kwq/CacheControl.h: Removed.
3367         * kwq/DeprecatedPtrQueue.h: Removed.
3368         * kwq/FileButton.h: Removed.
3369         * kwq/FileButton.mm: Removed.
3370         * kwq/ListBox.h: Removed.
3371         * kwq/ListBox.mm: Removed.
3372         * kwq/LoaderFunctions.h: Removed.
3373         * kwq/LoaderFunctions.mm: Removed.
3374         * kwq/PopUpButton.h: Removed.
3375         * kwq/PopUpButton.mm: Removed.
3376         * kwq/SSLKeyGenerator.h: Removed.
3377         * kwq/SSLKeyGenerator.mm: Removed.
3378         * kwq/Settings.h: Removed.
3379         * kwq/TextBox.h: Removed.
3380         * kwq/TextBox.mm: Removed.
3381         * kwq/TextField.h: Removed.
3382         * kwq/TextField.mm: Removed.
3383         * kwq/WebCoreScrollBar.h: Removed.
3384         * kwq/WebCoreScrollBar.mm: Removed.
3385         * kwq/WebCoreSlider.h: Removed.
3386         * kwq/WebCoreSlider.mm: Removed.
3387
3388         * loader/CachePolicy.h: Added.
3389         * loader/LoaderFunctions.h: Added.
3390
3391         * loader/mac/LoaderFunctionsMac.mm: Added.
3392
3393         * page/Settings.h: Added.
3394
3395         * platform/AffineTransform.cpp: Added.
3396         * platform/AffineTransform.h: Added.
3397         * platform/DeprecatedPtrQueue.h: Added.
3398         * platform/FileButton.h: Added.
3399         * platform/ListBox.h: Added.
3400         * platform/PopUpButton.h: Added.
3401         * platform/SSLKeyGenerator.h: Added.
3402         * platform/ScrollBar.h: Added.
3403         * platform/Slider.h: Added.
3404         * platform/TextBox.h: Added.
3405         * platform/TextField.h: Added.
3406
3407         * platform/cg/AffineTransformCG.cpp: Added.
3408
3409         * platform/mac/FileButtonMac.mm: Added.
3410         * platform/mac/ListBoxMac.mm: Added.
3411         * platform/mac/PopUpButtonMac.mm: Added.
3412         * platform/mac/SSLKeyGeneratorMac.mm: Added.
3413         * platform/mac/ScrollBarMac.mm: Added.
3414         * platform/mac/ScrollBarMac.mm: Added.
3415         * platform/mac/SliderMac.mm: Added.
3416         * platform/mac/SliderMac.mm: Added.
3417         * platform/mac/TextBoxMac.mm: Added.
3418         * platform/mac/TextFieldMac.mm: Added.
3419
3420 2006-07-09  Darin Adler  <darin@apple.com>
3421
3422         - move 4 files out of kwq directory
3423         - make some minor project adjustments for the WebCore project
3424
3425         * WebCore.xcodeproj/project.pbxproj: Link libsqlite3 the same way we do other
3426         libraries, rather than using a custom linker option. Moved the files from their
3427         old locations to the new ones. Removed "khtml" from the list of header search
3428         paths since that directory doesn't exist any more. Eliminated STYLE_LDFLAGS
3429         and just put -umbrella WebKit in OTHER_LDFLAGS in the Production configuration
3430         (was a leftover from "build styles" in Xcode 1). Changed to use EXPORTED_SYMBOLS_FILE
3431         instead of using -exported_symbols_list directly again now that Xcode has fixed the
3432         "strip twice" bug. Removed unneeded explicit SECTORDER_FLAGS = "" settings.
3433         Removed the explicit -Y,3 option now that Xcode does that by default.
3434
3435         * WebCore.vcproj/WebCore/WebCore.vcproj: Removed some obsolete uneeded files,
3436         many of which didn't exist any more. Moved the files from their old locations
3437         to the new ones.
3438
3439         * WebCoreSources.bkl: Moved the files from their old locations to the new ones.
3440
3441         * kwq/DeprecatedCString.cpp: Removed.
3442         * kwq/DeprecatedCString.h: Removed.
3443         * kwq/TextStream.cpp: Removed.
3444         * kwq/TextStream.h: Removed.
3445         * platform/DeprecatedCString.cpp: Added.
3446         * platform/DeprecatedCString.h: Added.
3447         * platform/TextStream.cpp: Added.
3448         * platform/TextStream.h: Added.
3449
3450 2006-07-09  Darin Adler  <darin@apple.com>
3451
3452         Rubber stamped by Maciej (kinda).
3453
3454         - did the next pass of renaming (used do-webcore-rename script)
3455           this takes care of most of the remaining KWQ names (almost all)
3456
3457         * WebCore+SVG/DOMList.h:
3458         * WebCore.vcproj/WebCore/WebCore.vcproj:
3459         * WebCore.xcodeproj/project.pbxproj:
3460         * WebCoreSources.bkl:
3461         * bindings/js/kjs_dom.cpp:
3462         * bindings/js/kjs_window.cpp:
3463         * bindings/objc/DOMHTML.mm:
3464         * bridge/mac/FrameMac.h:
3465         * bridge/mac/FrameMac.mm:
3466         * bridge/mac/WebCoreFrameBridge.mm:
3467         * bridge/mac/WebCoreSettings.h:
3468         * bridge/mac/WebCoreSettings.mm:
3469         * bridge/win/FrameWin.cpp:
3470         * css/CSSPrimitiveValue.cpp:
3471         * css/CSSValueKeywords.in:
3472         * css/MediaQueryEvaluator.cpp:
3473         * css/cssparser.cpp:
3474         * css/cssstyleselector.cpp:
3475         * css/cssstyleselector.h:
3476         * dom/CharacterData.cpp:
3477         * dom/CharacterData.h:
3478         * dom/Document.cpp:
3479         * dom/Element.cpp:
3480         * dom/Element.h:
3481         * dom/EventTargetNode.cpp:
3482         * dom/EventTargetNode.h:
3483         * dom/Node.cpp:
3484         * dom/Node.h:
3485         * dom/Position.cpp:
3486         * dom/ProcessingInstruction.cpp:
3487         * dom/QualifiedName.cpp:
3488         * dom/QualifiedName.h:
3489         * dom/XMLTokenizer.cpp: Added.
3490         * dom/xml_tokenizer.cpp: Removed.
3491         * dom/xml_tokenizer.h: Removed.
3492         * editing/EditAction.h:
3493         * editing/HTMLInterchange.cpp:
3494         * editing/HTMLInterchange.h:
3495         * editing/Selection.h:
3496         * editing/SelectionController.h:
3497         * editing/TextAffinity.h:
3498         * editing/TextIterator.cpp:
3499         * editing/TextIterator.h:
3500         * editing/VisiblePosition.h:
3501         * editing/htmlediting.cpp:
3502         * editing/markup.cpp:
3503         * editing/markup.h:
3504         * editing/visible_units.cpp:
3505         * editing/visible_units.h:
3506         * html/HTMLDocument.cpp:
3507         * html/HTMLFontElement.cpp:
3508         * html/HTMLInputElement.cpp:
3509         * html/HTMLKeygenElement.cpp:
3510         * html/HTMLSelectElement.h: