From 5bfafaf241a4789d4fe143efbbc657faddb0c0f8 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Thu, 5 Jul 2018 11:40:10 +0200 Subject: [PATCH] Removed: dead code and dom clutter from nativehost (#2608) --- AppKit/Platform/CPPlatformWindow.j | 23 ---------------------- AppKit/Platform/DOM/CPPlatformPasteboard.j | 1 - AppKit/Platform/DOM/CPPlatformString.j | 4 ---- AppKit/Platform/DOM/CPPlatformWindow+DOM.j | 19 ------------------ 4 files changed, 47 deletions(-) diff --git a/AppKit/Platform/CPPlatformWindow.j b/AppKit/Platform/CPPlatformWindow.j index 16b1a4954..bf39de81a 100644 --- a/AppKit/Platform/CPPlatformWindow.j +++ b/AppKit/Platform/CPPlatformWindow.j @@ -224,18 +224,10 @@ var PrimaryPlatformWindow = NULL; - (void)deminiaturize:(id)sender { -#if PLATFORM(DOM) - if (_DOMWindow && typeof _DOMWindow["cpDeminiaturize"] === "function") - _DOMWindow.cpDeminiaturize(); -#endif } - (void)miniaturize:(id)sender { -#if PLATFORM(DOM) - if (_DOMWindow && typeof _DOMWindow["cpMiniaturize"] === "function") - _DOMWindow.cpMiniaturize(); -#endif } - (void)moveWindow:(CPWindow)aWindow fromLevel:(int)fromLevel toLevel:(int)toLevel @@ -255,31 +247,16 @@ var PrimaryPlatformWindow = NULL; - (void)setLevel:(CPInteger)aLevel { _level = aLevel; - -#if PLATFORM(DOM) - if (_DOMWindow && _DOMWindow.cpSetLevel) - _DOMWindow.cpSetLevel(aLevel); -#endif } - (void)setHasShadow:(BOOL)shouldHaveShadow { _hasShadow = shouldHaveShadow; - -#if PLATFORM(DOM) - if (_DOMWindow && _DOMWindow.cpSetHasShadow) - _DOMWindow.cpSetHasShadow(shouldHaveShadow); -#endif } - (void)setShadowStyle:(int)aStyle { _shadowStyle = aStyle; - -#if PLATFORM(DOM) - if (_DOMWindow && _DOMWindow.cpSetShadowStyle) - _shadowStyle.cpSetShadowStyle(aStyle); -#endif } - (BOOL)supportsFullPlatformWindows diff --git a/AppKit/Platform/DOM/CPPlatformPasteboard.j b/AppKit/Platform/DOM/CPPlatformPasteboard.j index 8d32fbccb..b1c57cb32 100644 --- a/AppKit/Platform/DOM/CPPlatformPasteboard.j +++ b/AppKit/Platform/DOM/CPPlatformPasteboard.j @@ -118,7 +118,6 @@ var hasEditableTarget = function(aDOMEvent) _DOMPasteboardElement.style.position = "absolute"; _DOMPasteboardElement.style.top = "-10000px"; _DOMPasteboardElement.style.zIndex = "999"; - _DOMPasteboardElement.className = "cpdontremove"; _DOMBodyElement.appendChild(_DOMPasteboardElement); diff --git a/AppKit/Platform/DOM/CPPlatformString.j b/AppKit/Platform/DOM/CPPlatformString.j index fb440d36d..98aca9178 100644 --- a/AppKit/Platform/DOM/CPPlatformString.j +++ b/AppKit/Platform/DOM/CPPlatformString.j @@ -49,7 +49,6 @@ var DOMFixedWidthSpanElement = nil, bodyElement = [CPPlatform mainBodyElement]; DOMFlexibleWidthSpanElement = document.createElement("span"); - DOMFlexibleWidthSpanElement.className = "cpdontremove"; style = DOMFlexibleWidthSpanElement.style; style.position = "absolute"; style.left = "-100000px"; @@ -60,7 +59,6 @@ var DOMFixedWidthSpanElement = nil, style.whiteSpace = "pre"; DOMFixedWidthSpanElement = document.createElement("span"); - DOMFixedWidthSpanElement.className = "cpdontremove"; style = DOMFixedWidthSpanElement.style; style.display = "block"; style.position = "absolute"; @@ -96,7 +94,6 @@ var DOMFixedWidthSpanElement = nil, bodyElement = [CPPlatform mainBodyElement]; DOMMetricsDivElement = document.createElement("div"); - DOMMetricsDivElement.className = "cpdontremove"; style = DOMMetricsDivElement.style; style.position = "absolute"; style.left = "-100000px"; @@ -113,7 +110,6 @@ var DOMFixedWidthSpanElement = nil, var imgPath = [[CPBundle bundleForClass:[CPView class]] pathForResource:@"empty.png"]; DOMMetricsImgElement = document.createElement("img"); - DOMMetricsImgElement.className = "cpdontremove"; DOMMetricsImgElement.setAttribute("src", imgPath); DOMMetricsImgElement.setAttribute("width", "1"); DOMMetricsImgElement.setAttribute("height", "1"); diff --git a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j index d3784af63..c2c97bb26 100644 --- a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j +++ b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j @@ -247,9 +247,6 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio if (!_DOMWindow) return [self contentRect]; - if (_DOMWindow.cpFrame) - return _DOMWindow.cpFrame(); - var contentRect = CGRectMakeZero(); if (window.screenTop) @@ -278,9 +275,6 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio if (!_DOMWindow) return; - if (typeof _DOMWindow["cpSetFrame"] === "function") - return _DOMWindow.cpSetFrame([self contentRect]); - var origin = [self contentRect].origin, nativeOrigin = [self nativeContentRect].origin; @@ -315,7 +309,6 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio _DOMFocusElement.style.zIndex = "-1000"; _DOMFocusElement.style.opacity = "0"; _DOMFocusElement.style.filter = "alpha(opacity=0)"; - _DOMFocusElement.className = "cpdontremove"; _DOMBodyElement.appendChild(_DOMFocusElement); @@ -330,7 +323,6 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio _DOMEventGuard.style.height = "100%"; _DOMEventGuard.style.zIndex = "999"; _DOMEventGuard.style.display = "none"; - _DOMEventGuard.className = "cpdontremove"; _DOMBodyElement.appendChild(_DOMEventGuard); // We get scrolling deltas from this element @@ -344,7 +336,6 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio //_DOMScrollingElement.style.backgroundColor = "rgba(0,0,0,1.0)"; // debug help. _DOMScrollingElement.style.opacity = "0"; _DOMScrollingElement.style.filter = "alpha(opacity=0)"; - _DOMScrollingElement.className = "cpdontremove"; _DOMBodyElement.appendChild(_DOMScrollingElement); var _DOMInnerScrollingElement = theDocument.createElement("div"); @@ -576,22 +567,12 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio [PlatformWindows addObject:self]; - // FIXME: cpSetFrame? _DOMWindow.document.write(''); _DOMWindow.document.close(); if (self != [CPPlatformWindow primaryPlatformWindow]) _DOMWindow.document.title = _title; - if (![CPPlatform isBrowser]) - { - _DOMWindow.cpWindowNumber = [self._only windowNumber]; - _DOMWindow.cpSetFrame(_contentRect); - _DOMWindow.cpSetLevel(_level); - _DOMWindow.cpSetHasShadow(_hasShadow); - _DOMWindow.cpSetShadowStyle(_shadowStyle); - } - [self registerDOMWindow]; _DOMBodyElement.style.cursor = [[CPCursor currentCursor] _cssString];