Source/WebCore/ChangeLog

 12012-07-16 Beth Dakin <bdakin@apple.com>
 2
 3 https://bugs.webkit.org/show_bug.cgi?id=91299
 4 Paginated views should restrict available height to column height
 5 -and corresponding-
 6 <rdar://problem/11152108>
 7
 8 Reviewed by NOBODY (OOPS!).
 9
 10 Now that RenderViews can have columns, availableLogicalHeight needs to consider
 11 that column height, much like how availableLogicalWidth already considers column
 12 width.
 13
 14 availableLogicalHeight is newly virtual, like the already-virtual
 15 availableLogicalWidth.
 16 * rendering/RenderBox.h:
 17 (RenderBox):
 18
 19 Check with the columnHeight.
 20 * rendering/RenderView.cpp:
 21 (WebCore):
 22 (WebCore::RenderView::availableLogicalHeight):
 23 * rendering/RenderView.h:
 24
 25 setPagination now takes pageLength as an optional parameter.
 26 * testing/InternalSettings.cpp:
 27 (WebCore::InternalSettings::setPagination):
 28 * testing/InternalSettings.h:
 29 (WebCore::InternalSettings::setPagination):
 30 (InternalSettings):
 31 * testing/InternalSettings.idl:
 32 * testing/Internals.cpp:
 33 (WebCore::Internals::setPagination):
 34 * testing/Internals.h:
 35 (WebCore::Internals::setPagination):
 36 (Internals):
 37 * testing/Internals.idl:
 38
1392012-07-16 Dana Jansens <danakj@chromium.org>
240
341 [chromium] Remove targetRenderSurface concept, give layers a renderTarget which is the layer whose coordinate space they draw into
122757

Source/WebCore/rendering/RenderBox.h

@@public:
353353
354354 LayoutUnit computePercentageLogicalHeight(const Length& height);
355355
356  // Block flows subclass availableWidth to handle multi column layout (shrinking the width available to children when laying out.)
 356 // Block flows subclass availableWidth/Height to handle multi column layout (shrinking the width/height available to children when laying out.)
357357 virtual LayoutUnit availableLogicalWidth() const { return contentLogicalWidth(); }
358  LayoutUnit availableLogicalHeight() const;
 358 virtual LayoutUnit availableLogicalHeight() const;
359359 LayoutUnit availableLogicalHeightUsing(const Length&) const;
360360
361361 // There are a few cases where we need to refer specifically to the available physical width and available physical height.
122757

Source/WebCore/rendering/RenderView.cpp

@@void RenderView::computePreferredLogical
108108 RenderBlock::computePreferredLogicalWidths();
109109}
110110
 111
 112LayoutUnit RenderView::availableLogicalHeight() const
 113{
 114 // If we have columns, then the available logical height is reduced to the column height.
 115 if (hasColumns())
 116 return columnInfo()->columnHeight();
 117 return RenderBlock::availableLogicalHeight();
 118}
 119
111120bool RenderView::isChildAllowed(RenderObject* child, RenderStyle*) const
112121{
113122 return child->isBox();
122757

Source/WebCore/rendering/RenderView.h

@@public:
6363 // it only exists to make computePreferredLogicalWidths public.
6464 virtual void computePreferredLogicalWidths() OVERRIDE;
6565
 66 virtual LayoutUnit availableLogicalHeight() const OVERRIDE;
 67
6668 // The same as the FrameView's layoutHeight/layoutWidth but with null check guards.
6769 int viewHeight() const;
6870 int viewWidth() const;
122757

Source/WebCore/testing/InternalSettings.cpp

@@bool InternalSettings::shouldDisplayTrac
520520#endif
521521}
522522
523 void InternalSettings::setPagination(const String& mode, int gap, ExceptionCode& ec)
 523void InternalSettings::setPagination(const String& mode, int gap, int pageLength, ExceptionCode& ec)
524524{
525525 if (!page()) {
526526 ec = INVALID_ACCESS_ERR;

@@void InternalSettings::setPagination(con
544544 }
545545
546546 pagination.gap = gap;
 547 pagination.pageLength = pageLength;
547548 page()->setPagination(pagination);
548549}
549550
122757

Source/WebCore/testing/InternalSettings.h

@@public:
124124 void setJavaScriptProfilingEnabled(bool enabled, ExceptionCode&);
125125 Vector<String> userPreferredLanguages() const;
126126 void setUserPreferredLanguages(const Vector<String>&);
127  void setPagination(const String& mode, int gap, ExceptionCode&);
 127 void setPagination(const String& mode, int gap, ExceptionCode& ec) { setPagination(mode, gap, 0, ec); }
 128 void setPagination(const String& mode, int gap, int pageLength, ExceptionCode&);
128129 void allowRoundingHacks() const;
129130 void setShouldDisplayTrackKind(const String& kind, bool enabled, ExceptionCode&);
130131 bool shouldDisplayTrackKind(const String& kind, ExceptionCode&);
122757

Source/WebCore/testing/InternalSettings.idl

@@module window {
6666 void setWindowFocusRestricted(in boolean restricted) raises(DOMException);
6767 void setDialogElementEnabled(in boolean enabled) raises(DOMException);
6868
69  void setPagination(in DOMString mode, in long gap) raises(DOMException);
 69 void setPagination(in DOMString mode, in long gap, in [Optional] long pageLength) raises(DOMException);
7070 sequence<String> userPreferredLanguages();
7171 void setUserPreferredLanguages(in sequence<String> languages);
7272 void allowRoundingHacks();
122757

Source/WebCore/testing/Internals.cpp

@@void Internals::setScrollViewPosition(Do
628628 frameView->setConstrainsScrollingToContentEdge(constrainsScrollingToContentEdgeOldValue);
629629}
630630
631 void Internals::setPagination(Document*, const String& mode, int gap, ExceptionCode& ec)
 631void Internals::setPagination(Document*, const String& mode, int gap, int pageLength, ExceptionCode& ec)
632632{
633  settings()->setPagination(mode, gap, ec);
 633 settings()->setPagination(mode, gap, pageLength, ec);
634634}
635635
636636String Internals::configurationForViewport(Document*, float devicePixelRatio, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight, ExceptionCode& ec)
122757

Source/WebCore/testing/Internals.h

@@public:
115115 String markerDescriptionForNode(Node*, const String& markerType, unsigned index, ExceptionCode&);
116116
117117 void setScrollViewPosition(Document*, long x, long y, ExceptionCode&);
118  void setPagination(Document*, const String& mode, int gap, ExceptionCode&);
 118 void setPagination(Document* document, const String& mode, int gap, ExceptionCode& ec) { setPagination(document, mode, gap, 0, ec); }
 119 void setPagination(Document*, const String& mode, int gap, int pageLength, ExceptionCode&);
119120 String configurationForViewport(Document*, float devicePixelRatio, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight, ExceptionCode&);
120121
121122 bool wasLastChangeUserEdit(Element* textField, ExceptionCode&);
122757

Source/WebCore/testing/Internals.idl

@@module window {
8686
8787 void setScrollViewPosition(in Document document, in long x, in long y) raises(DOMException);
8888
89  void setPagination(in Document document, in DOMString mode, in long gap) raises(DOMException);
 89 void setPagination(in Document document, in DOMString mode, in long gap, in [Optional] long pageLength) raises(DOMException);
9090
9191 DOMString configurationForViewport(in Document document,
9292 in float devicePixelRatio,
122757

LayoutTests/ChangeLog

 12012-07-16 Beth Dakin <bdakin@apple.com>
 2
 3 https://bugs.webkit.org/show_bug.cgi?id=91299
 4 Paginated views should restrict available height to column height
 5 -and corresponding-
 6 <rdar://problem/11152108>
 7
 8 Reviewed by NOBODY (OOPS!).
 9
 10 New test.
 11 * fast/multicol/resources/big-green.png: Added.
 12 * fast/multicol/shrink-to-column-height-for-pagination.html: Added.
 13 * platform/mac/fast/multicol/shrink-to-column-height-for-pagination-expected.png: Added.
 14 * platform/mac/fast/multicol/shrink-to-column-height-for-pagination-expected.txt: Added.
 15
1162012-07-16 Florin Malita <fmalita@chromium.org>
217
318 SVGAnimationElement::currentValuesForValuesAnimation crash
122757

LayoutTests/fast/multicol/shrink-to-column-height-for-pagination.html

 1<html style="-webkit-writing-mode: vertical-rl;">
 2<head>
 3 <script>
 4 if (window.internals)
 5 internals.setPagination(document, "RightToLeftPaginated", 0, 400);
 6 </script>
 7</head>
 8<body style="width:100%; height:100%;">
 9 <div style="width:100%; height:100%;">
 10 <img src="resources/big-green.png" style="width:100%; height:100%; max-width:100%; max-height:100%;"/>
 11 </div>
 12</body>
 13</html>
0

LayoutTests/platform/mac/fast/multicol/shrink-to-column-height-for-pagination-expected.txt

 1layer at (0,0) size 800x600
 2 RenderView at (0,0) size 400x600
 3layer at (-400,0) size 800x600 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 outlineClip at (0,0) size 800x600
 4 RenderBlock {HTML} at (0,0) size 800x600
 5 RenderBody {BODY} at (8,8) size 400x600
 6 RenderBlock {DIV} at (0,0) size 400x600
 7 RenderImage {IMG} at (392,0) size 400x600
 8 RenderText {#text} at (0,0) size 0x0
 9scrolled to -385,0
0

LayoutTests/fast/multicol/resources/big-green.png

LayoutTests/platform/mac/fast/multicol/shrink-to-column-height-for-pagination-expected.png

87a3b37d05d9dcf0180d6763bcebc146