Removed: dead code and dom clutter from nativehost (#2608)

This commit is contained in:
daboe01
2018-07-05 11:40:10 +02:00
committed by Martin Carlberg
parent 64e1a2ce4b
commit 5bfafaf241
4 changed files with 0 additions and 47 deletions
-23
View File
@@ -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
@@ -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);
-4
View File
@@ -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");
@@ -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('<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></head><body style="background-color:transparent; overflow:hidden"></body></html>');
_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];