c8b953a6c3af20b19b1708623f44384d743a31b4
[WebKit-https.git] / WebCore / ChangeLog
1 2006-05-11  David Hyatt  <hyatt@apple.com>
2
3         Remove drawLineForText from the Font API.  Implement it natively in
4         the two GraphicsContexts (CG and Cairo) instead.
5
6         Reviewed by maciej
7
8         * platform/Font.h:
9         * platform/FontData.h:
10         * platform/GraphicsContext.cpp:
11         * platform/GraphicsContext.h:
12         * platform/cairo/GraphicsContextCairo.cpp:
13         (WebCore::GraphicsContext::drawLineForText):
14         * platform/cg/GraphicsContextCG.cpp:
15         (WebCore::GraphicsContext::drawLineForText):
16         * platform/mac/FontData.mm:
17         * platform/mac/FontMac.mm:
18         * platform/win/FontWin.cpp:
19         (WebCore::Font::drawLineForText):
20         * rendering/InlineTextBox.cpp:
21         (WebCore::InlineTextBox::paintDecoration):
22         (WebCore::InlineTextBox::paintMarkedTextUnderline):
23         * rendering/render_line.cpp:
24         (WebCore::InlineFlowBox::paintDecorations):
25
26 2006-05-11  Steve Falkenburg  <sfalken@apple.com>
27
28         Reviewed by eric.
29
30         Fix last fix.
31
32         * dom/QualifiedName.h:
33         (WebCore::QualifiedName::QualifiedName):
34
35 2006-05-11  Steve Falkenburg  <sfalken@apple.com>
36
37         Reviewed by eric.
38
39         Fix crash on static constructors builds at exit due to qualified name default constructor not
40         initializing m_impl.
41
42         * dom/QualifiedName.cpp:
43         (WebCore::QualifiedName::deref):
44
45 2006-05-11  Mitz Pettel  <opendarwin.org@mitzpettel.com>
46
47         Reviewed by hyatt
48
49         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8851
50           REGRESSION: RTL text shifted to the right
51
52         Already covered by several tests in fast/text
53
54         * platform/Font.h:
55         (WebCore::TextRun::TextRun): Added length parameter.
56         * rendering/InlineTextBox.cpp: Pass the length to the TextRun constructor.
57         (WebCore::InlineTextBox::selectionRect):
58         (WebCore::InlineTextBox::paint):
59         (WebCore::InlineTextBox::paintSelection):
60         (WebCore::InlineTextBox::paintMarkedTextBackground):
61         (WebCore::InlineTextBox::paintTextMatchMarker):
62         (WebCore::InlineTextBox::offsetForPosition):
63         (WebCore::InlineTextBox::positionForOffset):
64         * rendering/RenderText.cpp:
65         (WebCore::RenderText::widthFromCache): Pass length and from instead of from and to
66         to the TextRun constructor.
67         (WebCore::RenderText::width): Ditto.
68
69 2006-05-11  David Hyatt  <hyatt@apple.com>
70
71         Fix a regression from the TextRun landing.  Delete the characters in
72         the adjustedRun, not the ones in the original run!
73
74         Reviewed by beth
75
76         * platform/mac/FontMac.mm:
77         (WebCore::Font::drawComplexText):
78
79 2006-05-10  Justin Garcia  <justin.garcia@apple.com>
80
81         Reviewed by thatcher, levi
82
83         * editing/ReplaceSelectionCommand.cpp:
84         (WebCore::ReplaceSelectionCommand::doApply):
85         Removed a use fragment.hasMoreThanOneBlock to decide if the paragraph containing the
86         position pasted into must be split to avoid block nesting.  We now split unnecessarily
87         some times, but the end merge cleans up for us.
88
89 2006-05-11  David Hyatt  <hyatt@apple.com>
90
91         This patch makes drawHighlightForText a completely cross-platform method
92         implemented by the GraphicsContext.  The platform-specific implementations
93         of the method in the Font class have been eliminated.
94
95         Reviewed by andersca
96
97         * platform/Font.h:
98         * platform/FontData.h:
99         Remove the drawHighlight methods.  Change the selectionRect method in
100         Font to return a FloatRect so that the GraphicsContext can do an accurate
101         fill.
102
103         * platform/GraphicsContext.cpp:
104         (WebCore::GraphicsContext::drawHighlightForText):
105         Implement the drawHighlightFunction in terms of the cross-platform
106         Font selectionRect functions and a new float-based fillRect graphics context
107         function.
108
109         * platform/GraphicsContext.h:
110         * platform/cairo/GraphicsContextCairo.cpp:
111         (WebCore::GraphicsContext::fillRect):
112         * platform/cg/GraphicsContextCG.cpp:
113         (WebCore::GraphicsContext::fillRect):
114         Add the new float-based fillRect function for Cairo and CG.
115
116         * platform/mac/FontData.mm:
117         (WebCore::CG_draw):
118         (WebCore::ATSU_draw):
119         Removed the CG and ATSU drawHighlight methods.  Remove the drawing of
120         the background from the deprecated draw methods (they'll be removed
121         soon).
122
123         * platform/mac/FontMac.mm:
124         (WebCore::Font::selectionRectForText):
125         * platform/win/FontWin.cpp:
126         (WebCore::Font::selectionRectForText):
127         Change selectionRectForText to return a FloatRect instead of an IntRect,
128         so that the GraphicsContext can do a precise fill.
129
130         * rendering/InlineTextBox.cpp:
131         (WebCore::InlineTextBox::selectionRect):
132         (WebCore::InlineTextBox::positionForOffset):
133         Modify the callers who expect an int-based selection rect so that they call
134         enclosingIntRect.
135
136 2006-05-11  Darin Adler  <darin@apple.com>
137
138         Reviewed by Adele.
139
140         - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8743
141           REGRESSION: focus() on input field selects all text within it
142           (was: cannot select cities on British Rail reservation site)
143
144         Test: fast/forms/double-focus.html
145
146         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::focus):
147         Changed to only call setFocusNode, select, and revealSelection
148         if the element is not already focused. Also changed to use return
149         a bit more rather than else.
150
151 2006-05-11  Darin Adler  <darin@apple.com>
152
153         Reviewed by Tim Hatcher (earlier version).
154
155         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8821
156           use the preprocessor for IDL files
157
158         * bindings/scripts/IDLParser.pm: Invoke the preprocessor via the "gcc"
159         driver script, passing "-E" so we only preprocess, "-P" so we don't get
160         "#line" directives, and "-x c++" so we handle both C and C++ comments.
161         Removed the code to eliminate comments since the preprocessor handles that.
162         * css/make-css-file-arrays.pl: This already invoked the preprocessor, but
163         updated it to do the same way as above.
164
165 2006-05-11  Anders Carlsson  <acarlsson@apple.com>
166
167         Reviewed by Darin.
168
169         http://bugzilla.opendarwin.org/show_bug.cgi?id=7838
170         Add support for mozilla-style node constructors as properties of the window object
171         
172         * DerivedSources.make:
173         * WebCore.xcodeproj/project.pbxproj:
174         Add new generated files.
175         
176         * bindings/js/JSCanvasRenderingContext2DBase.cpp:
177         (WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
178         * bindings/js/JSHTMLElementWrapperFactory.cpp:
179         (WebCore::createJSWrapper):
180         Specify the KJS namespace for JSHTMLElmement.
181                 
182         * bindings/js/kjs_dom.cpp:
183         (KJS::toJS):
184         Create a WebCore::JSHTMLDocument for document nodes. Also, create
185         JSDocumentFragments for document fragments (instead of plain node objects).
186         
187         * bindings/js/kjs_html.cpp:
188         (KJS::JSHTMLDocumentProtoFunc::callAsFunction):
189         (KJS::JSHTMLDocument::JSHTMLDocument):
190         (KJS::JSHTMLDocument::getOwnPropertySlot):
191         Add a prototype for JSHTMLDocument and move all functions there.
192         
193         (KJS::JSHTMLElement::JSHTMLElement):
194         (KJS::JSHTMLElement::getOwnPropertySlot):
195         Update since JSHTMLElement now inherits from WebCore::JSHTMLElement.
196         
197         (KJS::JSHTMLElement::getValueProperty):
198         (KJS::JSHTMLElement::putValueProperty):
199         Remove title setter and getter. Those are autogenerated now.
200         
201         * bindings/js/kjs_html.h:
202         (KJS::JSHTMLElement::):
203         Inherit from WebCore::JSHTMLElement. Clarify the inheritance chain.
204         
205         * bindings/scripts/CodeGeneratorJS.pm:
206         Always generate a prototype object, regardless of whether the object has any functions or
207         constants.
208         
209         Use the type of generator attributes to determine what constructor to use. This is useful for
210         the XMLDocument property in DOMWindow.idl, since that's just an alias for the Document constructor.
211         
212         * dom/DocumentFragment.idl: Added.        
213         * html/HTMLDocument.idl: Added.
214         * html/HTMLElement.idl: Added.
215         
216         * page/DOMWindow.idl:
217         Add constructors for DocumentFragment, HTMLElement, HTMLDocument and XMLDocument. XMLDocument is just
218         an alias for the Document constructor.
219         
220 2006-05-11  David Hyatt  <hyatt@apple.com>
221
222         Bug 8845.  Define a TextRun (similar to the old WebCoreTextRun) and
223         make it the new API for Font and GraphicsContext when drawing/measuring
224         text.
225
226         Reviewed by andersca
227
228         * platform/Font.cpp:
229         (WebCore::m_finalRoundingWidth):
230         (WebCore::WidthIterator::advance):
231         (WebCore::WidthIterator::normalizeVoicingMarks):
232         (WebCore::Font::width):
233         (WebCore::Font::canUseGlyphCache):
234         (WebCore::Font::drawSimpleText):
235         (WebCore::Font::drawText):
236         (WebCore::Font::floatWidth):
237         (WebCore::Font::floatWidthForSimpleText):
238         * platform/Font.h:
239         (WebCore::TextRun::m_to):
240         (WebCore::TextRun::operator[]):
241         (WebCore::TextRun::data):
242         (WebCore::TextRun::adjustFrom):
243         (WebCore::TextRun::adjustTo):
244         (WebCore::TextRun::characters):
245         (WebCore::TextRun::length):
246         (WebCore::TextRun::from):
247         (WebCore::TextRun::to):
248         * platform/GraphicsContext.cpp:
249         (WebCore::GraphicsContext::drawText):
250         (WebCore::GraphicsContext::drawHighlightForText):
251         * platform/GraphicsContext.h:
252         * platform/mac/FontMac.mm:
253         (WebCore::addDirectionalOverride):
254         (WebCore::overrideLayoutOperation):
255         (WebCore::ATSULayoutParameters::initialize):
256         (WebCore::Font::selectionRectForText):
257         (WebCore::Font::drawComplexText):
258         (WebCore::Font::drawHighlightForText):
259         (WebCore::Font::floatWidthForComplexText):
260         (WebCore::Font::checkSelectionPoint):
261         * platform/win/FontWin.cpp:
262         (WebCore::hackishExtentForString):
263         (WebCore::Font::floatWidth):
264         (WebCore::Font::drawText):
265         (WebCore::Font::drawHighlightForText):
266         (WebCore::Font::selectionRectForText):
267         (WebCore::Font::checkSelectionPoint):
268         * rendering/InlineTextBox.cpp:
269         (WebCore::InlineTextBox::selectionRect):
270         (WebCore::InlineTextBox::paint):
271         (WebCore::InlineTextBox::paintSelection):
272         (WebCore::InlineTextBox::paintMarkedTextBackground):
273         (WebCore::InlineTextBox::paintTextMatchMarker):
274         (WebCore::InlineTextBox::offsetForPosition):
275         (WebCore::InlineTextBox::positionForOffset):
276         * rendering/RenderBlock.cpp:
277         (WebCore::stripTrailingSpace):
278         * rendering/RenderFlexibleBox.cpp:
279         (WebCore::RenderFlexibleBox::layoutVerticalBox):
280         * rendering/RenderImage.cpp:
281         (WebCore::RenderImage::imageChanged):
282         (WebCore::RenderImage::paint):
283         * rendering/RenderText.cpp:
284         (WebCore::RenderText::cacheWidths):
285         (WebCore::RenderText::widthFromCache):
286         (WebCore::RenderText::trimmedMinMaxWidth):
287         (WebCore::RenderText::calcMinMaxWidth):
288         (WebCore::RenderText::width):
289         * rendering/RenderTextField.cpp:
290         (WebCore::RenderTextField::calcMinMaxWidth):
291         * rendering/bidi.cpp:
292         (WebCore::RenderBlock::tabWidth):
293         (WebCore::RenderBlock::checkLinesForTextOverflow):
294         * rendering/render_line.cpp:
295         (WebCore::EllipsisBox::paint):
296         * rendering/render_list.cpp:
297         (WebCore::RenderListMarker::paint):
298         (WebCore::RenderListMarker::calcMinMaxWidth):
299         (WebCore::RenderListMarker::getRelativeMarkerRect):
300
301 2006-05-10  Justin Garcia  <justin.garcia@apple.com>
302
303         Reviewed by darin
304
305         * editing/ReplaceSelectionCommand.cpp:
306         (WebCore::ReplaceSelectionCommand::doApply):
307         Removed the code to find out if we must later add smart replace whitespace.  We can 
308         wait until we've done the insertion to figure it out, and the position sampled (startPos)
309         to make the decision about trailing whitespace was wrong.
310         Changed the order that work is done during a paste: 1) Insert everything 2) Do one of
311         the following: a) handle a trailing interchange newline, b) uncollapse the last incoming
312         br if it has been collapsed because of quirks mode, c) do an end merge 3) Add smart replace
313         whitespace (2 and 3 were reversed because the end merge must happen before we can know
314         whether or not we need to add a trailing space).
315         Don't do an end merge if the last node inserted was a br because the end merge will 
316         clobber it.
317         
318         (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
319         brs where [br, 0] is at the end of a block and not at the start of a paragraph
320         are the ones that are collapsed because of quirks mode.
321
322 2006-05-10  David Hyatt  <hyatt@apple.com>
323
324         Rename isSpace to treatAsSpace.  Move it and the rounding hack function into
325         Font and make them static methods (inlined in the header).  Make the rounding
326         hack character table a static member as well.  Remove the redundant space/rounding
327         functions from FontData.mm.
328
329         Reviewed by darin
330
331         * platform/Font.cpp:
332         (WebCore::):
333         (WebCore::m_finalRoundingWidth):
334         (WebCore::WidthIterator::advance):
335         * platform/Font.h:
336         (WebCore::Font::treatAsSpace):
337         (WebCore::Font::isRoundingHackCharacter):
338         * platform/mac/FontData.mm:
339         (WebCore::overrideLayoutOperation):
340         (WebCore::createATSULayoutParameters):
341         (WebCore::initializeWidthIterator):
342         (WebCore::advanceWidthIterator):
343         * platform/mac/FontMac.mm:
344         (WebCore::overrideLayoutOperation):
345         (WebCore::ATSULayoutParameters::initialize):
346
347 2006-05-10  Darin Adler  <darin@apple.com>
348
349         * WebCore: Removed an extra WebCore subtree that somehow got checked in.
350
351 >>>>>>> .r14297
352 2006-05-10  David Carson <dacarson@gmail.com>
353
354         - Fix for bug 8833. Removed inline keyword from functions declared
355         in .mm and .cpp files. inline function code needs to reside in the
356         header file for the linker to find the code. 
357         http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.7
358
359         Reviewed by Darin, landed by Timothy.
360
361         * platform/Font.cpp:
362         (WebCore::isSpace):
363         * platform/mac/FontData.mm:
364         (WebCore::widthForGlyph):
365         (WebCore::isRoundingHackCharacter):
366         (WebCore::glyphForCharacter):
367
368 2006-05-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
369
370         Reviewed and landed by Anders.
371
372         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8830
373           REGRESSION: Words render on top of each other when fallback font is used
374
375         Already covered by several pixel tests in fast/text
376
377         * platform/Font.cpp:
378         (WebCore::Font::drawSimpleText):
379
380 2006-05-10  David Hyatt  <hyatt@apple.com>
381
382         Fix for bug 8809, lift the Mac-specific WebTextRenderer code for
383         drawing and measuring of runs up into the Font class.  The fast code
384         path is in Font.cpp and is designed to be mostly cross-platform.  The
385         slow code path is in FontMac.cpp and is Mac-specific.
386
387         Reviewed by darin
388
389         * WebCore.xcodeproj/project.pbxproj:
390         * platform/Font.cpp:
391         (WebCore::isSpace):
392         (WebCore::):
393         (WebCore::isRoundingHackCharacter):
394         (WebCore::m_finalRoundingWidth):
395         (WebCore::WidthIterator::advance):
396         (WebCore::WidthIterator::normalizeVoicingMarks):
397         (WebCore::Font::primaryFont):
398         (WebCore::Font::setAlwaysUseComplexPath):
399         (WebCore::Font::canUseGlyphCache):
400         (WebCore::Font::drawSimpleText):
401         (WebCore::Font::drawText):
402         (WebCore::Font::floatWidth):
403         (WebCore::Font::floatWidthForSimpleText):
404         * platform/Font.h:
405         * platform/FontData.h:
406         (WebCore::FontData::platformData):
407         * platform/GlyphBuffer.h: Added.
408         (WebCore::GlyphBuffer::GlyphBuffer):
409         (WebCore::GlyphBuffer::isEmpty):
410         (WebCore::GlyphBuffer::size):
411         (WebCore::GlyphBuffer::glyphs):
412         (WebCore::GlyphBuffer::advances):
413         (WebCore::GlyphBuffer::fontDataAt):
414         (WebCore::GlyphBuffer::swap):
415         (WebCore::GlyphBuffer::glyphAt):
416         (WebCore::GlyphBuffer::advanceAt):
417         (WebCore::GlyphBuffer::add):
418         * platform/mac/FontData.mm:
419         (WebCore::isSpace):
420         (WebCore::isRoundingHackCharacter):
421         (WebCore::FontData::widthForGlyph):
422         (WebCore::m_ATSUMirrors):
423         (WebCore::FontData::xHeight):
424         (WebCore::FontData::smallCapsFontData):
425         (WebCore::findSubstituteFont):
426         (WebCore::rendererForAlternateFont):
427         (WebCore::findSubstituteRenderer):
428         (WebCore::FontData::findSubstituteFontData):
429         (WebCore::computeWidthForSpace):
430         (WebCore::FontData::updateGlyphMapEntry):
431         (WebCore::extendGlyphMap):
432         (WebCore::extendWidthMap):
433         (WebCore::createATSULayoutParameters):
434         (WebCore::FontData::glyphForCharacter):
435         (WebCore::advanceWidthIterator):
436         (WebCore::shouldUseATSU):
437         * platform/mac/FontMac.mm:
438         (WebCore::ATSULayoutParameters::m_padPerSpace):
439         (WebCore::addDirectionalOverride):
440         (WebCore::initializeATSUStyle):
441         (WebCore::overrideLayoutOperation):
442         (WebCore::ATSULayoutParameters::initialize):
443         (WebCore::disposeATSULayoutParameters):
444         (WebCore::Font::drawComplexText):
445         (WebCore::Font::floatWidthForComplexText):
446         (WebCore::Font::drawGlyphs):
447         * platform/mac/WebCoreTextRenderer.mm:
448         (WebCoreSetAlwaysUseATSU):
449
450 2006-05-10  Darin Adler  <darin@apple.com>
451
452         - another try at fixing the Windows build
453
454         * platform/win/FontWin.cpp: (WebCore::getFontData): Use characters()
455         instead of unicode().
456
457 == Rolled over to ChangeLog-2006-05-10 ==