Title: [180390] branches/safari-600.5-branch/Source

Diff

Modified: branches/safari-600.5-branch/Source/WebCore/ChangeLog (180389 => 180390)


--- branches/safari-600.5-branch/Source/WebCore/ChangeLog	2015-02-20 06:45:52 UTC (rev 180389)
+++ branches/safari-600.5-branch/Source/WebCore/ChangeLog	2015-02-20 07:01:39 UTC (rev 180390)
@@ -1,5 +1,24 @@
 2015-02-19  Dana Burkart  <dburk...@apple.com>
 
+        Merged r180076. <rdar://problem/19850750>
+
+    2015-02-13  Brent Fulgham  <bfulg...@apple.com>
+
+            [Mac, iOS] Adjust pagination behavior for Mail.app printing use
+            https://bugs.webkit.org/show_bug.cgi?id=141569
+            <rdar://problem/14912763>
+
+            Reviewed by Anders Carlsson.
+
+            * page/Settings.in: Add new pagination setting flag.
+            * rendering/RenderBlockFlow.cpp:
+            (WebCore::messageContainerName): Added.
+            (WebCore::needsPaginationQuirk): Added.
+            (WebCore::RenderBlockFlow::adjustLinePositionForPagination): Don't move the message content
+            div to a new page when using this special printing mode.
+
+2015-02-19  Dana Burkart  <dburk...@apple.com>
+
         Merged r180063. <rdar://problem/19812938>
 
     2015-02-13  Simon Fraser  <simon.fra...@apple.com>

Modified: branches/safari-600.5-branch/Source/WebCore/page/Settings.in (180389 => 180390)


--- branches/safari-600.5-branch/Source/WebCore/page/Settings.in	2015-02-20 06:45:52 UTC (rev 180389)
+++ branches/safari-600.5-branch/Source/WebCore/page/Settings.in	2015-02-20 07:01:39 UTC (rev 180390)
@@ -230,3 +230,4 @@
 maximumSourceBufferSize type=int, initial=318767104, conditional=MEDIA_SOURCE
 
 serviceControlsEnabled initial=false, conditional=SERVICE_CONTROLS
+appleMailPaginationQuirkEnabled initial=false

Modified: branches/safari-600.5-branch/Source/WebCore/rendering/RenderBlockFlow.cpp (180389 => 180390)


--- branches/safari-600.5-branch/Source/WebCore/rendering/RenderBlockFlow.cpp	2015-02-20 06:45:52 UTC (rev 180389)
+++ branches/safari-600.5-branch/Source/WebCore/rendering/RenderBlockFlow.cpp	2015-02-20 07:01:39 UTC (rev 180390)
@@ -2,7 +2,7 @@
  * Copyright (C) 1999 Lars Knoll (kn...@kde.org)
  *           (C) 1999 Antti Koivisto (koivi...@kde.org)
  *           (C) 2007 David Smith (catfish....@gmail.com)
- * Copyright (C) 2003-2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2003-2015 Apple Inc. All rights reserved.
  * Copyright (C) Research In Motion Limited 2010. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
@@ -43,9 +43,11 @@
 #include "RenderTableCell.h"
 #include "RenderText.h"
 #include "RenderView.h"
+#include "Settings.h"
 #include "SimpleLineLayoutFunctions.h"
 #include "VerticalPositionCache.h"
 #include "VisiblePosition.h"
+#include <wtf/NeverDestroyed.h>
 
 namespace WebCore {
 
@@ -1617,6 +1619,15 @@
     return lineBottom - lineTop;
 }
 
+static inline bool needsAppleMailPaginationQuirk(RootInlineBox& lineBox)
+{
+    bool appleMailPaginationQuirkEnabled = lineBox.renderer().document().settings()->appleMailPaginationQuirkEnabled();
+    if (appleMailPaginationQuirkEnabled && lineBox.renderer().element() && lineBox.renderer().element()->idForStyleResolution() == AtomicString("messageContentContainer", AtomicString::ConstructFromLiteral))
+        return true;
+
+    return false;
+}
+    
 void RenderBlockFlow::adjustLinePositionForPagination(RootInlineBox* lineBox, LayoutUnit& delta, bool& overflowsRegion, RenderFlowThread* flowThread)
 {
     // FIXME: For now we paginate using line overflow. This ensures that lines don't overlap at all when we
@@ -1699,6 +1710,8 @@
             auto firstRootBox = this->firstRootBox();
             auto firstRootBoxOverflowRect = firstRootBox->logicalVisualOverflowRect(firstRootBox->lineTop(), firstRootBox->lineBottom());
             auto firstLineUpperOverhang = std::max(-firstRootBoxOverflowRect.y(), LayoutUnit());
+            if (needsAppleMailPaginationQuirk(*lineBox))
+                return;
             setPaginationStrut(remainingLogicalHeight + logicalOffset + firstLineUpperOverhang);
         } else {
             delta += remainingLogicalHeight;

Modified: branches/safari-600.5-branch/Source/WebKit2/ChangeLog (180389 => 180390)


--- branches/safari-600.5-branch/Source/WebKit2/ChangeLog	2015-02-20 06:45:52 UTC (rev 180389)
+++ branches/safari-600.5-branch/Source/WebKit2/ChangeLog	2015-02-20 07:01:39 UTC (rev 180390)
@@ -1,5 +1,30 @@
 2015-02-19  Dana Burkart  <dburk...@apple.com>
 
+        Merged r180076. <rdar://problem/19850750>
+
+    2015-02-13  Brent Fulgham  <bfulg...@apple.com>
+
+            [Mac, iOS] Adjust pagination behavior for Mail.app printing use
+            https://bugs.webkit.org/show_bug.cgi?id=141569
+            <rdar://problem/14912763>
+
+            Reviewed by Anders Carlsson.
+
+            * Shared/WebPageCreationParameters.cpp:
+            (WebKit::WebPageCreationParameters::encode): Add new flag.
+            (WebKit::WebPageCreationParameters::decode): Ditto.
+            * Shared/WebPageCreationParameters.h: Ditto.
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::creationParameters): Set new page construction flag.
+            * UIProcess/WebPageProxy.h:
+            * UIProcess/mac/WebPageProxyMac.mm:
+            (WebKit::WebPageProxy::paginationQuirkEnabled): Ask for new pagination flag
+            when running as a Mail client.
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::WebPage): Set up pagination based on desired settings.
+
+2015-02-19  Dana Burkart  <dburk...@apple.com>
+
         Merged r180062. <rdar://problem/19812938>
 
     2015-02-12  Simon Fraser  <simon.fra...@apple.com>

Modified: branches/safari-600.5-branch/Source/WebKit2/Shared/WebPageCreationParameters.cpp (180389 => 180390)


--- branches/safari-600.5-branch/Source/WebKit2/Shared/WebPageCreationParameters.cpp	2015-02-20 06:45:52 UTC (rev 180389)
+++ branches/safari-600.5-branch/Source/WebKit2/Shared/WebPageCreationParameters.cpp	2015-02-20 07:01:39 UTC (rev 180390)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2011, 2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -77,6 +77,7 @@
     encoder << availableScreenSize;
     encoder << textAutosizingWidth;
 #endif
+    encoder << appleMailPaginationQuirkEnabled;
 }
 
 bool WebPageCreationParameters::decode(IPC::ArgumentDecoder& decoder, WebPageCreationParameters& parameters)
@@ -165,6 +166,8 @@
         return false;
 #endif
 
+    if (!decoder.decode(parameters.appleMailPaginationQuirkEnabled))
+        return false;
 
     return true;
 }

Modified: branches/safari-600.5-branch/Source/WebKit2/Shared/WebPageCreationParameters.h (180389 => 180390)


--- branches/safari-600.5-branch/Source/WebKit2/Shared/WebPageCreationParameters.h	2015-02-20 06:45:52 UTC (rev 180389)
+++ branches/safari-600.5-branch/Source/WebKit2/Shared/WebPageCreationParameters.h	2015-02-20 07:01:39 UTC (rev 180390)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2011, 2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -120,6 +120,7 @@
     WebCore::FloatSize availableScreenSize;
     float textAutosizingWidth;
 #endif
+    bool appleMailPaginationQuirkEnabled;
 };
 
 } // namespace WebKit

Modified: branches/safari-600.5-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (180389 => 180390)


--- branches/safari-600.5-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2015-02-20 06:45:52 UTC (rev 180389)
+++ branches/safari-600.5-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2015-02-20 07:01:39 UTC (rev 180390)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2011, 2015 Apple Inc. All rights reserved.
  * Copyright (C) 2012 Intel Corporation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -4558,6 +4558,12 @@
     parameters.mimeTypesWithCustomContentProviders = m_pageClient.mimeTypesWithCustomContentProviders();
 #endif
 
+#if PLATFORM(COCOA)
+    parameters.appleMailPaginationQuirkEnabled = appleMailPaginationQuirkEnabled();
+#else
+    parameters.appleMailPaginationQuirkEnabled = false;
+#endif
+
     return parameters;
 }
 

Modified: branches/safari-600.5-branch/Source/WebKit2/UIProcess/WebPageProxy.h (180389 => 180390)


--- branches/safari-600.5-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2015-02-20 06:45:52 UTC (rev 180389)
+++ branches/safari-600.5-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2015-02-20 07:01:39 UTC (rev 180390)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010, 2011, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2011, 2014-2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -1155,6 +1155,8 @@
 
     // Dictionary.
     void didPerformDictionaryLookup(const DictionaryPopupInfo&);
+
+    bool appleMailPaginationQuirkEnabled();
 #endif
 
     // Spelling and grammar.

Modified: branches/safari-600.5-branch/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm (180389 => 180390)


--- branches/safari-600.5-branch/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm	2015-02-20 06:45:52 UTC (rev 180389)
+++ branches/safari-600.5-branch/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm	2015-02-20 07:01:39 UTC (rev 180390)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2011, 2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -663,6 +663,11 @@
     return m_pageClient.boundsOfLayerInLayerBackedWindowCoordinates(layer);
 }
 
+bool WebPageProxy::appleMailPaginationQuirkEnabled()
+{
+    return applicationIsAppleMail();
+}
+    
 } // namespace WebKit
 
 #endif // PLATFORM(MAC)

Modified: branches/safari-600.5-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (180389 => 180390)


--- branches/safari-600.5-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2015-02-20 06:45:52 UTC (rev 180389)
+++ branches/safari-600.5-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2015-02-20 07:01:39 UTC (rev 180390)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2011, 2012, 2013-2015 Apple Inc. All rights reserved.
  * Copyright (C) 2012 Intel Corporation. All rights reserved.
  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
  *
@@ -483,6 +483,7 @@
     if (WebMediaKeyStorageManager* manager = WebProcess::shared().supplement<WebMediaKeyStorageManager>())
         m_page->settings().setMediaKeysStorageDirectory(manager->mediaKeyStorageDirectory());
 #endif
+    m_page->settings().setAppleMailPaginationQuirkEnabled(parameters.appleMailPaginationQuirkEnabled);
 }
 
 void WebPage::reinitializeWebPage(const WebPageCreationParameters& parameters)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to