[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:14:31 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit d45e194eea4e17167c1eba6c74f42fd5d0cf534b
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 13 02:19:03 2002 +0000
WebKit:
Reviewed by trey. This change was actually made by trey. It
make the "Empty Cache" menu release the page cache.
* AppController.m:
(-[AppController confirmEmptyCache:]):
WebCore:
Fixed 3116584. Made letter-spacing, word-spacing, and text-decoration play
well together.
Reviewed by hyatt.
Changes made with trey to enable to release of page cache from the
"Empty Cache" menu item in Alex.
Reviewed by trey.
* khtml/rendering/font.cpp:
(Font::drawLineForText):
(Font::drawText):
* khtml/rendering/font.h:
* khtml/rendering/render_text.cpp:
(TextSlave::paintDecoration):
(RenderText::paintObject):
* khtml/rendering/render_text.h:
* kwq/KWQPainter.h:
* kwq/KWQPainter.mm:
(QPainter::drawLineForText):
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge dealloc]):
(-[WebCoreBridge openURL:reload:headers:lastModified:pageCache:]):
(-[KWQPageState invalidate]):
(-[KWQPageState dealloc]):
* kwq/WebCoreTextRenderer.h:
WebKit:
Changes to fix 3116584.
Reviewed by hyatt.
Changes to support emptying the page cache from the
"Empty Cache" menu.
Reviewed by trey.
* ChangeLog:
* History.subproj/WebBackForwardList.h:
* History.subproj/WebBackForwardList.m:
(-[WebBackForwardList clearPageCache]):
* History.subproj/WebHistoryItem.m:
(+[WebHistoryItem _scheduleReleaseTimer]):
(-[WebHistoryItem _scheduleRelease]):
(+[WebHistoryItem _releasePageCache:]):
(-[WebHistoryItem setHasPageCache:]):
* WebCoreSupport.subproj/WebTextRenderer.m:
* WebView.subproj/WebFramePrivate.m:
(-[WebFrame _opened]):
Tests:
* html/letterspacing.html:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index dea4696..11e50c7 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,32 @@
+2002-12-12 Richard Williamson <rjw at apple.com>
+
+ Fixed 3116584. Made letter-spacing, word-spacing, and text-decoration play
+ well together.
+ Reviewed by hyatt.
+
+ Changes made with trey to enable to release of page cache from the
+ "Empty Cache" menu item in Alex.
+ Reviewed by trey.
+
+ * khtml/rendering/font.cpp:
+ (Font::drawLineForText):
+ (Font::drawText):
+ * khtml/rendering/font.h:
+ * khtml/rendering/render_text.cpp:
+ (TextSlave::paintDecoration):
+ (RenderText::paintObject):
+ * khtml/rendering/render_text.h:
+ * kwq/KWQPainter.h:
+ * kwq/KWQPainter.mm:
+ (QPainter::drawLineForText):
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge dealloc]):
+ (-[WebCoreBridge openURL:reload:headers:lastModified:pageCache:]):
+ (-[KWQPageState invalidate]):
+ (-[KWQPageState dealloc]):
+ * kwq/WebCoreTextRenderer.h:
+
2002-12-12 Ken Kocienda <kocienda at apple.com>
Reviewed by Maciej and Darin
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index dea4696..11e50c7 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,32 @@
+2002-12-12 Richard Williamson <rjw at apple.com>
+
+ Fixed 3116584. Made letter-spacing, word-spacing, and text-decoration play
+ well together.
+ Reviewed by hyatt.
+
+ Changes made with trey to enable to release of page cache from the
+ "Empty Cache" menu item in Alex.
+ Reviewed by trey.
+
+ * khtml/rendering/font.cpp:
+ (Font::drawLineForText):
+ (Font::drawText):
+ * khtml/rendering/font.h:
+ * khtml/rendering/render_text.cpp:
+ (TextSlave::paintDecoration):
+ (RenderText::paintObject):
+ * khtml/rendering/render_text.h:
+ * kwq/KWQPainter.h:
+ * kwq/KWQPainter.mm:
+ (QPainter::drawLineForText):
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge dealloc]):
+ (-[WebCoreBridge openURL:reload:headers:lastModified:pageCache:]):
+ (-[KWQPageState invalidate]):
+ (-[KWQPageState dealloc]):
+ * kwq/WebCoreTextRenderer.h:
+
2002-12-12 Ken Kocienda <kocienda at apple.com>
Reviewed by Maciej and Darin
diff --git a/WebCore/khtml/rendering/font.cpp b/WebCore/khtml/rendering/font.cpp
index 62f6e1f..20c781d 100644
--- a/WebCore/khtml/rendering/font.cpp
+++ b/WebCore/khtml/rendering/font.cpp
@@ -37,8 +37,16 @@
using namespace khtml;
+#ifdef APPLE_CHANGES
+void Font::drawLineForText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int len,
+ int toAdd, int yOffset, QPainter::TextDirection d) const
+{
+ p->drawLineForText(x, y, str + pos, std::min(slen - pos, len), toAdd, yOffset, d, letterSpacing, wordSpacing);
+}
+#endif
+
void Font::drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int len,
- int toAdd, QPainter::TextDirection d, int from, int to, QColor bg ) const
+ int toAdd, QPainter::TextDirection d, int from, int to, QColor bg ) const
{
#if APPLE_CHANGES
p->drawText(x, y, str + pos, std::min(slen - pos, len), from, to, toAdd, bg, d, letterSpacing, wordSpacing);
diff --git a/WebCore/khtml/rendering/font.h b/WebCore/khtml/rendering/font.h
index e4ac506..59bae0e 100644
--- a/WebCore/khtml/rendering/font.h
+++ b/WebCore/khtml/rendering/font.h
@@ -87,10 +87,13 @@ public:
void update( QPaintDeviceMetrics *devMetrics ) const;
+
void drawText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int len, int width,
QPainter::TextDirection d, int from=-1, int to=-1, QColor bg=QColor() ) const;
#if APPLE_CHANGES
+ void drawLineForText( QPainter *p, int x, int y, QChar *str, int slen, int pos, int len, int toAdd, int yOffset,
+ QPainter::TextDirection d) const;
float floatWidth( QChar *str, int slen, int pos, int len ) const;
void floatCharacterWidths( QChar *str, int slen, int pos, int len, int toAdd, float *buffer) const;
#endif
diff --git a/WebCore/khtml/rendering/render_text.cpp b/WebCore/khtml/rendering/render_text.cpp
index fd78dba..2adbd24 100644
--- a/WebCore/khtml/rendering/render_text.cpp
+++ b/WebCore/khtml/rendering/render_text.cpp
@@ -84,7 +84,7 @@ void TextSlave::paintSelection(const Font *f, RenderText *text, QPainter *p, Ren
p->restore();
}
-void TextSlave::paintDecoration( QPainter *pt, RenderText* p, int _tx, int _ty, int deco, bool begin, bool end)
+void TextSlave::paintDecoration( QPainter *pt, const Font *f, RenderText* p, int _tx, int _ty, int deco, bool begin, bool end)
{
_tx += m_x;
_ty += m_y;
@@ -99,8 +99,16 @@ void TextSlave::paintDecoration( QPainter *pt, RenderText* p, int _tx, int _ty,
#if APPLE_CHANGES
// Use a special function for underlines to get the positioning exactly right.
- if(deco & UNDERLINE)
- pt->drawUnderlineForText(_tx, _ty + m_baseline, p->str->s + m_start, m_len);
+ if(deco & UNDERLINE){
+ f->drawLineForText(pt, _tx, _ty, p->str->s, p->str->l, m_start, m_len,
+ m_toAdd, m_baseline, m_reversed ? QPainter::RTL : QPainter::LTR);
+ }
+ if(deco & OVERLINE)
+ f->drawLineForText(pt, _tx, _ty, p->str->s, p->str->l, m_start, m_len,
+ m_toAdd, 0, m_reversed ? QPainter::RTL : QPainter::LTR);
+ if(deco & LINE_THROUGH)
+ f->drawLineForText(pt, _tx, _ty, p->str->s, p->str->l, m_start, m_len,
+ m_toAdd, 2*m_baseline/3, m_reversed ? QPainter::RTL : QPainter::LTR);
#else
int underlineOffset = ( pt->fontMetrics().height() + m_baseline ) / 2;
if(underlineOffset <= m_baseline) underlineOffset = m_baseline+1;
@@ -108,11 +116,11 @@ void TextSlave::paintDecoration( QPainter *pt, RenderText* p, int _tx, int _ty,
if(deco & UNDERLINE){
pt->drawLine(_tx, _ty + underlineOffset, _tx + width, _ty + underlineOffset );
}
-#endif
if(deco & OVERLINE)
pt->drawLine(_tx, _ty, _tx + width, _ty );
if(deco & LINE_THROUGH)
pt->drawLine(_tx, _ty + 2*m_baseline/3, _tx + width, _ty + 2*m_baseline/3 );
+#endif
// NO! Do NOT add BLINK! It is the most annouing feature of Netscape, and IE has a reason not to
// support it. Lars
}
@@ -651,7 +659,7 @@ void RenderText::paintObject(QPainter *p, int /*x*/, int y, int /*w*/, int h,
if(d != TDNONE)
{
p->setPen(_style->textDecorationColor());
- s->paintDecoration(p, this, tx, ty, d, si == 0, si == ( int ) m_lines.count()-1);
+ s->paintDecoration(p, font, this, tx, ty, d, si == 0, si == ( int ) m_lines.count()-1);
}
#if APPLE_CHANGES
diff --git a/WebCore/khtml/rendering/render_text.h b/WebCore/khtml/rendering/render_text.h
index 70d34f6..b2c4076 100644
--- a/WebCore/khtml/rendering/render_text.h
+++ b/WebCore/khtml/rendering/render_text.h
@@ -72,7 +72,11 @@ private:
public:
+#ifdef APPLE_CHANGES
+ void paintDecoration( QPainter *pt, const Font *, RenderText* p, int _tx, int _ty, int decoration, bool begin, bool end);
+#else
void paintDecoration( QPainter *pt, RenderText* p, int _tx, int _ty, int decoration, bool begin, bool end);
+#endif
void paintBoxDecorations(QPainter *p, RenderStyle* style, RenderText *parent, int _tx, int _ty, bool begin, bool end);
void paintSelection(const Font *f, RenderText *text, QPainter *p, RenderStyle* style, int tx, int ty, int startPos, int endPos);
diff --git a/WebCore/kwq/KWQPainter.h b/WebCore/kwq/KWQPainter.h
index 787c365..a871725 100644
--- a/WebCore/kwq/KWQPainter.h
+++ b/WebCore/kwq/KWQPainter.h
@@ -92,7 +92,7 @@ public:
void drawText(int x, int y, int, int, int alignmentFlags, const QString &);
void drawText(int x, int y, const QChar *, int length, int from, int to, int toAdd, const QColor& backgroundColor, QPainter::TextDirection d, int letterSpacing, int wordSpacing);
- void drawUnderlineForText(int x, int y, const QChar *, int length);
+ void drawLineForText(int x, int y, const QChar *, int length, int toAdd, int yOffset, QPainter::TextDirection d, int letterSpacing, int wordSpacing);
static QColor selectedTextBackgroundColor();
bool paintingDisabled() const;
diff --git a/WebCore/kwq/KWQPainter.mm b/WebCore/kwq/KWQPainter.mm
index 6a21665..2fc0db4 100644
--- a/WebCore/kwq/KWQPainter.mm
+++ b/WebCore/kwq/KWQPainter.mm
@@ -417,7 +417,7 @@ void QPainter::drawText(int x, int y, const QChar *str, int len, int from, int t
fontFamilies: families];
}
-void QPainter::drawUnderlineForText(int x, int y, const QChar *str, int len)
+void QPainter::drawLineForText(int x, int y, const QChar *str, int length, int toAdd, int yOffset, QPainter::TextDirection d, int letterSpacing, int wordSpacing)
{
if (data->state.paintingDisabled)
return;
@@ -426,8 +426,18 @@ void QPainter::drawUnderlineForText(int x, int y, const QChar *str, int len)
_updateRenderer(families);
- [data->lastTextRenderer drawUnderlineForCharacters:(const UniChar *)str stringLength:len
- atPoint:NSMakePoint(x,y) withColor:data->state.pen.color().getNSColor()];
+ [data->lastTextRenderer
+ drawLineForCharacters:(const UniChar *)str stringLength:length
+ fromCharacterPosition:0
+ toCharacterPosition:length
+ atPoint:NSMakePoint(x, y)
+ yOffset:(float)yOffset
+ withPadding: toAdd
+ withColor:data->state.pen.color().getNSColor()
+ rightToLeft: d == RTL ? true : false
+ letterSpacing: letterSpacing
+ wordSpacing: wordSpacing
+ fontFamilies: families];
}
QColor QPainter::selectedTextBackgroundColor()
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 494b248..3b15f10 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -85,7 +85,6 @@ enum FrameBorderStyle {
{
KWQKHTMLPart *_part;
KHTMLRenderPart *_renderPart;
- id _currentPageCache;
}
- (void)setRenderPart:(KHTMLRenderPart *)renderPart;
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 2395aac..06689f0 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -94,6 +94,7 @@ NSString *WebCoreElementStringKey = @"WebElementString";
- (SavedProperties *)windowProperties;
- (SavedProperties *)locationProperties;
- (RenderObject *)renderer;
+- (void)invalidate;
@end
@implementation WebCoreBridge
@@ -117,9 +118,7 @@ NSString *WebCoreElementStringKey = @"WebElementString";
}
_part->setBridge(nil);
_part->deref();
-
- [_currentPageCache release];
-
+
[super dealloc];
}
@@ -151,14 +150,10 @@ NSString *WebCoreElementStringKey = @"WebElementString";
{
if (pageCache) {
KWQPageState *state = [pageCache objectForKey:@"WebCorePageState"];
- _currentPageCache = [pageCache retain];
_part->openURLFromPageCache([state document], [state renderer], [state URL], [state windowProperties], [state locationProperties]);
+ [state invalidate];
return;
}
- else if (_currentPageCache){
- [_currentPageCache release];
- _currentPageCache = 0;
- }
// arguments
@@ -848,24 +843,55 @@ static NSAttributedString *attributedString(NodeImpl *_startNode, int startOffse
return self;
}
-- (void)dealloc
+// Called when the KWQPageState is restored. It should relinquish ownership
+// of objects to core.
+- (void)invalidate
{
- KHTMLView *view = document->view();
-
- KWQ(view->part())->clearTimers();
-
+ // Should only ever invalidate once.
+ ASSERT (document);
+
document->setInPageCache(NO);
- document->detach();
document->deref();
document = 0;
-
- view->clearPart();
- delete view;
-
+
delete URL;
URL = 0;
+
delete windowProperties;
+ windowProperties = 0;
delete locationProperties;
+ locationProperties = 0;
+}
+
+- (void)dealloc
+{
+ if (document){
+ KHTMLView *view = document->view();
+ KWQ(view->part())->clearTimers();
+ document->setInPageCache(NO);
+ document->detach();
+ document->deref();
+ document = 0;
+
+ view->clearPart();
+ delete view;
+ }
+
+ if (URL){
+ delete URL;
+ URL = 0;
+ }
+
+ if (windowProperties){
+ delete windowProperties;
+ windowProperties = 0;
+ }
+
+ if (locationProperties){
+ delete locationProperties;
+ locationProperties = 0;
+ }
+
[super dealloc];
}
diff --git a/WebCore/kwq/WebCoreTextRenderer.h b/WebCore/kwq/WebCoreTextRenderer.h
index f42e277..935b4ad 100644
--- a/WebCore/kwq/WebCoreTextRenderer.h
+++ b/WebCore/kwq/WebCoreTextRenderer.h
@@ -42,6 +42,6 @@
// drawing
- (void)drawCharacters:(const UniChar *)characters stringLength:(unsigned)length fromCharacterPosition:(int)from toCharacterPosition:(int)to atPoint:(NSPoint)point withPadding: (int)padding withTextColor:(NSColor *)textColor backgroundColor:(NSColor *)backgroundColor rightToLeft: (BOOL)rtl letterSpacing: (int)letterSpacing wordSpacing: (int)wordSpacing fontFamilies: (NSString **)families;
-- (void)drawUnderlineForCharacters:(const UniChar *)characters stringLength:(unsigned)length atPoint:(NSPoint)point withColor:(NSColor *)color;
+- (void)drawLineForCharacters:(const UniChar *)characters stringLength:(unsigned)length fromCharacterPosition:(int)from toCharacterPosition:(int)to atPoint:(NSPoint)point yOffset:(float)yOffset withPadding: (int)padding withColor:(NSColor *)color rightToLeft: (BOOL)rtl letterSpacing: (int)letterSpacing wordSpacing: (int)wordSpacing fontFamilies: (NSString **)families;
@end
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index ebfdbf7..de44d5a 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,35 @@
+2002-12-12 Richard Williamson <rjw at apple.com>
+
+ Changes to fix 3116584.
+ Reviewed by hyatt.
+
+ Changes to support emptying the page cache from the
+ "Empty Cache" menu.
+ Reviewed by trey.
+
+ * ChangeLog:
+ * History.subproj/WebBackForwardList.h:
+ * History.subproj/WebBackForwardList.m:
+ (-[WebBackForwardList clearPageCache]):
+ * History.subproj/WebHistoryItem.m:
+ (+[WebHistoryItem _scheduleReleaseTimer]):
+ (-[WebHistoryItem _scheduleRelease]):
+ (+[WebHistoryItem _releasePageCache:]):
+ (-[WebHistoryItem setHasPageCache:]):
+ * WebCoreSupport.subproj/WebTextRenderer.m:
+ * WebView.subproj/WebFramePrivate.m:
+ (-[WebFrame _opened]):
+
+2002-12-12 Richard Williamson <rjw at apple.com>
+
+ Fixed 3119693. Restore scroll position when going back
+ to item in b/f cache.
+
+ Reviewed by trey.
+
+ * WebView.subproj/WebFramePrivate.m:
+ (-[WebFrame _opened]):
+
=== Alexander-36 ===
2002-12-12 Richard Williamson <rjw at apple.com>
diff --git a/WebKit/History.subproj/WebBackForwardList.h b/WebKit/History.subproj/WebBackForwardList.h
index c4cc6d3..7041cfc 100644
--- a/WebKit/History.subproj/WebBackForwardList.h
+++ b/WebKit/History.subproj/WebBackForwardList.h
@@ -50,6 +50,12 @@
+ (unsigned)pageCacheSize;
/*!
+ @method clearPageCache
+ @discussion Clears all items in the page cache.
+*/
+- (void)clearPageCache;
+
+/*!
@method addEntry:
@abstract Adds an entry to the list.
@discussion Add an entry to the back-forward list, immediately after the current entry.
diff --git a/WebKit/History.subproj/WebBackForwardList.m b/WebKit/History.subproj/WebBackForwardList.m
index 91d889f..97880b8 100644
--- a/WebKit/History.subproj/WebBackForwardList.m
+++ b/WebKit/History.subproj/WebBackForwardList.m
@@ -185,6 +185,14 @@
return result;
}
+- (void)clearPageCache
+{
+ int i;
+ for (i = 0; i < (int)[_entries count]; i++) {
+ [[_entries objectAtIndex:i] setHasPageCache:NO];
+ }
+}
+
static BOOL pageCacheSizeModified = NO;
static unsigned pageCacheSize = 4;
diff --git a/WebKit/History.subproj/WebHistoryItem.m b/WebKit/History.subproj/WebHistoryItem.m
index 3d3c378..f916956 100644
--- a/WebKit/History.subproj/WebHistoryItem.m
+++ b/WebKit/History.subproj/WebHistoryItem.m
@@ -486,21 +486,25 @@ static NSTimer *_pageCacheReleaseTimer = nil;
}
}
-- (void)_scheduleRelease
++ (void)_scheduleReleaseTimer
{
- LOG (PageCache, "Scheduling release of %@", [self URLString]);
if (!_pageCacheReleaseTimer){
_pageCacheReleaseTimer = [[NSTimer scheduledTimerWithTimeInterval: 2.5 target:self selector:@selector(_releasePageCache:) userInfo:nil repeats:NO] retain];
if (_pendingPageCacheToRelease == nil){
_pendingPageCacheToRelease = [[NSMutableSet alloc] init];
}
}
-
- // Only add the pageCache on first scheduled attempt.
+}
+
+- (void)_scheduleRelease
+{
+ LOG (PageCache, "Scheduling release of %@", [self URLString]);
+ [WebHistoryItem _scheduleReleaseTimer];
+
if (pageCache){
[_pendingPageCacheToRelease addObject: pageCache];
[pageCache release]; // Last reference held by _pendingPageCacheToRelease.
- pageCache = 0;
+ pageCache = nil;
}
if (!_windowWatcher){
@@ -517,7 +521,7 @@ static NSTimer *_pageCacheReleaseTimer = nil;
[_pendingPageCacheToRelease removeAllObjects];
}
-- (void)_releasePageCache: (NSTimer *)timer
++ (void)_releasePageCache: (NSTimer *)timer
{
CGSRealTimeDelta userDelta;
CFAbsoluteTime loadDelta;
@@ -530,15 +534,13 @@ static NSTimer *_pageCacheReleaseTimer = nil;
if ((userDelta < 0.5 || loadDelta < 1.25) && [_pendingPageCacheToRelease count] < 42){
LOG (PageCache, "postponing again because not quiescent for more than a second (%f since last input, %f since last load).", userDelta, loadDelta);
- [self _scheduleRelease];
+ [self _scheduleReleaseTimer];
return;
}
else
LOG (PageCache, "releasing, quiescent for more than a second (%f since last input, %f since last load).", userDelta, loadDelta);
[WebHistoryItem _releaseAllPendingPageCaches];
-
- LOG (PageCache, "Done releasing %p %@", self, [self URLString]);
}
- (void)setHasPageCache: (BOOL)f
@@ -547,7 +549,6 @@ static NSTimer *_pageCacheReleaseTimer = nil;
pageCache = [[NSMutableDictionary alloc] init];
if (!f && pageCache){
[self _scheduleRelease];
- pageCache = 0;
}
}
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
index 13aa8cc..8a08ab1 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
@@ -707,13 +707,29 @@ static void _drawGlyphs(NSFont *font, NSColor *color, CGGlyph *glyphs, CGSize *a
}
-- (void)drawUnderlineForCharacters:(const UniChar *)characters stringLength:(unsigned)length atPoint:(NSPoint)point withColor:(NSColor *)color
+- (void)drawLineForCharacters:(const UniChar *)characters stringLength:(unsigned)length fromCharacterPosition:(int)from toCharacterPosition:(int)to atPoint:(NSPoint)point yOffset:(float)yOffset withPadding: (int)padding withColor:(NSColor *)color rightToLeft: (BOOL)rtl letterSpacing: (int)letterSpacing wordSpacing: (int)wordSpacing fontFamilies: (NSString **)families;
{
NSGraphicsContext *graphicsContext = [NSGraphicsContext currentContext];
- int width = [self widthForCharacters:characters length:length];
+ int width;
CGContextRef cgContext;
float lineWidth;
+
+ width = ROUND_TO_INT([self _floatWidthForCharacters:characters
+ stringLength:length
+ fromCharacterPosition: 0
+ numberOfCharacters: length
+ withPadding: padding
+ applyRounding: YES
+ attemptFontSubstitution: YES
+ widths: 0
+ fonts: 0
+ glyphs: 0
+ numGlyphs: 0
+ letterSpacing: letterSpacing
+ wordSpacing: wordSpacing
+ fontFamilies: families]);
+
// This will draw the text from the top of the bounding box down.
// Qt expects to draw from the baseline.
// Remember that descender is negative.
@@ -732,8 +748,8 @@ static void _drawGlyphs(NSFont *font, NSColor *color, CGGlyph *glyphs, CGSize *a
lineWidth = size.width;
}
CGContextSetLineWidth(cgContext, lineWidth);
- CGContextMoveToPoint(cgContext, point.x, point.y + [font defaultLineHeightForFont] + 1.5 - [self descent]);
- CGContextAddLineToPoint(cgContext, point.x + width, point.y + [font defaultLineHeightForFont] + 1.5 - [self descent]);
+ CGContextMoveToPoint(cgContext, point.x, point.y + [font defaultLineHeightForFont] + 1.5 - [self descent] + yOffset);
+ CGContextAddLineToPoint(cgContext, point.x + width, point.y + [font defaultLineHeightForFont] + 1.5 - [self descent] + yOffset);
CGContextStrokePath(cgContext);
[graphicsContext setShouldAntialias: flag];
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 6d4d472..351fe69 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -738,6 +738,13 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
[_private->bridge reapplyStyles];
[[[self webView] documentView] setNeedsLayout: YES];
[[[self webView] documentView] layout];
+ [self _restoreScrollPosition];
+
+ // Release the resources kept in the page cache. They will be
+ // reset when we leave this page. The core side of the page cache
+ // will have already been invalidated by the bridge to prevent
+ // premature release.
+ [[_private currentItem] setHasPageCache: NO];
}
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list