Bug 115969 - Value of FrameLoadTypeSame is suspicious
Summary: Value of FrameLoadTypeSame is suspicious
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-11 14:50 PDT by Simon Fraser (smfr)
Modified: 2013-05-13 10:57 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2013-05-11 14:50:00 PDT
This seems wrong:

    enum FrameLoadType {
        FrameLoadTypeStandard,
        FrameLoadTypeBack,
        FrameLoadTypeForward,
        FrameLoadTypeIndexedBackForward, // a multi-item hop in the backforward list
        FrameLoadTypeReload,
        // Skipped value: 'FrameLoadTypeReloadAllowingStaleData', still present in mac/win public API. Ready to be reused
        FrameLoadTypeSame = FrameLoadTypeReload + 2, // user loads same URL again (but not reload button)
        FrameLoadTypeRedirectWithLockedBackForwardList, // FIXME: Merge "lockBackForwardList", "lockHistory", "quickRedirect" and "clientRedirect" into a single concept of redirect.
        FrameLoadTypeReplace,
        FrameLoadTypeReloadFromOrigin,
    };


        FrameLoadTypeSame = FrameLoadTypeReload + 2, // user loads same URL again (but not reload button)
so FrameLoadTypeSame == FrameLoadTypeRedirectWithLockedBackForwardList ?

And isn't FrameLoadTypeSame supposed to match WebFrameLoadTypeSame in WebKit?
Comment 1 Simon Fraser (smfr) 2013-05-11 14:51:42 PDT
Or is FrameLoadTypeSame supposed to match FrameLoadTypeReplace? If so, that's a very fragile way to do it.
Comment 2 Alexey Proskuryakov 2013-05-12 21:34:04 PDT
Per this definition, FrameLoadTypeReplace is FrameLoadTypeReload + 4.

In other words,

    enum FrameLoadType {
        FrameLoadTypeStandard, // 0
        FrameLoadTypeBack, // 1
        FrameLoadTypeForward, // 2
        FrameLoadTypeIndexedBackForward, // 3
        FrameLoadTypeReload, // 4
        // Skipped value: 'FrameLoadTypeReloadAllowingStaleData', which used to be 5
        FrameLoadTypeSame = FrameLoadTypeReload + 2, // 6
        FrameLoadTypeRedirectWithLockedBackForwardList, // 7
        FrameLoadTypeReplace, // 8
        FrameLoadTypeReloadFromOrigin, //9
    };

Can you clarify what seems wrong? AFAICT, it's exactly what the comment says - we removed FrameLoadTypeReloadAllowingStaleData without changing values of other values.
Comment 3 Simon Fraser (smfr) 2013-05-13 10:57:52 PDT
Tired brain was tired. Still, I think it would be clearer to replace:

        // Skipped value: 'FrameLoadTypeReloadAllowingStaleData', still present in mac/win public API. Ready to be reused
        FrameLoadTypeSame = FrameLoadTypeReload + 2, // user loads same URL again (but not reload button)

with
        FrameLoadTypeUnused, // Skipped value: 'FrameLoadTypeReloadAllowingStaleData', still present in mac/win public API. Ready to be reused
        FrameLoadTypeSame,